From 639c086728ba8690d1f26f491727319813870274 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 23 Jan 2019 21:08:39 +0200 Subject: [PATCH 1/9] Bump version to 3.6.5a1 --- HISTORY.rst | 3 +++ platformio/__init__.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index fb8f8747..a2e01ada 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,9 @@ Release Notes PlatformIO 3.0 -------------- +3.6.5 (2019-??-??) +~~~~~~~~~~~~~~~~~~ + 3.6.4 (2019-01-23) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/__init__.py b/platformio/__init__.py index bb0d7626..d445d6c4 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 6, 4) +VERSION = (3, 6, "5a1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 00ba88911f53c8b21439293529acfe7e173390a6 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 19 Feb 2019 20:12:07 +0200 Subject: [PATCH 2/9] Fix an issue with slow updating of PlatformIO Core packages on Windows --- HISTORY.rst | 2 ++ platformio/managers/core.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index a2e01ada..2474c540 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,8 @@ PlatformIO 3.0 3.6.5 (2019-??-??) ~~~~~~~~~~~~~~~~~~ +* Fixed an issue with slow updating of PlatformIO Core packages on Windows + 3.6.4 (2019-01-23) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/managers/core.py b/platformio/managers/core.py index 2a516f04..34831b48 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -106,9 +106,10 @@ def update_core_packages(only_check=False, silent=False): def shutdown_piohome_servers(): port = 8010 - while port < 8100: + while port < 8050: try: - requests.get("http://127.0.0.1:%d?__shutdown__=1" % port) + requests.get( + "http://127.0.0.1:%d?__shutdown__=1" % port, timeout=0.01) except: # pylint: disable=bare-except pass port += 1 From 856798488ba990eed7276705c2e3bbd3d3bab855 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 23 Feb 2019 18:39:54 +0200 Subject: [PATCH 3/9] Fix an issue when `platformio ci` recompiles project if ``--keep-build-dir`` option is passed // Resolve #2109 --- HISTORY.rst | 2 ++ platformio/commands/ci.py | 11 +++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 2474c540..8b510cfe 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -8,6 +8,8 @@ PlatformIO 3.0 ~~~~~~~~~~~~~~~~~~ * Fixed an issue with slow updating of PlatformIO Core packages on Windows +* Fixed an issue when `platformio ci `__ recompiles project if ``--keep-build-dir`` option is passed + (`issue #2109 `_) 3.6.4 (2019-01-23) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/commands/ci.py b/platformio/commands/ci.py index 0abf72d2..a5f28256 100644 --- a/platformio/commands/ci.py +++ b/platformio/commands/ci.py @@ -84,7 +84,11 @@ def cli( # pylint: disable=too-many-arguments try: app.set_session_var("force_option", True) - _clean_dir(build_dir) + + if not keep_build_dir and isdir(build_dir): + util.rmtree_(build_dir) + if not isdir(build_dir): + makedirs(build_dir) for dir_name, patterns in dict(lib=lib, src=src).items(): if not patterns: @@ -116,11 +120,6 @@ def cli( # pylint: disable=too-many-arguments util.rmtree_(build_dir) -def _clean_dir(dirpath): - util.rmtree_(dirpath) - makedirs(dirpath) - - def _copy_contents(dst_dir, contents): items = {"dirs": set(), "files": set()} From d2c2171ef9a4447bf8d61aa4e2958deb27634a74 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 23 Feb 2019 22:34:36 +0200 Subject: [PATCH 4/9] Project Generator: add new targets for CLion IDE "BUILD_VERBOSE" and "MONITOR" (serial port monitor) // Resolve #359 --- HISTORY.rst | 2 ++ platformio/ide/tpls/clion/CMakeLists.txt.tpl | 12 ++++++++++++ platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 8b510cfe..2f4ac54e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,8 @@ PlatformIO 3.0 3.6.5 (2019-??-??) ~~~~~~~~~~~~~~~~~~ +* Project Generator: added new targets for CLion IDE "BUILD_VERBOSE" and "MONITOR" (serial port monitor) + (`issue #359 `_) * Fixed an issue with slow updating of PlatformIO Core packages on Windows * Fixed an issue when `platformio ci `__ recompiles project if ``--keep-build-dir`` option is passed (`issue #2109 `_) diff --git a/platformio/ide/tpls/clion/CMakeLists.txt.tpl b/platformio/ide/tpls/clion/CMakeLists.txt.tpl index 63274c43..7b17a983 100644 --- a/platformio/ide/tpls/clion/CMakeLists.txt.tpl +++ b/platformio/ide/tpls/clion/CMakeLists.txt.tpl @@ -9,6 +9,12 @@ add_custom_target( WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) +add_custom_target( + PLATFORMIO_BUILD_VERBOSE ALL + COMMAND ${PLATFORMIO_CMD} -f -c clion run --verbose + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +) + add_custom_target( PLATFORMIO_UPLOAD ALL COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload @@ -21,6 +27,12 @@ add_custom_target( WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) +add_custom_target( + PLATFORMIO_MONITOR ALL + COMMAND ${PLATFORMIO_CMD} -f -c clion device monitor + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +) + add_custom_target( PLATFORMIO_TEST ALL COMMAND ${PLATFORMIO_CMD} -f -c clion test diff --git a/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl b/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl index a1c84d68..0f7c053e 100644 --- a/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl +++ b/platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl @@ -1,3 +1,7 @@ +# !!! WARNING !!! +# PLEASE DO NOT MODIFY THIS FILE! +# USE https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags + % def _normalize_path(path): % if project_dir in path: % path = path.replace(project_dir, "${CMAKE_CURRENT_LIST_DIR}") From 977877883049daf5390b71210fd9c32da0f7be0e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 24 Feb 2019 11:45:14 +0200 Subject: [PATCH 5/9] PyLin fix --- platformio/commands/ci.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/commands/ci.py b/platformio/commands/ci.py index a5f28256..0b5b3e4e 100644 --- a/platformio/commands/ci.py +++ b/platformio/commands/ci.py @@ -73,7 +73,7 @@ def validate_path(ctx, param, value): # pylint: disable=unused-argument @click.option("-O", "--project-option", multiple=True) @click.option("-v", "--verbose", is_flag=True) @click.pass_context -def cli( # pylint: disable=too-many-arguments +def cli( # pylint: disable=too-many-arguments, too-many-branches ctx, src, lib, exclude, board, build_dir, keep_build_dir, project_conf, project_option, verbose): From b99494671a70560feb0d4ccd2a55e0693264cfa2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 6 Mar 2019 22:39:24 +0200 Subject: [PATCH 6/9] Update "dl.bintray.com" IP address --- platformio/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/util.py b/platformio/util.py index 5fe186d7..f1513e08 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -682,7 +682,7 @@ def get_api_result(url, params=None, data=None, auth=None, cache_valid=None): PING_INTERNET_IPS = [ "192.30.253.113", # github.com - "159.122.18.156", # dl.bintray.com + "18.195.111.75", # dl.bintray.com "193.222.52.25" # dl.platformio.org ] From 9639626ab3be8120192f9203a855af84fd7034a7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 7 Mar 2019 12:40:55 +0200 Subject: [PATCH 7/9] Fix an issue when ``$PROJECT_HASH`` template was not expanded for the other directory ``***_dir`` options in "platformio.ini" // Resolve #2170 --- HISTORY.rst | 32 +++++++++++++++++--------------- docs | 2 +- examples | 2 +- platformio/util.py | 21 ++++++++++++--------- 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 2f4ac54e..488b8b6a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -12,6 +12,8 @@ PlatformIO 3.0 * Fixed an issue with slow updating of PlatformIO Core packages on Windows * Fixed an issue when `platformio ci `__ recompiles project if ``--keep-build-dir`` option is passed (`issue #2109 `_) +* Fixed an issue when ``$PROJECT_HASH`` template was not expanded for the other directory ``***_dir`` options in `"platformio.ini" (Project Configuration File) `__ + (`issue #2170 `_) 3.6.4 (2019-01-23) ~~~~~~~~~~~~~~~~~~ @@ -55,8 +57,8 @@ PlatformIO 3.0 ~~~~~~~~~~~~~~~~~~ * Generate an `include `__ and `test `__ directories with a README file when initializing a new project -* Support in-line comments for multi-line value (``lib_deps``, ``build_flags``, etc) in `“platformio.ini” (Project Configuration File) `__ -* Added ``$PROJECT_HASH`` template variable for `build_dir `__. One of the use cases is setting a global storage for project artifacts using `PLATFORMIO_BUILD_DIR `__ system environment variable. For example, ``/tmp/pio-build/$PROJECT_HASH`` (Unix) or ``%TEMP%/pio-build/$PROJECT_HASH`` (Windows) +* Support in-line comments for multi-line value (``lib_deps``, ``build_flags``, etc) in `"platformio.ini" (Project Configuration File) `__ +* Added ``$PROJECT_HASH`` template variable for `build_dir `__. One of the use cases is setting a global storage for project artifacts using `PLATFORMIO_BUILD_DIR `__ system environment variable. For example, ``/tmp/pio-build/$PROJECT_HASH`` (Unix) or ``$[sysenv.TEMP}/pio-build/$PROJECT_HASH`` (Windows) * Improved a loading speed of PIO Home "Recent News" * Improved `PIO Unified Debugger `__ for "mbed" framework and fixed issue with missed local variables * Introduced `"Release" and "Debug" Build Configurations `__ @@ -140,7 +142,7 @@ PlatformIO 3.0 * Simplify configuration for `PIO Unit Testing `__: separate main program from a test build process, drop requirement for ``#ifdef UNIT_TEST`` guard -* Override any option from board manifest in `“platformio.ini” (Project Configuration File) `__ +* Override any option from board manifest in `"platformio.ini" (Project Configuration File) `__ (`issue #1612 `_) * Configure a custom path to SVD file using `debug_svd_path `__ option @@ -203,7 +205,7 @@ PlatformIO 3.0 (`issue #1274 `_) * Configure a custom firmware/program name in build directory (`example `__) * Renamed ``envs_dir`` option to ``build_dir`` - in `“platformio.ini” (Project Configuration File) `__ + in `"platformio.ini" (Project Configuration File) `__ * Refactored code without "arrow" dependency (resolve issue with "ImportError: No module named backports.functools_lru_cache") * Improved support of PIO Unified Debugger for Eclipse Oxygen @@ -238,7 +240,7 @@ PlatformIO 3.0 folder for project's header files (`issue #1107 `_) * Depend on development platform using VCS URL (Git, Mercurial and Subversion) - instead of a name in `“platformio.ini” (Project Configuration File) `__. + instead of a name in `"platformio.ini" (Project Configuration File) `__. Drop support for ``*_stage`` dev/platform names (use VCS URL instead). * Reinstall/redownload package with a new ``-f, --force`` option for `platformio lib install `__ @@ -259,7 +261,7 @@ PlatformIO 3.0 - Parse library source file in pair with a header when they have the same name (`issue #1175 `_) - Handle library dependencies defined as VCS or SemVer in - `“platformio.ini” (Project Configuration File) `__ + `"platformio.ini" (Project Configuration File) `__ (`issue #1155 `_) - Added option to configure library `Compatible Mode `__ using `library.json `__ @@ -295,7 +297,7 @@ PlatformIO 3.0 * Use a root of library when filtering source code using `library.json `__ and ``srcFilter`` field -* Added ``monitor_*`` options to white-list for `“platformio.ini” (Project Configuration File) `__ +* Added ``monitor_*`` options to white-list for `"platformio.ini" (Project Configuration File) `__ (`issue #982 `_) * Do not ask for board ID when initialize project for desktop platform * Handle broken PIO Core state and create new one @@ -316,18 +318,18 @@ PlatformIO 3.0 - Integration with `Eclipse `__ and `Sublime Text `__ * Filter `PIO Unit Testing `__ - tests using a new ``test_filter`` option in `“platformio.ini” (Project Configuration File) `__ + tests using a new ``test_filter`` option in `"platformio.ini" (Project Configuration File) `__ or `platformio test --filter `__ command (`issue #934 `_) * Custom ``test_transport`` for `PIO Unit Testing `__ Engine -* Configure Serial Port Monitor in `“platformio.ini” (Project Configuration File) `__ +* Configure Serial Port Monitor in `"platformio.ini" (Project Configuration File) `__ (`issue #787 `_) * New `monitor `__ target which allows to launch Serial Monitor automatically after successful "build" or "upload" operations (`issue #788 `_) * Project generator for `VIM `__ -* Multi-line support for the different options in `“platformio.ini” (Project Configuration File) `__, +* Multi-line support for the different options in `"platformio.ini" (Project Configuration File) `__, such as: ``build_flags``, ``build_unflags``, etc. (`issue #889 `_) * Handle dynamic ``SRC_FILTER`` environment variable from @@ -339,7 +341,7 @@ PlatformIO 3.0 that were installed from repository * Add support for ``.*cc`` extension (`issue #939 `_) -* Handle ``env_default`` in `“platformio.ini” (Project Configuration File) `__ +* Handle ``env_default`` in `"platformio.ini" (Project Configuration File) `__ when re-initializing a project (`issue #950 `_) * Use root directory for PIO Home when path contains non-ascii characters @@ -437,10 +439,10 @@ PlatformIO 3.0 (`issue #808 `_, `issue #467 `_) * Inject system environment variables to configuration settings in - `“platformio.ini” (Project Configuration File) `__ + `"platformio.ini" (Project Configuration File) `__ (`issue #792 `_) * Custom boards per project with ``boards_dir`` option in - `“platformio.ini” (Project Configuration File) `__ + `"platformio.ini" (Project Configuration File) `__ (`issue #515 `_) * Unix shell-style wildcards for `upload_port `_ (`issue #839 `_) @@ -451,7 +453,7 @@ PlatformIO 3.0 * Added new `LDF Modes `__: ``chain+`` and ``deep+`` and set ``chain+`` as default * Added global ``lib_extra_dirs`` option to ``[platformio]`` section for - `“platformio.ini” (Project Configuration File) `__ + `"platformio.ini" (Project Configuration File) `__ (`issue #842 `_) * Enabled caching by default for API requests and Library Manager (see `enable_cache `__ setting) * Native integration with VIM/Neovim using `neomake-platformio `__ plugin @@ -474,7 +476,7 @@ PlatformIO 3.0 3.1.0 (2016-09-19) ~~~~~~~~~~~~~~~~~~ -* New! Dynamic variables/templates for `“platformio.ini” (Project Configuration File) `__ +* New! Dynamic variables/templates for `"platformio.ini" (Project Configuration File) `__ (`issue #705 `_) * Summary about processed environments (`issue #777 `_) diff --git a/docs b/docs index a48c700b..768ccfd2 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit a48c700ba11faa1da891ddeab613192c768252a9 +Subproject commit 768ccfd2b4a3e508addb48f7f6d1fdebad5d946c diff --git a/examples b/examples index 99f177e5..9c16f551 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 99f177e5be7c595ac99167fd7b302ea117d64b42 +Subproject commit 9c16f551d72e37aa4c2f28555487e2fb23408b5d diff --git a/platformio/util.py b/platformio/util.py index f1513e08..92645a5e 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -203,28 +203,34 @@ def pioversion_to_intstr(): def get_project_optional_dir(name, default=None): - data = None + paths = None var_name = "PLATFORMIO_%s" % name.upper() if var_name in os.environ: - data = os.getenv(var_name) + paths = os.getenv(var_name) else: try: config = load_project_config() if (config.has_section("platformio") and config.has_option("platformio", name)): - data = config.get("platformio", name) + paths = config.get("platformio", name) except exception.NotPlatformIOProject: pass - if not data: + if not paths: return default items = [] - for item in data.split(", "): + for item in paths.split(", "): if item.startswith("~"): item = expanduser(item) items.append(abspath(item)) - return ", ".join(items) + paths = ", ".join(items) + + while "$PROJECT_HASH" in paths: + paths = paths.replace("$PROJECT_HASH", + sha1(get_project_dir()).hexdigest()[:10]) + + return paths def get_home_dir(): @@ -314,9 +320,6 @@ def get_projectboards_dir(): def get_projectbuild_dir(force=False): path = get_project_optional_dir("build_dir", join(get_project_dir(), ".pioenvs")) - if "$PROJECT_HASH" in path: - path = path.replace("$PROJECT_HASH", - sha1(get_project_dir()).hexdigest()[:10]) try: if not isdir(path): os.makedirs(path) From 736a1404b4cfaf00f4a749f1451900969caf0681 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 7 Mar 2019 12:55:03 +0200 Subject: [PATCH 8/9] YAPF 0.26.0 --- platformio/app.py | 4 ++-- platformio/builder/tools/pioplatform.py | 6 ++++-- platformio/commands/platform.py | 4 ++-- platformio/managers/platform.py | 6 ++---- platformio/util.py | 15 +++++---------- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/platformio/app.py b/platformio/app.py index d3c82d25..497f096e 100644 --- a/platformio/app.py +++ b/platformio/app.py @@ -352,8 +352,8 @@ def get_cid(): pass cid = str( uuid.UUID( - bytes=hashlib.md5(str(_uid if _uid else uuid.getnode())). - digest())) + bytes=hashlib.md5(str( + _uid if _uid else uuid.getnode())).digest())) if "windows" in util.get_systype() or os.getuid() > 0: set_state_item("cid", cid) return cid diff --git a/platformio/builder/tools/pioplatform.py b/platformio/builder/tools/pioplatform.py index 9d37ae77..580f04a2 100644 --- a/platformio/builder/tools/pioplatform.py +++ b/platformio/builder/tools/pioplatform.py @@ -95,8 +95,10 @@ def LoadPioPlatform(env, variables): for key, value in variables.UnknownVariables().items(): if not key.startswith("BOARD_"): continue - env.Replace( - **{key.upper().replace("BUILD.", ""): base64.b64decode(value)}) + env.Replace(**{ + key.upper().replace("BUILD.", ""): + base64.b64decode(value) + }) return # update board manifest with a custom data diff --git a/platformio/commands/platform.py b/platformio/commands/platform.py index 4ccd65ff..017dbc85 100644 --- a/platformio/commands/platform.py +++ b/platformio/commands/platform.py @@ -365,8 +365,8 @@ def platform_update(platforms, only_packages, only_check, json_output): if not pkg_dir: continue latest = pm.outdated(pkg_dir, requirements) - if (not latest and not PlatformFactory.newPlatform(pkg_dir). - are_outdated_packages()): + if (not latest and not PlatformFactory.newPlatform( + pkg_dir).are_outdated_packages()): continue data = _get_installed_platform_data( pkg_dir, with_boards=False, expose_packages=False) diff --git a/platformio/managers/platform.py b/platformio/managers/platform.py index 5f7e0adc..a2c1c795 100644 --- a/platformio/managers/platform.py +++ b/platformio/managers/platform.py @@ -633,10 +633,8 @@ class PlatformBase( # pylint: disable=too-many-public-methods if not isdir(libcore_dir): continue storages.append({ - "name": - "%s-core-%s" % (opts['package'], item), - "path": - libcore_dir + "name": "%s-core-%s" % (opts['package'], item), + "path": libcore_dir }) return storages diff --git a/platformio/util.py b/platformio/util.py index 92645a5e..777314f6 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -568,16 +568,11 @@ def get_mdns_services(): pass items.append({ - "type": - service.type, - "name": - service.name, - "ip": - ".".join([str(ord(c)) for c in service.address]), - "port": - service.port, - "properties": - properties + "type": service.type, + "name": service.name, + "ip": ".".join([str(ord(c)) for c in service.address]), + "port": service.port, + "properties": properties }) return items From b562541f20c9e6289e27372dcde2581a8fec52f9 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 7 Mar 2019 13:57:32 +0200 Subject: [PATCH 9/9] Bump version to 3.6.5 --- HISTORY.rst | 2 +- platformio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 488b8b6a..84ee3562 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,7 +4,7 @@ Release Notes PlatformIO 3.0 -------------- -3.6.5 (2019-??-??) +3.6.5 (2019-03-07) ~~~~~~~~~~~~~~~~~~ * Project Generator: added new targets for CLion IDE "BUILD_VERBOSE" and "MONITOR" (serial port monitor) diff --git a/platformio/__init__.py b/platformio/__init__.py index d445d6c4..d0f05a30 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 6, "5a1") +VERSION = (3, 6, 5) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio"