From 6a49df7dfeeae35594acd17746983f64505d28fd Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 13 Mar 2018 12:02:25 +0200 Subject: [PATCH 001/106] Start a work on PIO Core 3.5.3 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 1a98a778..94595d2b 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, 2) +VERSION = (3, 5, "3a1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From b78a151706bd4966f1665428b86d433cb4587dec Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 13 Mar 2018 22:59:02 +0200 Subject: [PATCH 002/106] Update requirements for PIO Home and PIO Core+ contribs --- platformio/managers/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio/managers/core.py b/platformio/managers/core.py index 9f3cc628..75ce6162 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -21,9 +21,9 @@ from platformio import __version__, exception, util from platformio.managers.package import PackageManager CORE_PACKAGES = { - "contrib-piohome": ">=0.7.1,<2", + "contrib-piohome": ">=0.8.1,<2", "contrib-pysite": ">=0.1.5,<2", - "tool-pioplus": ">=0.14.5,<2", + "tool-pioplus": ">=1.0.0,<2", "tool-unity": "~1.20302.1", "tool-scons": "~2.20501.4" } From d2b34d42f717aa466857e0e7287153a22d1ee879 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 14 Mar 2018 11:36:30 +0200 Subject: [PATCH 003/106] Docs: Fix missed "s" for "99-platformio-udev.rules" --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index e9e78d04..7ec528b1 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit e9e78d043e4a1ba699f3e8e2b12bfeeeb18b1bd7 +Subproject commit 7ec528b1a079f907ab2194dec897f7ec8bb8ba46 From 3663dc3470038d3f21b6908ce905394beeeceff2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 15 Mar 2018 19:53:05 +0200 Subject: [PATCH 004/106] Fix issue with useless project rebuilding for case insensitive file systems (Windows) --- HISTORY.rst | 6 ++++++ platformio/commands/lib.py | 7 ++++--- platformio/commands/run.py | 11 ++++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index b672ab6c..0e57f504 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,12 @@ Release Notes PlatformIO 3.0 -------------- +3.5.3 (2018-??-??) +~~~~~~~~~~~~~~~~~~ + +* Fixed issue with useless project rebuilding for case insensitive file + systems (Windows) + 3.5.2 (2018-03-13) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/commands/lib.py b/platformio/commands/lib.py index ee2ec01d..81400684 100644 --- a/platformio/commands/lib.py +++ b/platformio/commands/lib.py @@ -255,9 +255,10 @@ def lib_search(query, json_output, page, noninteractive, **filters): elif not click.confirm("Show next libraries?"): break result = get_api_result( - "/v2/lib/search", - {"query": " ".join(query), - "page": int(result['page']) + 1}, + "/v2/lib/search", { + "query": " ".join(query), + "page": int(result['page']) + 1 + }, cache_valid="1d") diff --git a/platformio/commands/run.py b/platformio/commands/run.py index c0aab27f..aa7c9176 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -411,7 +411,7 @@ def check_project_envs(config, environments=None): def calculate_project_hash(): check_suffixes = (".c", ".cc", ".cpp", ".h", ".hpp", ".s", ".S") - structure = [__version__] + chunks = [__version__] for d in (util.get_projectsrc_dir(), util.get_projectlib_dir()): if not isdir(d): continue @@ -419,5 +419,10 @@ def calculate_project_hash(): for f in files: path = join(root, f) if path.endswith(check_suffixes): - structure.append(path) - return sha1(",".join(sorted(structure))).hexdigest() + chunks.append(path) + chunks_to_str = ",".join(sorted(chunks)) + if "windows" in util.get_systype(): + # Fix issue with useless project rebuilding for case insensitive FS. + # A case of disk drive can differ... + chunks_to_str = chunks_to_str.lower() + return sha1(chunks_to_str).hexdigest() From 74951603748ed17c25b12a0e3fc3048124eff77f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 15 Mar 2018 19:53:47 +0200 Subject: [PATCH 005/106] Bump version to 3.5.3a2 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 94595d2b..c4024c6a 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3a1") +VERSION = (3, 5, "3a2") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 02bad106523b22ab1a4bc31bb2dcf52d36dc208e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 15 Mar 2018 20:53:23 +0200 Subject: [PATCH 006/106] Do not show duplicated upload protocols --- platformio/builder/tools/pioupload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index 7bc036fb..63ba3b03 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -220,7 +220,7 @@ def PrintUploadInfo(env): available.extend(env.BoardConfig().get("upload", {}).get( "protocols", [])) if available: - print "AVAILABLE: %s" % ", ".join(sorted(available)) + print "AVAILABLE: %s" % ", ".join(sorted(set(available))) if configured: print "CURRENT: upload_protocol = %s" % configured From 218a1dccf6737d1b50bd5f0cdcffc6222e90899a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 16 Mar 2018 13:33:59 +0200 Subject: [PATCH 007/106] Fix issue with installing only the one platform package by specified type --- platformio/managers/core.py | 2 +- platformio/managers/lib.py | 10 +++---- platformio/managers/package.py | 12 ++++----- platformio/managers/platform.py | 47 ++++++++++++++++++--------------- tests/commands/test_platform.py | 3 ++- 5 files changed, 39 insertions(+), 35 deletions(-) diff --git a/platformio/managers/core.py b/platformio/managers/core.py index 75ce6162..c835ed84 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -69,7 +69,7 @@ class CorePackageManager(PackageManager): if manifest['name'] not in best_pkg_versions: continue if manifest['version'] != best_pkg_versions[manifest['name']]: - self.uninstall(manifest['__pkg_dir'], trigger_event=False) + self.uninstall(manifest['__pkg_dir'], after_update=True) self.cache_reset() return True diff --git a/platformio/managers/lib.py b/platformio/managers/lib.py index c1e5ab96..9fa3d02a 100644 --- a/platformio/managers/lib.py +++ b/platformio/managers/lib.py @@ -332,7 +332,7 @@ class LibraryManager(BasePkgManager): name, requirements=None, silent=False, - trigger_event=True, + after_update=False, interactive=False, force=False): _name, _requirements, _url = self.parse_pkg_uri(name, requirements) @@ -350,7 +350,7 @@ class LibraryManager(BasePkgManager): name, requirements, silent=silent, - trigger_event=trigger_event, + after_update=after_update, force=force) if not pkg_dir: @@ -369,7 +369,7 @@ class LibraryManager(BasePkgManager): self.install( "{name}={version}".format(**filters), silent=silent, - trigger_event=trigger_event, + after_update=after_update, interactive=interactive, force=force) else: @@ -385,14 +385,14 @@ class LibraryManager(BasePkgManager): lib_id, filters.get("version"), silent=silent, - trigger_event=trigger_event, + after_update=after_update, interactive=interactive, force=force) else: self.install( lib_id, silent=silent, - trigger_event=trigger_event, + after_update=after_update, interactive=interactive, force=force) return pkg_dir diff --git a/platformio/managers/package.py b/platformio/managers/package.py index 905b756a..d3942905 100644 --- a/platformio/managers/package.py +++ b/platformio/managers/package.py @@ -633,7 +633,7 @@ class BasePkgManager(PkgRepoMixin, PkgInstallerMixin): name, requirements=None, silent=False, - trigger_event=True, + after_update=False, force=False): name, requirements, url = self.parse_pkg_uri(name, requirements) package_dir = self.get_package_dir(name, requirements, url) @@ -676,7 +676,7 @@ class BasePkgManager(PkgRepoMixin, PkgInstallerMixin): manifest = self.load_manifest(pkg_dir) assert manifest - if trigger_event: + if not after_update: telemetry.on_event( category=self.__class__.__name__, action="Install", @@ -690,7 +690,7 @@ class BasePkgManager(PkgRepoMixin, PkgInstallerMixin): return pkg_dir - def uninstall(self, package, requirements=None, trigger_event=True): + def uninstall(self, package, requirements=None, after_update=False): if isdir(package): pkg_dir = package else: @@ -723,7 +723,7 @@ class BasePkgManager(PkgRepoMixin, PkgInstallerMixin): click.echo("[%s]" % click.style("OK", fg="green")) - if trigger_event: + if not after_update: telemetry.on_event( category=self.__class__.__name__, action="Uninstall", @@ -769,8 +769,8 @@ class BasePkgManager(PkgRepoMixin, PkgInstallerMixin): self._update_src_manifest( dict(version=vcs.get_current_revision()), vcs.storage_dir) else: - self.uninstall(pkg_dir, trigger_event=False) - self.install(name, latest, trigger_event=False) + self.uninstall(pkg_dir, after_update=True) + self.install(name, latest, after_update=True) telemetry.on_event( category=self.__class__.__name__, diff --git a/platformio/managers/platform.py b/platformio/managers/platform.py index f147b762..bffcf16c 100644 --- a/platformio/managers/platform.py +++ b/platformio/managers/platform.py @@ -62,7 +62,7 @@ class PlatformManager(BasePkgManager): with_packages=None, without_packages=None, skip_default_package=False, - trigger_event=True, + after_update=False, silent=False, force=False, **_): # pylint: disable=too-many-arguments, arguments-differ @@ -70,20 +70,20 @@ class PlatformManager(BasePkgManager): self, name, requirements, silent=silent, force=force) p = PlatformFactory.newPlatform(platform_dir) - # @Hook: when 'update' operation (trigger_event is False), - # don't cleanup packages or install them - if not trigger_event: + # don't cleanup packages or install them after update + # we check packages for updates in def update() + if after_update: return True + p.install_packages( with_packages, without_packages, skip_default_package, silent=silent, force=force) - self.cleanup_packages(p.packages.keys()) - return True + return self.cleanup_packages(p.packages.keys()) - def uninstall(self, package, requirements=None, trigger_event=True): + def uninstall(self, package, requirements=None, after_update=False): if isdir(package): pkg_dir = package else: @@ -96,13 +96,12 @@ class PlatformManager(BasePkgManager): p = PlatformFactory.newPlatform(pkg_dir) BasePkgManager.uninstall(self, pkg_dir, requirements) - # @Hook: when 'update' operation (trigger_event is False), - # don't cleanup packages or install them - if not trigger_event: + # don't cleanup packages or install them after update + # we check packages for updates in def update() + if after_update: return True - self.cleanup_packages(p.packages.keys()) - return True + return self.cleanup_packages(p.packages.keys()) def update( # pylint: disable=arguments-differ self, @@ -154,7 +153,7 @@ class PlatformManager(BasePkgManager): continue if (manifest['name'] not in deppkgs or manifest['version'] not in deppkgs[manifest['name']]): - pm.uninstall(manifest['__pkg_dir'], trigger_event=False) + pm.uninstall(manifest['__pkg_dir'], after_update=True) self.cache_reset() return True @@ -280,21 +279,25 @@ class PlatformPackagesMixin(object): return True - def find_pkg_names(self, items): + def find_pkg_names(self, candidates): result = [] - for item in items: - candidate = item + for candidate in candidates: + found = False # lookup by package types for _name, _opts in self.packages.items(): - if _opts.get("type") == item: - candidate = _name + if _opts.get("type") == candidate: + result.append(_name) + found = True - if (self.frameworks and item.startswith("framework-") - and item[10:] in self.frameworks): - candidate = self.frameworks[item[10:]]['package'] + if (self.frameworks and candidate.startswith("framework-") + and candidate[10:] in self.frameworks): + result.append(self.frameworks[candidate[10:]]['package']) + found = True + + if not found: + result.append(candidate) - result.append(candidate) return result def update_packages(self, only_check=False): diff --git a/tests/commands/test_platform.py b/tests/commands/test_platform.py index 5b3053fe..d327ef37 100644 --- a/tests/commands/test_platform.py +++ b/tests/commands/test_platform.py @@ -61,13 +61,14 @@ def test_install_known_version(clirunner, validate_cliresult, assert len(isolated_pio_home.join("packages").listdir()) == 1 -def test_install_from_vcs(clirunner, validate_cliresult): +def test_install_from_vcs(clirunner, validate_cliresult, isolated_pio_home): result = clirunner.invoke(cli_platform.platform_install, [ "https://github.com/platformio/" "platform-espressif8266.git#feature/stage", "--skip-default-package" ]) validate_cliresult(result) assert "espressif8266" in result.output + assert len(isolated_pio_home.join("packages").listdir()) == 1 def test_list_json_output(clirunner, validate_cliresult): From 233d48fac05556639fd605490d62ccbaaf84185b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 16 Mar 2018 14:12:05 +0200 Subject: [PATCH 008/106] Describe a project with "description" option for "platformio.ini" --- HISTORY.rst | 4 ++++ docs | 2 +- platformio/commands/run.py | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 0e57f504..a2c72113 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,10 @@ PlatformIO 3.0 3.5.3 (2018-??-??) ~~~~~~~~~~~~~~~~~~ +* Describe your project with a new + `description `_ + option for `Project Configuration File "platformio.ini" `__ (information will be used by + `PlatformIO Home `_) * Fixed issue with useless project rebuilding for case insensitive file systems (Windows) diff --git a/docs b/docs index 7ec528b1..86b84d54 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 7ec528b1a079f907ab2194dec897f7ec8bb8ba46 +Subproject commit 86b84d54d7ac9821617ab71f0b4f159826b32136 diff --git a/platformio/commands/run.py b/platformio/commands/run.py index aa7c9176..98c29dda 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -126,9 +126,9 @@ class EnvironmentProcessor(object): DEFAULT_DUMP_OPTIONS = ("platform", "framework", "board") - KNOWN_PLATFORMIO_OPTIONS = ("env_default", "home_dir", "lib_dir", - "libdeps_dir", "include_dir", "src_dir", - "build_dir", "data_dir", "test_dir", + KNOWN_PLATFORMIO_OPTIONS = ("description", "env_default", "home_dir", + "lib_dir", "libdeps_dir", "include_dir", + "src_dir", "build_dir", "data_dir", "test_dir", "boards_dir", "lib_extra_dirs") KNOWN_ENV_OPTIONS = ("platform", "framework", "board", "board_mcu", From 3161e5f60652851b43999320e6ccce4c40977c9f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 16 Mar 2018 14:13:00 +0200 Subject: [PATCH 009/106] Bump version to 3.5.3a3 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index c4024c6a..48da90ea 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3a2") +VERSION = (3, 5, "3a3") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From c20cd1b4642f6db2287b7ecdb176820c9f8eb6fa Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 19 Mar 2018 17:16:51 +0200 Subject: [PATCH 010/106] Do not load automaically JSON from cached resources --- platformio/app.py | 23 +++++++++-------------- platformio/util.py | 7 ++++--- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/platformio/app.py b/platformio/app.py index 8ca1ba4c..dd7922f0 100644 --- a/platformio/app.py +++ b/platformio/app.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import codecs import hashlib import json import os @@ -106,7 +107,7 @@ class State(object): def __exit__(self, type_, value, traceback): if self._prev_state != self._state: try: - with open(self.path, "w") as fp: + with codecs.open(self.path, "w") as fp: if "dev" in __version__: json.dump(self._state, fp, indent=4) else: @@ -187,11 +188,8 @@ class ContentCache(object): cache_path = self.get_cache_path(key) if not isfile(cache_path): return None - with open(cache_path, "rb") as fp: - data = fp.read() - if data and data[0] in ("{", "["): - return json.loads(data) - return data + with codecs.open(cache_path, "rb") as fp: + return fp.read() def set(self, key, data, valid): if not get_setting("enable_cache"): @@ -212,12 +210,9 @@ class ContentCache(object): if not isdir(dirname(cache_path)): os.makedirs(dirname(cache_path)) - with open(cache_path, "wb") as fp: - if isinstance(data, (dict, list)): - json.dump(data, fp) - else: - fp.write(str(data)) - with open(self._db_path, "a") as fp: + with codecs.open(cache_path, "wb") as fp: + fp.write(str(data)) + with codecs.open(self._db_path, "a") as fp: fp.write("%s=%s\n" % (str(expire_time), cache_path)) return self._unlock_dbindex() @@ -233,7 +228,7 @@ class ContentCache(object): paths_for_delete = [self.get_cache_path(k) for k in keys] found = False newlines = [] - with open(self._db_path) as fp: + with codecs.open(self._db_path) as fp: for line in fp.readlines(): if "=" not in line: continue @@ -253,7 +248,7 @@ class ContentCache(object): pass if found and self._lock_dbindex(): - with open(self._db_path, "w") as fp: + with codecs.open(self._db_path, "w") as fp: fp.write("\n".join(newlines) + "\n") self._unlock_dbindex() diff --git a/platformio/util.py b/platformio/util.py index 459b85e2..8e1c3b7d 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -607,8 +607,9 @@ def _get_api_result( headers=headers, auth=auth, verify=verify_ssl) - result = r.json() r.raise_for_status() + r.json() + result = r.text except requests.exceptions.HTTPError as e: if result and "message" in result: raise exception.APIRequestError(result['message']) @@ -637,7 +638,7 @@ def get_api_result(url, params=None, data=None, auth=None, cache_valid=None): if cache_key: result = cc.get(cache_key) if result is not None: - return result + return json.loads(result) # check internet before and resolve issue with 60 seconds timeout internet_on(raise_exception=True) @@ -646,7 +647,7 @@ def get_api_result(url, params=None, data=None, auth=None, cache_valid=None): if cache_valid: with ContentCache() as cc: cc.set(cache_key, result, cache_valid) - return result + return json.loads(result) except (requests.exceptions.ConnectionError, requests.exceptions.Timeout) as e: from platformio.maintenance import in_silence From d47022b8c33c81ea12cae78c5b6f68cac791ad04 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Mar 2018 00:42:10 +0200 Subject: [PATCH 011/106] PIO Home: Recent news --- HISTORY.rst | 6 ++++++ platformio/managers/core.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index a2c72113..252c3000 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,12 @@ PlatformIO 3.0 3.5.3 (2018-??-??) ~~~~~~~~~~~~~~~~~~ +* `PlatformIO Home `__ - + interact with PlatformIO ecosystem using modern and cross-platform GUI: + + - "Recent News" block on "Welcome" page + - Direct import of development platform's example + * Describe your project with a new `description `_ option for `Project Configuration File "platformio.ini" `__ (information will be used by diff --git a/platformio/managers/core.py b/platformio/managers/core.py index c835ed84..63bd456e 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -21,9 +21,9 @@ from platformio import __version__, exception, util from platformio.managers.package import PackageManager CORE_PACKAGES = { - "contrib-piohome": ">=0.8.1,<2", - "contrib-pysite": ">=0.1.5,<2", - "tool-pioplus": ">=1.0.0,<2", + "contrib-piohome": ">=0.9.0,<2", + "contrib-pysite": ">=0.2.0,<2", + "tool-pioplus": ">=1.1.1,<2", "tool-unity": "~1.20302.1", "tool-scons": "~2.20501.4" } From 669ef3cc933b424302bb2eac3f51fba95f283892 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Mar 2018 00:42:37 +0200 Subject: [PATCH 012/106] Bump version to 3.5.3a4 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 48da90ea..5d5fe5d1 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3a3") +VERSION = (3, 5, "3a4") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From bbb32607ed7faa18f2fdaa6d7376ee729a88b041 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Mar 2018 01:06:05 +0200 Subject: [PATCH 013/106] Catch UnicodeError when saving content cache --- platformio/app.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/platformio/app.py b/platformio/app.py index dd7922f0..61e15491 100644 --- a/platformio/app.py +++ b/platformio/app.py @@ -210,10 +210,17 @@ class ContentCache(object): if not isdir(dirname(cache_path)): os.makedirs(dirname(cache_path)) - with codecs.open(cache_path, "wb") as fp: - fp.write(str(data)) - with codecs.open(self._db_path, "a") as fp: - fp.write("%s=%s\n" % (str(expire_time), cache_path)) + try: + with codecs.open(cache_path, "wb") as fp: + fp.write(data) + with codecs.open(self._db_path, "a") as fp: + fp.write("%s=%s\n" % (str(expire_time), cache_path)) + except UnicodeError: + if isfile(cache_path): + try: + remove(cache_path) + except OSError: + pass return self._unlock_dbindex() From ad52f618cf010077ac76946cd7ddb2964c0f9353 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Mar 2018 01:14:29 +0200 Subject: [PATCH 014/106] Save data in UTF-8 by default --- platformio/app.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/platformio/app.py b/platformio/app.py index 61e15491..06ca7cfb 100644 --- a/platformio/app.py +++ b/platformio/app.py @@ -107,7 +107,7 @@ class State(object): def __exit__(self, type_, value, traceback): if self._prev_state != self._state: try: - with codecs.open(self.path, "w") as fp: + with codecs.open(self.path, "w", encoding="utf8") as fp: if "dev" in __version__: json.dump(self._state, fp, indent=4) else: @@ -188,7 +188,7 @@ class ContentCache(object): cache_path = self.get_cache_path(key) if not isfile(cache_path): return None - with codecs.open(cache_path, "rb") as fp: + with codecs.open(cache_path, "rb", encoding="utf8") as fp: return fp.read() def set(self, key, data, valid): @@ -211,9 +211,9 @@ class ContentCache(object): if not isdir(dirname(cache_path)): os.makedirs(dirname(cache_path)) try: - with codecs.open(cache_path, "wb") as fp: + with codecs.open(cache_path, "wb", encoding="utf8") as fp: fp.write(data) - with codecs.open(self._db_path, "a") as fp: + with open(self._db_path, "a") as fp: fp.write("%s=%s\n" % (str(expire_time), cache_path)) except UnicodeError: if isfile(cache_path): @@ -235,7 +235,7 @@ class ContentCache(object): paths_for_delete = [self.get_cache_path(k) for k in keys] found = False newlines = [] - with codecs.open(self._db_path) as fp: + with open(self._db_path) as fp: for line in fp.readlines(): if "=" not in line: continue @@ -255,7 +255,7 @@ class ContentCache(object): pass if found and self._lock_dbindex(): - with codecs.open(self._db_path, "w") as fp: + with open(self._db_path, "w") as fp: fp.write("\n".join(newlines) + "\n") self._unlock_dbindex() From 61374f15f1ff9cac59b563d512846c3ae8418317 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Mar 2018 16:06:39 +0200 Subject: [PATCH 015/106] Fix issue with ``build_unflags`` option when a macro contains value --- .pytest_cache/v/cache/lastfailed | 1 + HISTORY.rst | 2 + platformio/builder/tools/platformio.py | 77 +++++++++++++----------- tests/test_builder.py | 81 ++++++++++++++++++++++++++ 4 files changed, 127 insertions(+), 34 deletions(-) create mode 100644 .pytest_cache/v/cache/lastfailed create mode 100644 tests/test_builder.py diff --git a/.pytest_cache/v/cache/lastfailed b/.pytest_cache/v/cache/lastfailed new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/.pytest_cache/v/cache/lastfailed @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/HISTORY.rst b/HISTORY.rst index 252c3000..644d7066 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -19,6 +19,8 @@ PlatformIO 3.0 `PlatformIO Home `_) * Fixed issue with useless project rebuilding for case insensitive file systems (Windows) +* Fixed issue with ``build_unflags`` option when a macro contains value + (e.g., ``-DNAME=VALUE``) 3.5.2 (2018-03-13) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index da82de85..00649dd9 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -119,38 +119,47 @@ def BuildProgram(env): return program -def ProcessFlags(env, flags): # pylint: disable=too-many-branches - if not flags: - return +def ParseFlagsExtended(env, flags): if isinstance(flags, list): flags = " ".join(flags) - parsed_flags = env.ParseFlags(str(flags)) - for flag in parsed_flags.pop("CPPDEFINES"): - if not Util.is_Sequence(flag): - env.Append(CPPDEFINES=flag) + result = env.ParseFlags(str(flags)) + + cppdefines = [] + for item in result['CPPDEFINES']: + if not Util.is_Sequence(item): + cppdefines.append(item) continue - _key, _value = flag[:2] - if '\"' in _value: - _value = _value.replace('\"', '\\\"') - elif _value.isdigit(): - _value = int(_value) - elif _value.replace(".", "", 1).isdigit(): - _value = float(_value) - env.Append(CPPDEFINES=(_key, _value)) - env.Append(**parsed_flags) + name, value = item[:2] + if '\"' in value: + value = value.replace('\"', '\\\"') + elif value.isdigit(): + value = int(value) + elif value.replace(".", "", 1).isdigit(): + value = float(value) + cppdefines.append((name, value)) + result['CPPDEFINES'] = cppdefines # fix relative CPPPATH & LIBPATH for k in ("CPPPATH", "LIBPATH"): - for i, p in enumerate(env.get(k, [])): + for i, p in enumerate(result.get(k, [])): if isdir(p): - env[k][i] = realpath(p) + result[k][i] = realpath(p) + # fix relative path for "-include" - for i, f in enumerate(env.get("CCFLAGS", [])): + for i, f in enumerate(result.get("CCFLAGS", [])): if isinstance(f, tuple) and f[0] == "-include": - env['CCFLAGS'][i] = (f[0], env.File(realpath(f[1].get_path()))) + result['CCFLAGS'][i] = (f[0], env.File(realpath(f[1].get_path()))) + + return result + + +def ProcessFlags(env, flags): # pylint: disable=too-many-branches + if not flags: + return + env.Append(**env.ParseFlagsExtended(flags)) # Cancel any previous definition of name, either built in or - # provided with a -D option // Issue #191 + # provided with a -U option // Issue #191 undefines = [ u for u in env.get("CCFLAGS", []) if isinstance(u, basestring) and u.startswith("-U") @@ -164,19 +173,18 @@ def ProcessFlags(env, flags): # pylint: disable=too-many-branches def ProcessUnFlags(env, flags): if not flags: return - if isinstance(flags, list): - flags = " ".join(flags) - parsed_flags = env.ParseFlags(str(flags)) - all_flags = [] - for items in parsed_flags.values(): - all_flags.extend(items) - all_flags = set(all_flags) - - for key in parsed_flags: - cur_flags = set(env.Flatten(env.get(key, []))) - for item in cur_flags & all_flags: - while item in env[key]: - env[key].remove(item) + for key, unflags in env.ParseFlagsExtended(flags).items(): + for unflag in unflags: + if not isinstance(unflag, (list, tuple)): + unflag = tuple([unflag]) + for current in env.get(key, []): + conditions = [ + unflag == current, + isinstance(current, (tuple, list)) + and unflag[0] == current[0] + ] + if any(conditions): + env[key].remove(current) def IsFileWithExt(env, file_, ext): # pylint: disable=W0613 @@ -298,6 +306,7 @@ def exists(_): def generate(env): env.AddMethod(BuildProgram) + env.AddMethod(ParseFlagsExtended) env.AddMethod(ProcessFlags) env.AddMethod(ProcessUnFlags) env.AddMethod(IsFileWithExt) diff --git a/tests/test_builder.py b/tests/test_builder.py new file mode 100644 index 00000000..675dbf65 --- /dev/null +++ b/tests/test_builder.py @@ -0,0 +1,81 @@ +# Copyright (c) 2014-present PlatformIO +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from platformio.commands.run import cli as cmd_run + + +def test_build_flags(clirunner, validate_cliresult, tmpdir): + build_flags = [("-D TEST_INT=13", "-DTEST_INT=13"), ("-DTEST_SINGLE_MACRO", "-DTEST_SINGLE_MACRO"), + ('-DTEST_STR_SPACE="Andrew Smith"', '"-DTEST_STR_SPACE=Andrew Smith"')] + + tmpdir.join("platformio.ini").write(""" +[env:native] +platform = native +build_flags = %s + """ % " ".join([f[0] for f in build_flags])) + + tmpdir.mkdir("src").join("main.cpp").write(""" +#if !defined(TEST_INT) || TEST_INT != 13 +#error "TEST_INT" +#endif + +#ifndef TEST_STR_SPACE +#error "TEST_STR_SPACE" +#endif + +int main() { +} +""") + + result = clirunner.invoke( + cmd_run, ["--project-dir", str(tmpdir), "--verbose"]) + validate_cliresult(result) + build_output = result.output[result.output.find( + "Scanning dependencies..."):] + for flag in build_flags: + assert flag[1] in build_output, flag + + +def test_build_unflags(clirunner, validate_cliresult, tmpdir): + tmpdir.join("platformio.ini").write(""" +[env:native] +platform = native +build_unflags = -DTMP_MACRO1=45 -I. -DNON_EXISTING_MACRO +extra_scripts = pre:extra.py +""") + + tmpdir.join("extra.py").write(""" +Import("env") +env.Append(CPPPATH="%s") +env.Append(CPPDEFINES="TMP_MACRO1") +env.Append(CPPDEFINES=["TMP_MACRO2"]) +env.Append(CPPDEFINES=("TMP_MACRO3", 13)) + """ % str(tmpdir)) + + tmpdir.mkdir("src").join("main.c").write(""" +#ifdef TMP_MACRO1 +#error "TMP_MACRO1 should be removed" +#endif + +int main() { +} +""") + + result = clirunner.invoke( + cmd_run, ["--project-dir", str(tmpdir), "--verbose"]) + validate_cliresult(result) + build_output = result.output[result.output.find( + "Scanning dependencies..."):] + assert "-DTMP_MACRO1" not in build_output + assert str(tmpdir) not in build_output From 85730619f45ce23b9f797220725a9459dff7a550 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Mar 2018 16:08:22 +0200 Subject: [PATCH 016/106] Ignore ".pytest_cache" from sources --- .gitignore | 1 + .pytest_cache/v/cache/lastfailed | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 .pytest_cache/v/cache/lastfailed diff --git a/.gitignore b/.gitignore index 0a54e681..07c7b427 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ build coverage.xml .coverage htmlcov +.pytest_cache diff --git a/.pytest_cache/v/cache/lastfailed b/.pytest_cache/v/cache/lastfailed deleted file mode 100644 index 9e26dfee..00000000 --- a/.pytest_cache/v/cache/lastfailed +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file From 6f9fac56630c898419e6498bacd287fc8f43c7ec Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Mar 2018 16:10:11 +0200 Subject: [PATCH 017/106] YAPF for test --- tests/test_builder.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_builder.py b/tests/test_builder.py index 675dbf65..a307faa9 100644 --- a/tests/test_builder.py +++ b/tests/test_builder.py @@ -16,8 +16,10 @@ from platformio.commands.run import cli as cmd_run def test_build_flags(clirunner, validate_cliresult, tmpdir): - build_flags = [("-D TEST_INT=13", "-DTEST_INT=13"), ("-DTEST_SINGLE_MACRO", "-DTEST_SINGLE_MACRO"), - ('-DTEST_STR_SPACE="Andrew Smith"', '"-DTEST_STR_SPACE=Andrew Smith"')] + build_flags = [("-D TEST_INT=13", "-DTEST_INT=13"), + ("-DTEST_SINGLE_MACRO", "-DTEST_SINGLE_MACRO"), + ('-DTEST_STR_SPACE="Andrew Smith"', + '"-DTEST_STR_SPACE=Andrew Smith"')] tmpdir.join("platformio.ini").write(""" [env:native] From 979a6a80f00e24f0e521e9481f64dd84cad9d172 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Mar 2018 19:24:05 +0200 Subject: [PATCH 018/106] Fix issue which did not allow to override runtime build environment using extra POST script --- HISTORY.rst | 2 ++ platformio/builder/main.py | 4 ++-- platformio/builder/tools/piomisc.py | 28 ++++++++++++-------------- platformio/builder/tools/platformio.py | 11 +++++----- tests/test_builder.py | 10 +++++++++ 5 files changed, 32 insertions(+), 23 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 644d7066..63c5ab84 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -21,6 +21,8 @@ PlatformIO 3.0 systems (Windows) * Fixed issue with ``build_unflags`` option when a macro contains value (e.g., ``-DNAME=VALUE``) +* Fixed issue which did not allow to override runtime build environment using + extra POST script 3.5.2 (2018-03-13) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 04a19eba..8da01270 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -156,7 +156,7 @@ env.LoadPioPlatform(commonvars) env.SConscriptChdir(0) env.SConsignFile(join("$PROJECTBUILD_DIR", ".sconsign.dblite")) -for item in env.GetPreExtraScripts(): +for item in env.GetExtraScripts("pre"): env.SConscript(item, exports="env") env.SConscript("$BUILD_SCRIPT") @@ -167,7 +167,7 @@ AlwaysBuild(env.Alias("__test", DEFAULT_TARGETS + ["size"])) if "UPLOAD_FLAGS" in env: env.Append(UPLOADERFLAGS=["$UPLOAD_FLAGS"]) -for item in env.GetPostExtraScripts(): +for item in env.GetExtraScripts("post"): env.SConscript(item, exports="env") if "envdump" in COMMAND_LINE_TARGETS: diff --git a/platformio/builder/tools/piomisc.py b/platformio/builder/tools/piomisc.py index 7c08237f..69e859f3 100644 --- a/platformio/builder/tools/piomisc.py +++ b/platformio/builder/tools/piomisc.py @@ -18,7 +18,7 @@ import atexit import re import sys from os import environ, remove, walk -from os.path import basename, isdir, isfile, join, relpath, sep +from os.path import basename, isdir, isfile, join, realpath, relpath, sep from tempfile import mkstemp from SCons.Action import Action @@ -302,18 +302,17 @@ def ProcessTest(env): duplicate=False) -def GetPreExtraScripts(env): - return [ - item[4:] for item in env.get("EXTRA_SCRIPTS", []) - if item.startswith("pre:") - ] - - -def GetPostExtraScripts(env): - return [ - item[5:] if item.startswith("post:") else item - for item in env.get("EXTRA_SCRIPTS", []) if not item.startswith("pre:") - ] +def GetExtraScripts(env, scope): + items = [] + for item in env.get("EXTRA_SCRIPTS", []): + if scope == "post" and ":" not in item: + items.append(item) + elif item.startswith("%s:" % scope): + items.append(item[len(scope) + 1:]) + if not items: + return items + with util.cd(env.subst("$PROJECT_DIR")): + return [realpath(item) for item in items] def exists(_): @@ -328,6 +327,5 @@ def generate(env): env.AddMethod(PioClean) env.AddMethod(ProcessDebug) env.AddMethod(ProcessTest) - env.AddMethod(GetPreExtraScripts) - env.AddMethod(GetPostExtraScripts) + env.AddMethod(GetExtraScripts) return env diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 00649dd9..80a6cbb9 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -289,15 +289,14 @@ def BuildFrameworks(env, frameworks): def BuildLibrary(env, variant_dir, src_dir, src_filter=None): - lib = env.Clone() - return lib.StaticLibrary( - lib.subst(variant_dir), - lib.CollectBuildFiles(variant_dir, src_dir, src_filter)) + return env.StaticLibrary( + env.subst(variant_dir), + env.CollectBuildFiles(variant_dir, src_dir, src_filter)) def BuildSources(env, variant_dir, src_dir, src_filter=None): - DefaultEnvironment().Append(PIOBUILDFILES=env.Clone().CollectBuildFiles( - variant_dir, src_dir, src_filter)) + DefaultEnvironment().Append( + PIOBUILDFILES=env.CollectBuildFiles(variant_dir, src_dir, src_filter)) def exists(_): diff --git a/tests/test_builder.py b/tests/test_builder.py index a307faa9..6dd90eb7 100644 --- a/tests/test_builder.py +++ b/tests/test_builder.py @@ -24,9 +24,15 @@ def test_build_flags(clirunner, validate_cliresult, tmpdir): tmpdir.join("platformio.ini").write(""" [env:native] platform = native +extra_scripts = extra.py build_flags = %s """ % " ".join([f[0] for f in build_flags])) + tmpdir.join("extra.py").write(""" +Import("env") +env.Append(CPPDEFINES="POST_SCRIPT_MACRO") + """) + tmpdir.mkdir("src").join("main.cpp").write(""" #if !defined(TEST_INT) || TEST_INT != 13 #error "TEST_INT" @@ -36,6 +42,10 @@ build_flags = %s #error "TEST_STR_SPACE" #endif +#ifndef POST_SCRIPT_MACRO +#error "POST_SCRIPT_MACRO" +#endif + int main() { } """) From 580c0601cf6e40af11e49e2d8b41557291d12328 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Mar 2018 19:32:00 +0200 Subject: [PATCH 019/106] Add example with POST scripting and changing of build flags in runtime --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 86b84d54..fb3c0b8f 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 86b84d54d7ac9821617ab71f0b4f159826b32136 +Subproject commit fb3c0b8f996fc6a17df62ae2ecfd034f7bf554f8 From cd3245960bf2b0e6c05228999e4b3aa1b400d8bf Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 21 Mar 2018 19:49:06 +0200 Subject: [PATCH 020/106] ThingForward, Webinar: Unit Testing for Embedded with PlatformIO and Qt Creator --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index fb3c0b8f..7ad89924 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit fb3c0b8f996fc6a17df62ae2ecfd034f7bf554f8 +Subproject commit 7ad89924f6c2eb318a9eb0417e87e8a0e33e60d5 From 14619533415a3ff2ca18a59ff7e514979cbfcaf4 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 21 Mar 2018 19:49:45 +0200 Subject: [PATCH 021/106] Process "unflags" after frameworks --- platformio/builder/tools/platformio.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 80a6cbb9..9198c751 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -63,8 +63,6 @@ def BuildProgram(env): # process extra flags from board if "BOARD" in env and "build.extra_flags" in env.BoardConfig(): env.ProcessFlags(env.BoardConfig().get("build.extra_flags")) - # remove base flags - env.ProcessUnFlags(env.get("BUILD_UNFLAGS")) # apply user flags env.ProcessFlags(env.get("BUILD_FLAGS")) @@ -74,6 +72,9 @@ def BuildProgram(env): # restore PIO macros if it was deleted by framework _append_pio_macros() + # remove specified flags + env.ProcessUnFlags(env.get("BUILD_UNFLAGS")) + # build dependent libs; place them before built-in libs env.Prepend(LIBS=env.BuildProjectLibraries()) From 8f7206b186929d3289e801fa0ff723e8d06bcbcd Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 22 Mar 2018 12:09:36 +0200 Subject: [PATCH 022/106] Use absolute path for CPP includes when exporting data to IDE --- platformio/builder/tools/pioide.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio/builder/tools/pioide.py b/platformio/builder/tools/pioide.py index e3f98ca4..833d9b84 100644 --- a/platformio/builder/tools/pioide.py +++ b/platformio/builder/tools/pioide.py @@ -16,7 +16,7 @@ from __future__ import absolute_import from glob import glob from os import environ -from os.path import join +from os.path import abspath, join from SCons.Defaults import processDefines @@ -57,7 +57,7 @@ def _dump_includes(env): result = [] for item in includes: if item not in result: - result.append(item) + result.append(abspath(item)) return result From 50b2bc07dcb1f757e3a6f18cab35d3edaafcdeb2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 22 Mar 2018 12:10:16 +0200 Subject: [PATCH 023/106] Add PlatformIO IDE as recommended extension for VSCode's workspace --- platformio/ide/tpls/vscode/.vscode/extensions.json.tpl | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 platformio/ide/tpls/vscode/.vscode/extensions.json.tpl diff --git a/platformio/ide/tpls/vscode/.vscode/extensions.json.tpl b/platformio/ide/tpls/vscode/.vscode/extensions.json.tpl new file mode 100644 index 00000000..8281e64c --- /dev/null +++ b/platformio/ide/tpls/vscode/.vscode/extensions.json.tpl @@ -0,0 +1,7 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "platformio.platformio-ide" + ] +} \ No newline at end of file From e019341e597aa36f307304a52393d8e4acd9c1cc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 22 Mar 2018 12:11:46 +0200 Subject: [PATCH 024/106] Bump version to 3.5.3a5 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 5d5fe5d1..8749ff4e 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3a4") +VERSION = (3, 5, "3a5") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From f937eabc1a8d401d65f8b29c3f1c7a5dc3598193 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 22 Mar 2018 16:14:11 +0200 Subject: [PATCH 025/106] Handle error connections to the latest news for PIO Home // Resolve #1470 Resolve #1474 Resolve #1478 Resolve #1480 --- platformio/managers/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/managers/core.py b/platformio/managers/core.py index 63bd456e..109bde4a 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -21,7 +21,7 @@ from platformio import __version__, exception, util from platformio.managers.package import PackageManager CORE_PACKAGES = { - "contrib-piohome": ">=0.9.0,<2", + "contrib-piohome": ">=0.9.1,<2", "contrib-pysite": ">=0.2.0,<2", "tool-pioplus": ">=1.1.1,<2", "tool-unity": "~1.20302.1", From ca34da51aa807203ebab6672cf8ea2ddcaaabec2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 22 Mar 2018 17:37:51 +0200 Subject: [PATCH 026/106] PIO Home: sort folders by name (ignore case), catch ServerError exceptions // Resolve #1454 Resolve #1302 --- platformio/managers/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/managers/core.py b/platformio/managers/core.py index 109bde4a..f4c1a085 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -23,7 +23,7 @@ from platformio.managers.package import PackageManager CORE_PACKAGES = { "contrib-piohome": ">=0.9.1,<2", "contrib-pysite": ">=0.2.0,<2", - "tool-pioplus": ">=1.1.1,<2", + "tool-pioplus": ">=1.1.2,<2", "tool-unity": "~1.20302.1", "tool-scons": "~2.20501.4" } From 0f4ab5b50b6d20ac8e41f42896fe11aa08212df3 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 22 Mar 2018 18:18:03 +0200 Subject: [PATCH 027/106] Update Unity tool to 2.4.3 --- HISTORY.rst | 1 + platformio/managers/core.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 63c5ab84..e912dd8d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -17,6 +17,7 @@ PlatformIO 3.0 `description `_ option for `Project Configuration File "platformio.ini" `__ (information will be used by `PlatformIO Home `_) +* Updated Unity tool to 2.4.3 * Fixed issue with useless project rebuilding for case insensitive file systems (Windows) * Fixed issue with ``build_unflags`` option when a macro contains value diff --git a/platformio/managers/core.py b/platformio/managers/core.py index f4c1a085..ff54904e 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -24,7 +24,7 @@ CORE_PACKAGES = { "contrib-piohome": ">=0.9.1,<2", "contrib-pysite": ">=0.2.0,<2", "tool-pioplus": ">=1.1.2,<2", - "tool-unity": "~1.20302.1", + "tool-unity": "~1.20403.0", "tool-scons": "~2.20501.4" } From d54327f1a944fa50b3a899adeaf857d2bc389abc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 23 Mar 2018 00:08:07 +0200 Subject: [PATCH 028/106] Refactor @memoized decorator with expiration feature; cache installed boards per platform --- platformio/builder/tools/piomisc.py | 2 +- platformio/builder/tools/pioplatform.py | 2 +- platformio/ide/projectgenerator.py | 3 +- platformio/managers/core.py | 2 +- platformio/managers/lib.py | 4 +- platformio/managers/platform.py | 5 ++- platformio/util.py | 52 ++++++++----------------- 7 files changed, 25 insertions(+), 45 deletions(-) diff --git a/platformio/builder/tools/piomisc.py b/platformio/builder/tools/piomisc.py index 69e859f3..bff38d6e 100644 --- a/platformio/builder/tools/piomisc.py +++ b/platformio/builder/tools/piomisc.py @@ -199,7 +199,7 @@ def _delete_file(path): pass -@util.memoized +@util.memoized() def _get_compiler_type(env): try: sysenv = environ.copy() diff --git a/platformio/builder/tools/pioplatform.py b/platformio/builder/tools/pioplatform.py index 6a77bc74..bc5f4663 100644 --- a/platformio/builder/tools/pioplatform.py +++ b/platformio/builder/tools/pioplatform.py @@ -23,7 +23,7 @@ from platformio import exception, util from platformio.managers.platform import PlatformFactory -@util.memoized +@util.memoized() def initPioPlatform(name): return PlatformFactory.newPlatform(name) diff --git a/platformio/ide/projectgenerator.py b/platformio/ide/projectgenerator.py index cde75693..f1dcd35e 100644 --- a/platformio/ide/projectgenerator.py +++ b/platformio/ide/projectgenerator.py @@ -40,7 +40,7 @@ class ProjectGenerator(object): return sorted( [d for d in os.listdir(tpls_dir) if isdir(join(tpls_dir, d))]) - @util.memoized + @util.memoized() def get_project_env(self): data = {} config = util.load_project_config(self.project_dir) @@ -54,7 +54,6 @@ class ProjectGenerator(object): data[k] = v return data - @util.memoized def get_project_build_data(self): data = { "defines": [], diff --git a/platformio/managers/core.py b/platformio/managers/core.py index ff54904e..76a20008 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -23,7 +23,7 @@ from platformio.managers.package import PackageManager CORE_PACKAGES = { "contrib-piohome": ">=0.9.1,<2", "contrib-pysite": ">=0.2.0,<2", - "tool-pioplus": ">=1.1.2,<2", + "tool-pioplus": ">=1.1.3,<2", "tool-unity": "~1.20403.0", "tool-scons": "~2.20501.4" } diff --git a/platformio/managers/lib.py b/platformio/managers/lib.py index 9fa3d02a..bc5677a7 100644 --- a/platformio/managers/lib.py +++ b/platformio/managers/lib.py @@ -398,7 +398,7 @@ class LibraryManager(BasePkgManager): return pkg_dir -@util.memoized +@util.memoized() def get_builtin_libs(storage_names=None): items = [] storage_names = storage_names or [] @@ -417,7 +417,7 @@ def get_builtin_libs(storage_names=None): return items -@util.memoized +@util.memoized() def is_builtin_lib(name): for storage in get_builtin_libs(): if any(l.get("name") == name for l in storage['items']): diff --git a/platformio/managers/platform.py b/platformio/managers/platform.py index bffcf16c..b77c0080 100644 --- a/platformio/managers/platform.py +++ b/platformio/managers/platform.py @@ -30,7 +30,7 @@ from platformio.managers.package import BasePkgManager, PackageManager class PlatformManager(BasePkgManager): - FILE_CACHE_VALID = None # disable platform caching + FILE_CACHE_VALID = None # disable platform download caching def __init__(self, package_dir=None, repositories=None): if not repositories: @@ -158,6 +158,7 @@ class PlatformManager(BasePkgManager): self.cache_reset() return True + @util.memoized(expire=5000) def get_installed_boards(self): boards = [] for manifest in self.get_installed(): @@ -169,7 +170,7 @@ class PlatformManager(BasePkgManager): return boards @staticmethod - @util.memoized + @util.memoized() def get_registered_boards(): return util.get_api_result("/boards", cache_valid="7d") diff --git a/platformio/util.py b/platformio/util.py index 8e1c3b7d..10bfed7c 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import collections -import functools import json import os import platform @@ -113,40 +111,22 @@ class cd(object): class memoized(object): - ''' - Decorator. Caches a function's return value each time it is called. - If called later with the same arguments, the cached value is returned - (not reevaluated). - https://wiki.python.org/moin/PythonDecoratorLibrary#Memoize - ''' - def __init__(self, func): - self.func = func + def __init__(self, expire=0): + self.expire = expire / 1000 # milliseconds self.cache = {} - def __call__(self, *args): - if not isinstance(args, collections.Hashable): - # uncacheable. a list, for instance. - # better to not cache than blow up. - return self.func(*args) - if args in self.cache: - return self.cache[args] - value = self.func(*args) - self.cache[args] = value - return value + def __call__(self, func): - def __repr__(self): - '''Return the function's docstring.''' - return self.func.__doc__ + @wraps(func) + def wrapper(*args, **kwargs): + key = str(args) + str(kwargs) + if (key not in self.cache + or self.cache[key][0] < time.time() - self.expire): + self.cache[key] = (time.time(), func(*args, **kwargs)) + return self.cache[key][1] - def __get__(self, obj, objtype): - '''Support instance methods.''' - fn = functools.partial(self.__call__, obj) - fn.reset = self._reset - return fn - - def _reset(self): - self.cache = {} + return wrapper class throttle(object): @@ -155,15 +135,15 @@ class throttle(object): self.threshhold = threshhold # milliseconds self.last = 0 - def __call__(self, fn): + def __call__(self, func): - @wraps(fn) + @wraps(func) def wrapper(*args, **kwargs): diff = int(round((time.time() - self.last) * 1000)) if diff < self.threshhold: time.sleep((self.threshhold - diff) * 0.001) self.last = time.time() - return fn(*args, **kwargs) + return func(*args, **kwargs) return wrapper @@ -568,7 +548,7 @@ def get_request_defheaders(): return {"User-Agent": "PlatformIO/%s CI/%d %s" % data} -@memoized +@memoized(expire=10000) def _api_request_session(): return requests.Session() @@ -671,7 +651,7 @@ PING_INTERNET_IPS = [ ] -@memoized +@memoized(expire=5000) def _internet_on(): timeout = 2 socket.setdefaulttimeout(timeout) From b6d2e1b243a7cc2d72432ea5be50194b947ca83b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 23 Mar 2018 00:09:05 +0200 Subject: [PATCH 029/106] Bump version to 3.5.3a6 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 8749ff4e..424d885e 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3a5") +VERSION = (3, 5, "3a6") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 44fc500c93e865f2a09fc27fd92a773ae9fbb413 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 23 Mar 2018 12:13:59 +0200 Subject: [PATCH 030/106] Fix issue with incorrect API result --- platformio/managers/core.py | 2 +- platformio/util.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platformio/managers/core.py b/platformio/managers/core.py index 76a20008..4ecd728c 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -23,7 +23,7 @@ from platformio.managers.package import PackageManager CORE_PACKAGES = { "contrib-piohome": ">=0.9.1,<2", "contrib-pysite": ">=0.2.0,<2", - "tool-pioplus": ">=1.1.3,<2", + "tool-pioplus": ">=1.1.6,<2", "tool-unity": "~1.20403.0", "tool-scons": "~2.20501.4" } diff --git a/platformio/util.py b/platformio/util.py index 10bfed7c..dcc09cd3 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -587,9 +587,9 @@ def _get_api_result( headers=headers, auth=auth, verify=verify_ssl) + result = r.json() r.raise_for_status() - r.json() - result = r.text + return r.text except requests.exceptions.HTTPError as e: if result and "message" in result: raise exception.APIRequestError(result['message']) @@ -603,7 +603,7 @@ def _get_api_result( finally: if r: r.close() - return result + return None def get_api_result(url, params=None, data=None, auth=None, cache_valid=None): From c1c2be0b5822d38ba733eb3009da4d6b6c37c4a2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 23 Mar 2018 12:14:40 +0200 Subject: [PATCH 031/106] Bump version to 3.5.3a7 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 424d885e..69c4d757 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3a6") +VERSION = (3, 5, "3a7") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 5214b32ee3e2a84a98d41e2dcab06e28b744e3c5 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 23 Mar 2018 13:50:33 +0200 Subject: [PATCH 032/106] Print request URL when package fails --- tests/test_pkgmanifest.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_pkgmanifest.py b/tests/test_pkgmanifest.py index b7a73061..92da706f 100644 --- a/tests/test_pkgmanifest.py +++ b/tests/test_pkgmanifest.py @@ -16,11 +16,11 @@ import pytest import requests -def validate_response(req): - assert req.status_code == 200 - assert int(req.headers['Content-Length']) > 0 - assert req.headers['Content-Type'] in ("application/gzip", - "application/octet-stream") +def validate_response(r): + assert r.status_code == 200, r.url + assert int(r.headers['Content-Length']) > 0, r.url + assert r.headers['Content-Type'] in ("application/gzip", + "application/octet-stream") def test_packages(): From 275648a88262e642c5d1ce7a0cf1e435e3e3f547 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 23 Mar 2018 13:54:33 +0200 Subject: [PATCH 033/106] Check for non-ASCII chars mDNS service // Issue #1381 --- platformio/util.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platformio/util.py b/platformio/util.py index dcc09cd3..09f5e52e 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -528,6 +528,13 @@ def get_mdns_services(): with mDNSListener() as mdns: time.sleep(3) for service in mdns.get_services(): + properties = None + try: + assert str(service.properties) + properties = service.properties + except (AssertionError, UnicodeError): + pass + items.append({ "type": service.type, @@ -538,7 +545,7 @@ def get_mdns_services(): "port": service.port, "properties": - service.properties + properties }) return items From ec9a2b02eac01a41098b6de4cc01d1de17b26c59 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 23 Mar 2018 17:51:45 +0200 Subject: [PATCH 034/106] Verify mDNS devices before dumping // Issue #1381 --- platformio/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platformio/util.py b/platformio/util.py index 09f5e52e..c0adb874 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -530,9 +530,10 @@ def get_mdns_services(): for service in mdns.get_services(): properties = None try: - assert str(service.properties) + if service.properties: + json.dumps(service.properties) properties = service.properties - except (AssertionError, UnicodeError): + except UnicodeDecodeError: pass items.append({ From 622e4033c1b17a55ce7dc3cf0758571cfe96f0ae Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 24 Mar 2018 12:45:00 +0200 Subject: [PATCH 035/106] Dump g++ macros for IDE --- platformio/builder/tools/pioide.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platformio/builder/tools/pioide.py b/platformio/builder/tools/pioide.py index 833d9b84..4093712e 100644 --- a/platformio/builder/tools/pioide.py +++ b/platformio/builder/tools/pioide.py @@ -68,7 +68,9 @@ def _get_gcc_defines(env): sysenv = environ.copy() sysenv['PATH'] = str(env['ENV']['PATH']) result = util.exec_command( - "echo | %s -dM -E -" % env.subst("$CC"), env=sysenv, shell=True) + "echo | %s -dM -E -x c++ -" % env.subst("$CC"), + env=sysenv, + shell=True) except OSError: return items if result['returncode'] != 0: From 2299383b0369cf3284925d8a5ed55c2fb902eacf Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 24 Mar 2018 15:31:08 +0200 Subject: [PATCH 036/106] Docs: Update example "J-Link as debugger and uploader" --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 7ad89924..ee162b18 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 7ad89924f6c2eb318a9eb0417e87e8a0e33e60d5 +Subproject commit ee162b1853d17ed19c7df1b7b78f60fb934ffd79 From d1362c3751fc7da64709a92e191e68017cf53f54 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 27 Mar 2018 22:29:26 +0300 Subject: [PATCH 037/106] Article: Building a Web Of Things REST-API on an Arduino MKR1000 with PlatformIO --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index ee162b18..bd0d201b 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit ee162b1853d17ed19c7df1b7b78f60fb934ffd79 +Subproject commit bd0d201b8477f41fccb36d2e730628c3c785df59 From 1410dd093ab4be49ba1d455a8fc007a813d85312 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 1 Apr 2018 10:28:25 -0700 Subject: [PATCH 038/106] Revert back g++ macro from dump list // Issue #1546 --- platformio/builder/tools/pioide.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/platformio/builder/tools/pioide.py b/platformio/builder/tools/pioide.py index 4093712e..833d9b84 100644 --- a/platformio/builder/tools/pioide.py +++ b/platformio/builder/tools/pioide.py @@ -68,9 +68,7 @@ def _get_gcc_defines(env): sysenv = environ.copy() sysenv['PATH'] = str(env['ENV']['PATH']) result = util.exec_command( - "echo | %s -dM -E -x c++ -" % env.subst("$CC"), - env=sysenv, - shell=True) + "echo | %s -dM -E -" % env.subst("$CC"), env=sysenv, shell=True) except OSError: return items if result['returncode'] != 0: From 0710c094e7d8679d393c234bad2a6a8e9b377076 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 1 Apr 2018 10:31:47 -0700 Subject: [PATCH 039/106] Bump version to 3.5.3a8 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 69c4d757..4951d907 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3a7") +VERSION = (3, 5, "3a8") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From e7b5a14e112a0adad85cd1a7d2f31a0d8c0ae8a3 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 5 Apr 2018 11:06:23 -0700 Subject: [PATCH 040/106] Temporary workaround for VSCode's "IOError: PackageManager" issue --- platformio/downloader.py | 10 +++++++--- platformio/managers/package.py | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/platformio/downloader.py b/platformio/downloader.py index df9f65a2..2a59c002 100644 --- a/platformio/downloader.py +++ b/platformio/downloader.py @@ -21,7 +21,7 @@ from time import mktime import click import requests -from platformio import app, util +from platformio import util from platformio.exception import (FDSHASumMismatch, FDSizeMismatch, FDUnrecognizedStatusCode) @@ -70,12 +70,12 @@ class FileDownloader(object): return -1 return int(self._request.headers['content-length']) - def start(self): + def start(self, with_progress=True): label = "Downloading" itercontent = self._request.iter_content(chunk_size=self.CHUNK_SIZE) f = open(self._destination, "wb") try: - if app.is_disabled_progressbar() or self.get_size() == -1: + if not with_progress or self.get_size() == -1: click.echo("%s..." % label) for chunk in itercontent: if chunk: @@ -86,6 +86,8 @@ class FileDownloader(object): for _ in pb: f.write(next(itercontent)) except IOError as e: + if with_progress: + return self.start(with_progress=False) click.secho( "Error: Please read http://bit.ly/package-manager-ioerror", fg="red", @@ -98,6 +100,8 @@ class FileDownloader(object): if self.get_lmtime(): self._preserve_filemtime(self.get_lmtime()) + return True + def verify(self, sha1=None): _dlsize = getsize(self._destination) if self.get_size() != -1 and _dlsize != self.get_size(): diff --git a/platformio/managers/package.py b/platformio/managers/package.py index d3942905..83a5ba39 100644 --- a/platformio/managers/package.py +++ b/platformio/managers/package.py @@ -178,7 +178,7 @@ class PkgInstallerMixin(object): return dst_path fd = FileDownloader(url, dest_dir) - fd.start() + fd.start(with_progress=not app.is_disabled_progressbar()) if sha1: fd.verify(sha1) dst_path = fd.get_filepath() From e0fc44aa42c66f68a553d710528be54e974e5464 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 5 Apr 2018 13:08:23 -0700 Subject: [PATCH 041/106] Reinit download session when IOError --- platformio/downloader.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/platformio/downloader.py b/platformio/downloader.py index 2a59c002..a712c4c6 100644 --- a/platformio/downloader.py +++ b/platformio/downloader.py @@ -31,15 +31,8 @@ class FileDownloader(object): CHUNK_SIZE = 1024 def __init__(self, url, dest_dir=None): - self._request = None - # make connection - self._request = requests.get( - url, - stream=True, - headers=util.get_request_defheaders(), - verify=version_info >= (2, 7, 9)) - if self._request.status_code != 200: - raise FDUnrecognizedStatusCode(self._request.status_code, url) + self.url = url + self._request = self.init_request() disposition = self._request.headers.get("content-disposition") if disposition and "filename=" in disposition: @@ -50,12 +43,21 @@ class FileDownloader(object): else: self._fname = [p for p in url.split("/") if p][-1] - self._progressbar = None self._destination = self._fname if dest_dir: self.set_destination( join(dest_dir.decode(getfilesystemencoding()), self._fname)) + def init_request(self): + r = requests.get( + self.url, + stream=True, + headers=util.get_request_defheaders(), + verify=version_info >= (2, 7, 9)) + if r.status_code != 200: + raise FDUnrecognizedStatusCode(r.status_code, self.url) + return r + def set_destination(self, destination): self._destination = destination @@ -87,6 +89,8 @@ class FileDownloader(object): f.write(next(itercontent)) except IOError as e: if with_progress: + # reinitialize request + self._request = self.init_request() return self.start(with_progress=False) click.secho( "Error: Please read http://bit.ly/package-manager-ioerror", From 59fe190f205f4175d45457d039b31b6ce5fa2011 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 5 Apr 2018 22:10:28 -0700 Subject: [PATCH 042/106] Better handling of VSCode Terminal IOError --- platformio/downloader.py | 31 +++++++++---------------------- platformio/managers/package.py | 32 ++++++++++++++++++++++++++++---- platformio/unpacker.py | 6 +++--- 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/platformio/downloader.py b/platformio/downloader.py index a712c4c6..34f597b2 100644 --- a/platformio/downloader.py +++ b/platformio/downloader.py @@ -31,8 +31,15 @@ class FileDownloader(object): CHUNK_SIZE = 1024 def __init__(self, url, dest_dir=None): - self.url = url - self._request = self.init_request() + self._request = None + # make connection + self._request = requests.get( + url, + stream=True, + headers=util.get_request_defheaders(), + verify=version_info >= (2, 7, 9)) + if self._request.status_code != 200: + raise FDUnrecognizedStatusCode(self._request.status_code, url) disposition = self._request.headers.get("content-disposition") if disposition and "filename=" in disposition: @@ -48,16 +55,6 @@ class FileDownloader(object): self.set_destination( join(dest_dir.decode(getfilesystemencoding()), self._fname)) - def init_request(self): - r = requests.get( - self.url, - stream=True, - headers=util.get_request_defheaders(), - verify=version_info >= (2, 7, 9)) - if r.status_code != 200: - raise FDUnrecognizedStatusCode(r.status_code, self.url) - return r - def set_destination(self, destination): self._destination = destination @@ -87,16 +84,6 @@ class FileDownloader(object): with click.progressbar(length=chunks, label=label) as pb: for _ in pb: f.write(next(itercontent)) - except IOError as e: - if with_progress: - # reinitialize request - self._request = self.init_request() - return self.start(with_progress=False) - click.secho( - "Error: Please read http://bit.ly/package-manager-ioerror", - fg="red", - err=True) - raise e finally: f.close() self._request.close() diff --git a/platformio/managers/package.py b/platformio/managers/package.py index 83a5ba39..795f0761 100644 --- a/platformio/managers/package.py +++ b/platformio/managers/package.py @@ -177,8 +177,25 @@ class PkgInstallerMixin(object): shutil.copy(cache_path, dst_path) return dst_path - fd = FileDownloader(url, dest_dir) - fd.start(with_progress=not app.is_disabled_progressbar()) + with_progress = not app.is_disabled_progressbar() + try: + fd = FileDownloader(url, dest_dir) + fd.start(with_progress=with_progress) + except IOError as e: + raise_error = not with_progress + if with_progress: + try: + fd = FileDownloader(url, dest_dir) + fd.start(with_progress=False) + except IOError: + raise_error = True + if raise_error: + click.secho( + "Error: Please read http://bit.ly/package-manager-ioerror", + fg="red", + err=True) + raise e + if sha1: fd.verify(sha1) dst_path = fd.get_filepath() @@ -194,8 +211,15 @@ class PkgInstallerMixin(object): @staticmethod def unpack(source_path, dest_dir): - with FileUnpacker(source_path) as fu: - return fu.unpack(dest_dir) + with_progress = not app.is_disabled_progressbar() + try: + with FileUnpacker(source_path) as fu: + return fu.unpack(dest_dir, with_progress=with_progress) + except IOError as e: + if not with_progress: + raise e + with FileUnpacker(source_path) as fu: + return fu.unpack(dest_dir, with_progress=False) @staticmethod def parse_semver_spec(value, raise_exception=False): diff --git a/platformio/unpacker.py b/platformio/unpacker.py index 4e789d1c..38165c40 100644 --- a/platformio/unpacker.py +++ b/platformio/unpacker.py @@ -20,7 +20,7 @@ from zipfile import ZipFile import click -from platformio import app, util +from platformio import util from platformio.exception import UnsupportedArchiveType @@ -96,9 +96,9 @@ class FileUnpacker(object): if self._unpacker: self._unpacker.close() - def unpack(self, dest_dir="."): + def unpack(self, dest_dir=".", with_progress=True): assert self._unpacker - if app.is_disabled_progressbar(): + if not with_progress: click.echo("Unpacking...") for item in self._unpacker.get_items(): self._unpacker.extract_item(item, dest_dir) From aa8de4ff4b492e8eb8b71c24738e974ed34cab2f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 12 Apr 2018 18:44:38 -0700 Subject: [PATCH 043/106] Export "docs" from platform manifest --- platformio/commands/platform.py | 1 + platformio/managers/platform.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/platformio/commands/platform.py b/platformio/commands/platform.py index f6307be5..8ec1c259 100644 --- a/platformio/commands/platform.py +++ b/platformio/commands/platform.py @@ -85,6 +85,7 @@ def _get_installed_platform_data(platform, homepage=p.homepage, repository=p.repository_url, url=p.vendor_url, + docs=p.docs_url, license=p.license, forDesktop=not p.is_embedded(), frameworks=sorted(p.frameworks.keys() if p.frameworks else []), diff --git a/platformio/managers/platform.py b/platformio/managers/platform.py index b77c0080..7148122d 100644 --- a/platformio/managers/platform.py +++ b/platformio/managers/platform.py @@ -493,6 +493,10 @@ class PlatformBase( # pylint: disable=too-many-public-methods def vendor_url(self): return self._manifest.get("url") + @property + def docs_url(self): + return self._manifest.get("docs") + @property def repository_url(self): return self._manifest.get("repository", {}).get("url") From 2c0ca3e43772e88de13db779731efa49a438ab48 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 12 Apr 2018 18:46:11 -0700 Subject: [PATCH 044/106] Update PIO Home and PIO Core+ --- platformio/managers/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio/managers/core.py b/platformio/managers/core.py index 4ecd728c..a8f4e606 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -21,9 +21,9 @@ from platformio import __version__, exception, util from platformio.managers.package import PackageManager CORE_PACKAGES = { - "contrib-piohome": ">=0.9.1,<2", + "contrib-piohome": ">=0.9.4,<2", "contrib-pysite": ">=0.2.0,<2", - "tool-pioplus": ">=1.1.6,<2", + "tool-pioplus": ">=1.1.7,<2", "tool-unity": "~1.20403.0", "tool-scons": "~2.20501.4" } From 02efe4f7f3863b0b440c4b36a2cb118747d46aaf Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 12 Apr 2018 18:47:12 -0700 Subject: [PATCH 045/106] Bump version to 3.5.3a9 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 4951d907..f454e091 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3a8") +VERSION = (3, 5, "3a9") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From d0cc3a045e812a261c6c154fe16616cb9704a2d3 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 15 Apr 2018 05:48:38 +0300 Subject: [PATCH 046/106] Handle unknown packages when do cleaning // Resolve #1282 --- platformio/managers/platform.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platformio/managers/platform.py b/platformio/managers/platform.py index 7148122d..7bb450af 100644 --- a/platformio/managers/platform.py +++ b/platformio/managers/platform.py @@ -153,7 +153,10 @@ class PlatformManager(BasePkgManager): continue if (manifest['name'] not in deppkgs or manifest['version'] not in deppkgs[manifest['name']]): - pm.uninstall(manifest['__pkg_dir'], after_update=True) + try: + pm.uninstall(manifest['__pkg_dir'], after_update=True) + except exception.UnknownPackage: + pass self.cache_reset() return True From aa28beddd881474452b563cf0faf18a5676cb3b4 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 15 Apr 2018 06:08:29 +0300 Subject: [PATCH 047/106] Handle broken JSON files --- platformio/builder/tools/piolib.py | 4 ++-- platformio/exception.py | 5 +++++ platformio/util.py | 3 +-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/platformio/builder/tools/piolib.py b/platformio/builder/tools/piolib.py index b865771b..2d77d167 100644 --- a/platformio/builder/tools/piolib.py +++ b/platformio/builder/tools/piolib.py @@ -27,7 +27,7 @@ from os.path import (basename, commonprefix, dirname, isdir, isfile, join, import SCons.Scanner from SCons.Script import ARGUMENTS, COMMAND_LINE_TARGETS, DefaultEnvironment -from platformio import util +from platformio import exception, util from platformio.builder.tools import platformio as piotool from platformio.managers.lib import LibraryManager from platformio.managers.package import PackageManager @@ -777,7 +777,7 @@ def GetLibBuilders(env): # pylint: disable=too-many-branches try: lb = LibBuilderFactory.new( env, join(libs_dir, item), verbose=verbose) - except ValueError: + except exception.InvalidJSONFile: if verbose: sys.stderr.write("Skip library with broken manifest: %s\n" % join(libs_dir, item)) diff --git a/platformio/exception.py b/platformio/exception.py index afedf5a9..8b3df0f2 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -207,6 +207,11 @@ class InvalidSettingValue(PlatformioException): MESSAGE = "Invalid value '{0}' for the setting '{1}'" +class InvalidJSONFile(PlatformioException): + + MESSAGE = "Could not load broken JSON: {0}" + + class CIBuildEnvsEmpty(PlatformioException): MESSAGE = ("Can't find PlatformIO build environments.\n" diff --git a/platformio/util.py b/platformio/util.py index c0adb874..49ff8547 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -169,8 +169,7 @@ def load_json(file_path): with open(file_path, "r") as f: return json.load(f) except ValueError: - raise exception.PlatformioException( - "Could not load broken JSON: %s" % file_path) + raise exception.InvalidJSONFile(file_path) def get_systype(): From 6a04f52620b87a68393d5b7b10777f034bc057da Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 15 Apr 2018 06:28:02 +0300 Subject: [PATCH 048/106] Add info about "library.json" to README instruction --- platformio/commands/init.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platformio/commands/init.py b/platformio/commands/init.py index dadf3e77..f343052d 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -168,16 +168,21 @@ The source code of each library should be placed in separate directory, like For example, see how can be organized `Foo` and `Bar` libraries: |--lib +| | | |--Bar | | |--docs | | |--examples | | |--src | | |- Bar.c | | |- Bar.h +| | |- library.json (optional, custom build options, etc) http://docs.platformio.org/page/librarymanager/config.html +| | | |--Foo | | |- Foo.c | | |- Foo.h +| | | |- readme.txt --> THIS FILE +| |- platformio.ini |--src |- main.c From b77160d36342e438708050a0fbff52a13b9b4a2c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 20 Apr 2018 13:56:04 +0300 Subject: [PATCH 049/106] Upgrade VSCode CPP manifest to v3 --- platformio/builder/tools/pioide.py | 6 ++--- .../vscode/.vscode/c_cpp_properties.json.tpl | 27 ++++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/platformio/builder/tools/pioide.py b/platformio/builder/tools/pioide.py index 833d9b84..b8e5c346 100644 --- a/platformio/builder/tools/pioide.py +++ b/platformio/builder/tools/pioide.py @@ -53,7 +53,7 @@ def _dump_includes(env): if unity_dir: includes.append(unity_dir) - # remove dupicates + # remove duplicates result = [] for item in includes: if item not in result: @@ -101,8 +101,8 @@ def _dump_defines(env): .replace("ATMEGA", "ATmega").replace("ATTINY", "ATtiny"))) # built-in GCC marcos - if env.GetCompilerType() == "gcc": - defines.extend(_get_gcc_defines(env)) + # if env.GetCompilerType() == "gcc": + # defines.extend(_get_gcc_defines(env)) return defines diff --git a/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl b/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl index d428393d..d6a207bf 100644 --- a/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl +++ b/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl @@ -1,8 +1,19 @@ { + "!!! WARNING !!!": "PLEASE DO NOT MODIFY THIS FILE! USE http://docs.platformio.org/page/projectconf/section_env_build.html#build-flags", "configurations": [ { % import platform +% from os.path import commonprefix, dirname +% % systype = platform.system().lower() +% +% cleaned_includes = [] +% for include in includes: +% if "toolchain-" not in dirname(commonprefix([include, cc_path])): +% cleaned_includes.append(include) +% end +% end +% % if systype == "windows": "name": "Win32", % elif systype == "darwin": @@ -11,7 +22,7 @@ "name": "Linux", % end "includePath": [ -% for include in includes: +% for include in cleaned_includes: "{{include.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"')}}", % end "" @@ -20,7 +31,7 @@ "limitSymbolsToIncludedHeaders": true, "databaseFilename": "${workspaceRoot}/.vscode/.browse.c_cpp.db", "path": [ -% for include in includes: +% for include in cleaned_includes: "{{include.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"')}}", % end "" @@ -32,7 +43,17 @@ % end "" ], - "intelliSenseMode": "clang-x64" + "intelliSenseMode": "clang-x64", +% import re +% STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)") +% +% if STD_RE.search(cc_flags): + "cStandard": "c{{ STD_RE.search(cc_flags).group(1) }}", +% end +% if STD_RE.search(cxx_flags): + "cppStandard": "c++{{ STD_RE.search(cxx_flags).group(1) }}", +% end + "compilerPath": "{{ cc_path }}" } ] } \ No newline at end of file From 3ce62fbafef10f5e999134a73673a9573a272a17 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 20 Apr 2018 14:00:40 +0300 Subject: [PATCH 050/106] Escape compiler path for Win --- platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl b/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl index d6a207bf..e5868d7c 100644 --- a/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl +++ b/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl @@ -53,7 +53,7 @@ % if STD_RE.search(cxx_flags): "cppStandard": "c++{{ STD_RE.search(cxx_flags).group(1) }}", % end - "compilerPath": "{{ cc_path }}" + "compilerPath": "{{ cc_path.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"') }}" } ] } \ No newline at end of file From ccb63a9ecc3149c8a5442ff8031bba71c1d807ba Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 20 Apr 2018 15:55:29 +0300 Subject: [PATCH 051/106] Bump version to 3.5.3b1 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index f454e091..dd8d9f38 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3a9") +VERSION = (3, 5, "3b1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 6b6860196a87beb464b1fad0c94bacfd164700c5 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 20 Apr 2018 19:10:20 +0300 Subject: [PATCH 052/106] Fix issue with "build_unparse" for string items --- platformio/builder/tools/platformio.py | 2 -- tests/test_builder.py | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 9198c751..bb2dd1c6 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -176,8 +176,6 @@ def ProcessUnFlags(env, flags): return for key, unflags in env.ParseFlagsExtended(flags).items(): for unflag in unflags: - if not isinstance(unflag, (list, tuple)): - unflag = tuple([unflag]) for current in env.get(key, []): conditions = [ unflag == current, diff --git a/tests/test_builder.py b/tests/test_builder.py index 6dd90eb7..cafd1cee 100644 --- a/tests/test_builder.py +++ b/tests/test_builder.py @@ -63,7 +63,7 @@ def test_build_unflags(clirunner, validate_cliresult, tmpdir): tmpdir.join("platformio.ini").write(""" [env:native] platform = native -build_unflags = -DTMP_MACRO1=45 -I. -DNON_EXISTING_MACRO +build_unflags = -DTMP_MACRO1=45 -I. -DNON_EXISTING_MACRO -lunknownLib -Os extra_scripts = pre:extra.py """) @@ -73,6 +73,8 @@ env.Append(CPPPATH="%s") env.Append(CPPDEFINES="TMP_MACRO1") env.Append(CPPDEFINES=["TMP_MACRO2"]) env.Append(CPPDEFINES=("TMP_MACRO3", 13)) +env.Append(CCFLAGS=["-Os"]) +env.Append(LIBS=["unknownLib"]) """ % str(tmpdir)) tmpdir.mkdir("src").join("main.c").write(""" @@ -90,4 +92,5 @@ int main() { build_output = result.output[result.output.find( "Scanning dependencies..."):] assert "-DTMP_MACRO1" not in build_output + assert "-Os" not in build_output assert str(tmpdir) not in build_output From 2d1daa756dd38d2ac581925bf1231a4b30eb424b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 20 Apr 2018 21:02:52 +0300 Subject: [PATCH 053/106] Docs: Custom lwIP Variant and debug levels for ESP8266 --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index bd0d201b..458101ed 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit bd0d201b8477f41fccb36d2e730628c3c785df59 +Subproject commit 458101edb43cf4b4f5f13f9bc95ba1da0754f5a9 From 0a9031e44886745720ad08168e624c329ecbb4e3 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 20 Apr 2018 21:27:52 +0300 Subject: [PATCH 054/106] Switch to shutil.move instead of os.rename // Resolve #1584 --- platformio/managers/package.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platformio/managers/package.py b/platformio/managers/package.py index 795f0761..3996bc06 100644 --- a/platformio/managers/package.py +++ b/platformio/managers/package.py @@ -502,7 +502,7 @@ class PkgInstallerMixin(object): target_dirname = "%s@src-%s" % ( pkg_dirname, hashlib.md5(cur_manifest['__src_url']).hexdigest()) - os.rename(pkg_dir, join(self.package_dir, target_dirname)) + shutil.move(pkg_dir, join(self.package_dir, target_dirname)) # fix to a version elif action == 2: target_dirname = "%s@%s" % (pkg_dirname, @@ -516,7 +516,7 @@ class PkgInstallerMixin(object): # remove previous/not-satisfied package if isdir(pkg_dir): util.rmtree_(pkg_dir) - os.rename(tmp_dir, pkg_dir) + shutil.move(tmp_dir, pkg_dir) assert isdir(pkg_dir) self.cache_reset() return pkg_dir @@ -740,9 +740,9 @@ class BasePkgManager(PkgRepoMixin, PkgInstallerMixin): # unfix package with the same name pkg_dir = self.get_package_dir(manifest['name']) if pkg_dir and "@" in pkg_dir: - os.rename(pkg_dir, - join(self.package_dir, - self.get_install_dirname(manifest))) + shutil.move(pkg_dir, + join(self.package_dir, + self.get_install_dirname(manifest))) self.cache_reset() click.echo("[%s]" % click.style("OK", fg="green")) From f981916f1d1739ffea82c575fd7edc3d0c6fc3dc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 21 Apr 2018 01:00:55 +0300 Subject: [PATCH 055/106] Docs: ESP8266 VTables --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 458101ed..5222412b 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 458101edb43cf4b4f5f13f9bc95ba1da0754f5a9 +Subproject commit 5222412b3f3856078e720658df897547b8fcc285 From 1c68409a08456553977ab13027ad60d763f5ff45 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 23 Apr 2018 17:30:05 +0300 Subject: [PATCH 056/106] Improve support for Black Magic Probe in "uploader" role --- HISTORY.rst | 1 + docs | 2 +- platformio/builder/tools/pioupload.py | 10 ++++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index e912dd8d..4c9d1861 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -18,6 +18,7 @@ PlatformIO 3.0 option for `Project Configuration File "platformio.ini" `__ (information will be used by `PlatformIO Home `_) * Updated Unity tool to 2.4.3 +* Improved support for Black Magic Probe in "uploader" role * Fixed issue with useless project rebuilding for case insensitive file systems (Windows) * Fixed issue with ``build_unflags`` option when a macro contains value diff --git a/docs b/docs index 5222412b..a3f4e765 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 5222412b3f3856078e720658df897547b8fcc285 +Subproject commit a3f4e765e5d146df43b13719782d213cb2658359 diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index 63ba3b03..1ba523e4 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -130,10 +130,12 @@ def AutodetectUploadPort(*args, **kwargs): # pylint: disable=unused-argument if not _is_match_pattern(item['port']): continue port = item['port'] - if upload_protocol.startswith("blackmagic") \ - and "GDB" in item['description']: - return ("\\\\.\\%s" % port if "windows" in util.get_systype() - and port.startswith("COM") and len(port) > 4 else port) + if upload_protocol.startswith("blackmagic"): + if "windows" in util.get_systype() and \ + port.startswith("COM") and len(port) > 4: + port = "\\\\.\\%s" % port + if "GDB" in item['description']: + return port for hwid in board_hwids: hwid_str = ("%s:%s" % (hwid[0], hwid[1])).replace("0x", "") if hwid_str in item['hwid']: From 2ae169d210cc9c384866720dc6e337405efa8d07 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 25 Apr 2018 16:57:43 +0300 Subject: [PATCH 057/106] Fix "RuntimeError: maximum recursion depth exceeded" for library manager // Resolve #1528 --- HISTORY.rst | 2 ++ platformio/managers/package.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 4c9d1861..01be6c6c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -25,6 +25,8 @@ PlatformIO 3.0 (e.g., ``-DNAME=VALUE``) * Fixed issue which did not allow to override runtime build environment using extra POST script +* Fixed "RuntimeError: maximum recursion depth exceeded" for library manager + (`issue #1528 `_) 3.5.2 (2018-03-13) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/managers/package.py b/platformio/managers/package.py index 3996bc06..152a617d 100644 --- a/platformio/managers/package.py +++ b/platformio/managers/package.py @@ -667,7 +667,7 @@ class BasePkgManager(PkgRepoMixin, PkgInstallerMixin): self.INSTALL_HISTORY = [] history_key = "%s-%s-%s" % (name, requirements or "", url or "") if history_key in self.INSTALL_HISTORY: - return package_dir + return None self.INSTALL_HISTORY.append(history_key) if package_dir and force: From 3bcc3e07aec7b9a15c6d095a81faf3f99f92e6b5 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 25 Apr 2018 17:15:40 +0300 Subject: [PATCH 058/106] Respect a custom "lib_dir" option in platformio.ini // Resolve #1473 --- HISTORY.rst | 2 ++ platformio/commands/init.py | 15 ++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 01be6c6c..0497745e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -19,6 +19,8 @@ PlatformIO 3.0 `PlatformIO Home `_) * Updated Unity tool to 2.4.3 * Improved support for Black Magic Probe in "uploader" role +* Respect a custom "lib_dir" option in `Project Configuration File "platformio.ini" `__ + (`issue #1473 `_) * Fixed issue with useless project rebuilding for case insensitive file systems (Windows) * Fixed issue with ``build_unflags`` option when a macro contains value diff --git a/platformio/commands/init.py b/platformio/commands/init.py index f343052d..e7151287 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -139,15 +139,12 @@ def init_base_project(project_dir): join(util.get_source_dir(), "projectconftpl.ini"), join(project_dir, "platformio.ini")) - lib_dir = join(project_dir, "lib") - src_dir = join(project_dir, "src") - config = util.load_project_config(project_dir) - if config.has_option("platformio", "src_dir"): - src_dir = join(project_dir, config.get("platformio", "src_dir")) - - for d in (src_dir, lib_dir): - if not isdir(d): - makedirs(d) + with util.cd(project_dir): + lib_dir = util.get_projectlib_dir() + src_dir = util.get_projectsrc_dir() + for d in (src_dir, lib_dir): + if not isdir(d): + makedirs(d) init_lib_readme(lib_dir) init_ci_conf(project_dir) From 50c568c2321541cddcedd54a03f2c3aca48c9ebc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 26 Apr 2018 01:49:16 +0300 Subject: [PATCH 059/106] Fix "RuntimeError: maximum recursion depth exceeded" for library manager // Resolve #1528 --- platformio/managers/lib.py | 9 +++++++++ platformio/managers/package.py | 2 +- tests/commands/test_lib.py | 14 +++++++------- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/platformio/managers/lib.py b/platformio/managers/lib.py index bc5677a7..5613b668 100644 --- a/platformio/managers/lib.py +++ b/platformio/managers/lib.py @@ -365,6 +365,15 @@ class LibraryManager(BasePkgManager): for filters in self.normalize_dependencies(manifest['dependencies']): assert "name" in filters + + # avoid circle dependencies + if not self.INSTALL_HISTORY: + self.INSTALL_HISTORY = [] + history_key = str(filters) + if history_key in self.INSTALL_HISTORY: + continue + self.INSTALL_HISTORY.append(history_key) + if any(s in filters.get("version", "") for s in ("\\", "/")): self.install( "{name}={version}".format(**filters), diff --git a/platformio/managers/package.py b/platformio/managers/package.py index 152a617d..3996bc06 100644 --- a/platformio/managers/package.py +++ b/platformio/managers/package.py @@ -667,7 +667,7 @@ class BasePkgManager(PkgRepoMixin, PkgInstallerMixin): self.INSTALL_HISTORY = [] history_key = "%s-%s-%s" % (name, requirements or "", url or "") if history_key in self.INSTALL_HISTORY: - return None + return package_dir self.INSTALL_HISTORY.append(history_key) if package_dir and force: diff --git a/tests/commands/test_lib.py b/tests/commands/test_lib.py index 12debd8c..e4db2e7e 100644 --- a/tests/commands/test_lib.py +++ b/tests/commands/test_lib.py @@ -62,7 +62,7 @@ def test_global_install_archive(clirunner, validate_cliresult, "https://github.com/bblanchon/ArduinoJson/archive/v5.8.2.zip", "https://github.com/bblanchon/ArduinoJson/archive/v5.8.2.zip@5.8.2", "http://dl.platformio.org/libraries/archives/0/9540.tar.gz", - "https://github.com/adafruit/Adafruit-ST7735-Library/archive/master.zip" + "https://github.com/Pedroalbuquerque/ESP32WebServer/archive/master.zip" ]) validate_cliresult(result) @@ -76,7 +76,7 @@ def test_global_install_archive(clirunner, validate_cliresult, items1 = [d.basename for d in isolated_pio_home.join("lib").listdir()] items2 = [ "RadioHead-1.62", "ArduinoJson", "DallasTemperature_ID54", - "OneWire_ID1", "Adafruit ST7735 Library" + "OneWire_ID1", "ESP32WebServer" ] assert set(items1) >= set(items2) @@ -142,7 +142,7 @@ def test_global_lib_list(clirunner, validate_cliresult): validate_cliresult(result) assert all([ n in result.output for n in - ("Source: https://github.com/adafruit/Adafruit-ST7735-Library/archive/master.zip", + ("Source: https://github.com/Pedroalbuquerque/ESP32WebServer/archive/master.zip", "Version: 5.10.1", "Source: git+https://github.com/gioblu/PJON.git#3.0", "Version: 1fb26fd", "RadioHead-1.62") @@ -157,7 +157,7 @@ def test_global_lib_list(clirunner, validate_cliresult): ]) items1 = [i['name'] for i in json.loads(result.output)] items2 = [ - "Adafruit ST7735 Library", "ArduinoJson", "ArduinoJson", "ArduinoJson", + "ESP32WebServer", "ArduinoJson", "ArduinoJson", "ArduinoJson", "ArduinoJson", "AsyncMqttClient", "AsyncTCP", "DallasTemperature", "ESPAsyncTCP", "NeoPixelBus", "OneWire", "PJON", "PJON", "PubSubClient", "RFcontrol", "RadioHead-1.62", "platformio-libmirror", @@ -221,9 +221,9 @@ def test_global_lib_uninstall(clirunner, validate_cliresult, validate_cliresult(result) items = json.loads(result.output) result = clirunner.invoke(cmd_lib, - ["-g", "uninstall", items[0]['__pkg_dir']]) + ["-g", "uninstall", items[5]['__pkg_dir']]) validate_cliresult(result) - assert "Uninstalling Adafruit ST7735 Library" in result.output + assert "Uninstalling AsyncTCP" in result.output # uninstall the rest libraries result = clirunner.invoke(cmd_lib, [ @@ -238,7 +238,7 @@ def test_global_lib_uninstall(clirunner, validate_cliresult, "PubSubClient", "ArduinoJson@src-69ebddd821f771debe7ee734d3c7fa81", "ESPAsyncTCP_ID305", "DallasTemperature_ID54", "NeoPixelBus_ID547", "PJON", "AsyncMqttClient_ID346", "ArduinoJson_ID64", - "PJON@src-79de467ebe19de18287becff0a1fb42d", "AsyncTCP_ID1826" + "PJON@src-79de467ebe19de18287becff0a1fb42d", "ESP32WebServer" ] assert set(items1) == set(items2) From 31f14274af7a618ed86448792deed766a30a2024 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 27 Apr 2018 01:41:28 +0300 Subject: [PATCH 060/106] Ignore idedata event --- platformio/telemetry.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/platformio/telemetry.py b/platformio/telemetry.py index c3fd438f..98fd3d69 100644 --- a/platformio/telemetry.py +++ b/platformio/telemetry.py @@ -16,6 +16,7 @@ import atexit import platform import Queue import re +import sys import threading from collections import deque from os import getenv, sep @@ -152,16 +153,21 @@ class MeasurementProtocol(TelemetryBase): cmd_path.append(sub_cmd) self['screen_name'] = " ".join([p.title() for p in cmd_path]) - def send(self, hittype): + def _ignore_hit(self): if not app.get_setting("enable_telemetry"): + return True + if app.get_session_var("caller_id") and \ + all(c in sys.argv for c in ("run", "idedata")): + return True + return False + + def send(self, hittype): + if self._ignore_hit(): return - self['t'] = hittype - # correct queue time if "qt" in self._params and isinstance(self['qt'], float): self['qt'] = int((time() - self['qt']) * 1000) - MPDataPusher().push(self._params) From 7de4d6aeefa99b255f12febae40dc874b3f28c73 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 27 Apr 2018 12:57:11 +0300 Subject: [PATCH 061/106] PyLint fix --- platformio/telemetry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platformio/telemetry.py b/platformio/telemetry.py index 98fd3d69..769d58eb 100644 --- a/platformio/telemetry.py +++ b/platformio/telemetry.py @@ -153,7 +153,8 @@ class MeasurementProtocol(TelemetryBase): cmd_path.append(sub_cmd) self['screen_name'] = " ".join([p.title() for p in cmd_path]) - def _ignore_hit(self): + @staticmethod + def _ignore_hit(): if not app.get_setting("enable_telemetry"): return True if app.get_session_var("caller_id") and \ From f46072f769188ec13a93e5e959642a13111bce08 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 27 Apr 2018 18:01:08 +0300 Subject: [PATCH 062/106] Generate beta configuration for the new PIO Debugger for VSCode --- .../ide/tpls/vscode/.vscode/launch.json.tpl | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/platformio/ide/tpls/vscode/.vscode/launch.json.tpl b/platformio/ide/tpls/vscode/.vscode/launch.json.tpl index 788edc2a..0277c921 100644 --- a/platformio/ide/tpls/vscode/.vscode/launch.json.tpl +++ b/platformio/ide/tpls/vscode/.vscode/launch.json.tpl @@ -1,4 +1,16 @@ +// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY + +// PIO Unified Debugger +// +// http://docs.platformio.org/page/plus/debugging.html +// http://docs.platformio.org/page/section_env_debug.html#projectconf-debug-tool + % from os.path import dirname, join +% +% def _escape_path(path): +% return path.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"') +% end +% { "version": "0.2.0", "configurations": [ @@ -7,11 +19,28 @@ "request": "launch", "cwd": "${workspaceRoot}", "name": "PlatformIO Debugger", - "target": "{{prog_path.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"')}}", - "gdbpath": "{{join(dirname(platformio_path), "piodebuggdb").replace('\\\\', '/').replace('\\', '/').replace('"', '\\"')}}", + "target": "{{ _escape_path(prog_path) }}", + "gdbpath": "{{ _escape_path(join(dirname(platformio_path), "piodebuggdb")) }}", "autorun": [ "source .pioinit" ], "preLaunchTask": "PlatformIO: Pre-Debug", "internalConsoleOptions": "openOnSessionStart" + }, + { + "type": "platformio-debug", + "request": "launch", + "name": "PlatformIO Debugger (Beta)", + "executable": "{{ _escape_path(prog_path) }}", + "toolchainBinDir": "{{ _escape_path(dirname(gdb_path)) }}", + "preLaunchTask": "PlatformIO: Pre-Debug", + "internalConsoleOptions": "openOnSessionStart" + }, + { + "type": "platformio-debug", + "request": "launch", + "name": "PlatformIO Debugger (Beta) (Quick)", + "executable": "{{ _escape_path(prog_path) }}", + "toolchainBinDir": "{{ _escape_path(dirname(gdb_path)) }}", + "internalConsoleOptions": "openOnSessionStart" } ] } \ No newline at end of file From b1caaa2208c546a4cfe5927e3b4d4b79f408fb01 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 27 Apr 2018 20:37:41 +0300 Subject: [PATCH 063/106] Export path to SVD file for IDEs --- platformio/builder/tools/pioide.py | 17 ++++++++++++++++- .../ide/tpls/vscode/.vscode/launch.json.tpl | 10 ++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/platformio/builder/tools/pioide.py b/platformio/builder/tools/pioide.py index b8e5c346..cfb93fc8 100644 --- a/platformio/builder/tools/pioide.py +++ b/platformio/builder/tools/pioide.py @@ -16,7 +16,7 @@ from __future__ import absolute_import from glob import glob from os import environ -from os.path import abspath, join +from os.path import abspath, dirname, join from SCons.Defaults import processDefines @@ -107,6 +107,19 @@ def _dump_defines(env): return defines +def _get_svd_path(env): + if "BOARD" not in env: + return None + try: + svd_path = env.BoardConfig().get("debug.svd_path") + except KeyError: + return None + if not svd_path: + return None + with util.cd(dirname(env.BoardConfig().manifest_path)): + return abspath(svd_path) + + def DumpIDEData(env): LINTCCOM = "$CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS" LINTCXXCOM = "$CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS" @@ -130,6 +143,8 @@ def DumpIDEData(env): util.where_is_program(env.subst("$GDB"), env.subst("${ENV['PATH']}")), "prog_path": env.subst("$PROG_PATH"), + "svd_path": + _get_svd_path(env), "compiler_type": env.GetCompilerType() } diff --git a/platformio/ide/tpls/vscode/.vscode/launch.json.tpl b/platformio/ide/tpls/vscode/.vscode/launch.json.tpl index 0277c921..fc6de3b4 100644 --- a/platformio/ide/tpls/vscode/.vscode/launch.json.tpl +++ b/platformio/ide/tpls/vscode/.vscode/launch.json.tpl @@ -28,18 +28,24 @@ { "type": "platformio-debug", "request": "launch", - "name": "PlatformIO Debugger (Beta)", + "name": "PlatformIO Debugger (Dev)", "executable": "{{ _escape_path(prog_path) }}", "toolchainBinDir": "{{ _escape_path(dirname(gdb_path)) }}", +% if svd_path: + "svdPath": "{{ _escape_path(svd_path) }}", +% end "preLaunchTask": "PlatformIO: Pre-Debug", "internalConsoleOptions": "openOnSessionStart" }, { "type": "platformio-debug", "request": "launch", - "name": "PlatformIO Debugger (Beta) (Quick)", + "name": "PlatformIO Debugger (Dev) (Quick)", "executable": "{{ _escape_path(prog_path) }}", "toolchainBinDir": "{{ _escape_path(dirname(gdb_path)) }}", +% if svd_path: + "svdPath": "{{ _escape_path(svd_path) }}", +% end "internalConsoleOptions": "openOnSessionStart" } ] From c9fa2206eff089fd1f7c53e7c7a59a9adde6a3fa Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 30 Apr 2018 12:33:19 +0300 Subject: [PATCH 064/106] Normalize SVD path --- platformio/builder/tools/pioide.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/platformio/builder/tools/pioide.py b/platformio/builder/tools/pioide.py index cfb93fc8..d8b5591a 100644 --- a/platformio/builder/tools/pioide.py +++ b/platformio/builder/tools/pioide.py @@ -16,7 +16,7 @@ from __future__ import absolute_import from glob import glob from os import environ -from os.path import abspath, dirname, join +from os.path import abspath, isfile, join from SCons.Defaults import processDefines @@ -112,12 +112,17 @@ def _get_svd_path(env): return None try: svd_path = env.BoardConfig().get("debug.svd_path") - except KeyError: + assert svd_path + except (AssertionError, KeyError): return None - if not svd_path: - return None - with util.cd(dirname(env.BoardConfig().manifest_path)): - return abspath(svd_path) + # custom path to SVD file + if isfile(svd_path): + return svd_path + # default file from ./platform/misc/svd folder + p = env.PioPlatform() + if isfile(join(p.get_dir(), "misc", "svd", svd_path)): + return abspath(join(p.get_dir(), "misc", "svd", svd_path)) + return None def DumpIDEData(env): From b476e298d3f0f48d19f62ab851ea966dd0cde547 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 30 Apr 2018 16:50:23 +0300 Subject: [PATCH 065/106] Bump version to 3.5.3b2 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index dd8d9f38..45571c61 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3b1") +VERSION = (3, 5, "3b2") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 94c27ae30f1e5cc8623c3da972e86b832fed132b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 1 May 2018 00:58:36 +0300 Subject: [PATCH 066/106] Update PIO Core deps --- platformio/managers/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio/managers/core.py b/platformio/managers/core.py index a8f4e606..2b18b2ba 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -21,9 +21,9 @@ from platformio import __version__, exception, util from platformio.managers.package import PackageManager CORE_PACKAGES = { - "contrib-piohome": ">=0.9.4,<2", + "contrib-piohome": ">=0.9.5,<2", "contrib-pysite": ">=0.2.0,<2", - "tool-pioplus": ">=1.1.7,<2", + "tool-pioplus": ">=1.2.1,<2", "tool-unity": "~1.20403.0", "tool-scons": "~2.20501.4" } From 73b1d9ccd59818410b1c60675e0ac1f2e1dc8465 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 1 May 2018 21:09:32 +0300 Subject: [PATCH 067/106] Configure a custom path to SVD file using "debug_svd_path" option --- HISTORY.rst | 4 +++- docs | 2 +- platformio/builder/main.py | 2 +- platformio/builder/tools/pioide.py | 4 ++++ platformio/commands/run.py | 4 ++-- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 0497745e..d72c208d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -13,9 +13,11 @@ PlatformIO 3.0 - "Recent News" block on "Welcome" page - Direct import of development platform's example +* Configure a custom path to SVD file using `debug_svd_path `__ + option * Describe your project with a new `description `_ - option for `Project Configuration File "platformio.ini" `__ (information will be used by + option from `Project Configuration File "platformio.ini" `__ (information will be used by `PlatformIO Home `_) * Updated Unity tool to 2.4.3 * Improved support for Black Magic Probe in "uploader" role diff --git a/docs b/docs index a3f4e765..84fd5fe4 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit a3f4e765e5d146df43b13719782d213cb2658359 +Subproject commit 84fd5fe430a964c1ebc9d28b2380da166a753afd diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 8da01270..7618853e 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -68,7 +68,7 @@ commonvars.AddVariables( # debug options ("DEBUG_TOOL",), - + ("DEBUG_SVD_PATH",), ) # yapf: disable diff --git a/platformio/builder/tools/pioide.py b/platformio/builder/tools/pioide.py index d8b5591a..75687360 100644 --- a/platformio/builder/tools/pioide.py +++ b/platformio/builder/tools/pioide.py @@ -108,6 +108,10 @@ def _dump_defines(env): def _get_svd_path(env): + svd_path = env.subst("$DEBUG_SVD_PATH") + if svd_path and isfile(svd_path): + return abspath(svd_path) + if "BOARD" not in env: return None try: diff --git a/platformio/commands/run.py b/platformio/commands/run.py index 98c29dda..e0fe7707 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -143,8 +143,8 @@ class EnvironmentProcessor(object): "test_port", "test_speed", "debug_tool", "debug_port", "debug_init_cmds", "debug_extra_cmds", "debug_server", "debug_init_break", "debug_load_cmd", - "debug_load_mode", "monitor_port", "monitor_baud", - "monitor_rts", "monitor_dtr") + "debug_load_mode", "debug_svd_path", "monitor_port", + "monitor_baud", "monitor_rts", "monitor_dtr") IGNORE_BUILD_OPTIONS = ("test_transport", "test_filter", "test_ignore", "test_port", "test_speed", "debug_port", From d0bc40bc247e15ccf7c136aff0adf695a1e3261d Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 1 May 2018 21:16:32 +0300 Subject: [PATCH 068/106] Update history --- HISTORY.rst | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index d72c208d..47d29c4d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -15,13 +15,11 @@ PlatformIO 3.0 * Configure a custom path to SVD file using `debug_svd_path `__ option -* Describe your project with a new - `description `_ - option from `Project Configuration File "platformio.ini" `__ (information will be used by - `PlatformIO Home `_) +* Custom project `description `_ + which will be used by `PlatformIO Home `_ * Updated Unity tool to 2.4.3 -* Improved support for Black Magic Probe in "uploader" role -* Respect a custom "lib_dir" option in `Project Configuration File "platformio.ini" `__ +* Improved support for Black Magic Probe in "uploader" mode +* Fixed issue when a custom `lib_dir `__ was not handled correctly (`issue #1473 `_) * Fixed issue with useless project rebuilding for case insensitive file systems (Windows) From 7be1af42417258a9b219b1e92fb090fffb45bfbb Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 2 May 2018 12:37:51 +0300 Subject: [PATCH 069/106] Do not check if a custom SVD file exists --- platformio/builder/tools/pioide.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/builder/tools/pioide.py b/platformio/builder/tools/pioide.py index 75687360..89b49e3d 100644 --- a/platformio/builder/tools/pioide.py +++ b/platformio/builder/tools/pioide.py @@ -109,7 +109,7 @@ def _dump_defines(env): def _get_svd_path(env): svd_path = env.subst("$DEBUG_SVD_PATH") - if svd_path and isfile(svd_path): + if svd_path: return abspath(svd_path) if "BOARD" not in env: From 366efacd815dac67210ebde48391581940478a9b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 5 May 2018 21:15:50 +0300 Subject: [PATCH 070/106] Prepend upload flags instead of "append" --- platformio/builder/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 7618853e..84fabc65 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -165,7 +165,7 @@ AlwaysBuild(env.Alias("__debug", DEFAULT_TARGETS + ["size"])) AlwaysBuild(env.Alias("__test", DEFAULT_TARGETS + ["size"])) if "UPLOAD_FLAGS" in env: - env.Append(UPLOADERFLAGS=["$UPLOAD_FLAGS"]) + env.Prepend(UPLOADERFLAGS=["$UPLOAD_FLAGS"]) for item in env.GetExtraScripts("post"): env.SConscript(item, exports="env") From 18f6f23271f15d9f44ec2ddf21eb974d7e5bb95b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 5 May 2018 21:30:18 +0300 Subject: [PATCH 071/106] Fix default OTA port for ESP32 --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 84fd5fe4..93b94ce7 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 84fd5fe430a964c1ebc9d28b2380da166a753afd +Subproject commit 93b94ce7b3f74fdafec29a5ed5e57abf6214be99 From 1310b7b07b30870c5c498856f59db6562b1753af Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 5 May 2018 23:51:59 +0300 Subject: [PATCH 072/106] Add OTA demo for ESP32 --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 93b94ce7..92493e4c 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 93b94ce7b3f74fdafec29a5ed5e57abf6214be99 +Subproject commit 92493e4cc2ebee904b6c24570b47ef8c1c282081 From 39aaae303f5a3edac64ef4e5eeb7446c82b31b9a Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 8 May 2018 18:22:56 +0300 Subject: [PATCH 073/106] Use "debug_init_break" for Eclipse --- .../ide/tpls/eclipse/.settings/PlatformIO Debugger.launch.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio/ide/tpls/eclipse/.settings/PlatformIO Debugger.launch.tpl b/platformio/ide/tpls/eclipse/.settings/PlatformIO Debugger.launch.tpl index 501ce04b..6b41950b 100644 --- a/platformio/ide/tpls/eclipse/.settings/PlatformIO Debugger.launch.tpl +++ b/platformio/ide/tpls/eclipse/.settings/PlatformIO Debugger.launch.tpl @@ -17,8 +17,8 @@ - - + + From 2bb22a86d74c54e819c922149f2b95834cee182d Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 8 May 2018 18:23:27 +0300 Subject: [PATCH 074/106] New UI for PIO Unified Debugger and VSCode --- docs | 2 +- .../ide/tpls/vscode/.vscode/launch.json.tpl | 19 ++++--------------- platformio/managers/core.py | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/docs b/docs index 92493e4c..6f9634bb 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 92493e4cc2ebee904b6c24570b47ef8c1c282081 +Subproject commit 6f9634bb82aeaa8b249de08b367441497900da66 diff --git a/platformio/ide/tpls/vscode/.vscode/launch.json.tpl b/platformio/ide/tpls/vscode/.vscode/launch.json.tpl index fc6de3b4..541e2485 100644 --- a/platformio/ide/tpls/vscode/.vscode/launch.json.tpl +++ b/platformio/ide/tpls/vscode/.vscode/launch.json.tpl @@ -2,8 +2,8 @@ // PIO Unified Debugger // -// http://docs.platformio.org/page/plus/debugging.html -// http://docs.platformio.org/page/section_env_debug.html#projectconf-debug-tool +// Documentation: http://docs.platformio.org/page/plus/debugging.html +// Configuration: http://docs.platformio.org/page/projectconf/section_env_debug.html % from os.path import dirname, join % @@ -14,21 +14,10 @@ { "version": "0.2.0", "configurations": [ - { - "type": "gdb", - "request": "launch", - "cwd": "${workspaceRoot}", - "name": "PlatformIO Debugger", - "target": "{{ _escape_path(prog_path) }}", - "gdbpath": "{{ _escape_path(join(dirname(platformio_path), "piodebuggdb")) }}", - "autorun": [ "source .pioinit" ], - "preLaunchTask": "PlatformIO: Pre-Debug", - "internalConsoleOptions": "openOnSessionStart" - }, { "type": "platformio-debug", "request": "launch", - "name": "PlatformIO Debugger (Dev)", + "name": "PlatformIO Debugger", "executable": "{{ _escape_path(prog_path) }}", "toolchainBinDir": "{{ _escape_path(dirname(gdb_path)) }}", % if svd_path: @@ -40,7 +29,7 @@ { "type": "platformio-debug", "request": "launch", - "name": "PlatformIO Debugger (Dev) (Quick)", + "name": "PlatformIO Debugger (Skip Pre-Debug)", "executable": "{{ _escape_path(prog_path) }}", "toolchainBinDir": "{{ _escape_path(dirname(gdb_path)) }}", % if svd_path: diff --git a/platformio/managers/core.py b/platformio/managers/core.py index 2b18b2ba..c5fb0084 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -23,7 +23,7 @@ from platformio.managers.package import PackageManager CORE_PACKAGES = { "contrib-piohome": ">=0.9.5,<2", "contrib-pysite": ">=0.2.0,<2", - "tool-pioplus": ">=1.2.1,<2", + "tool-pioplus": ">=1.3.0,<2", "tool-unity": "~1.20403.0", "tool-scons": "~2.20501.4" } From 4fac523811b1a72e4590e4e623d645d135796e53 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 8 May 2018 18:24:13 +0300 Subject: [PATCH 075/106] Bump version to 3.5.3b3 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 45571c61..73d8d91e 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3b2") +VERSION = (3, 5, "3b3") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 9aa5f16b495be3d40986c0d232eafd20a661a068 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 8 May 2018 21:31:55 +0300 Subject: [PATCH 076/106] Update link to PIO Unified Debugger / Community --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 6f9634bb..665cd97c 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 6f9634bb82aeaa8b249de08b367441497900da66 +Subproject commit 665cd97c35ef2db63050176d5dfb7f1a7ece403e From b310c57136e546e3d8dc8dd5e9e708f5c9e8614f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 9 May 2018 15:35:06 +0300 Subject: [PATCH 077/106] Document the missed "--project-dir" and "--environment" options for `pio device monitor` --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 665cd97c..87e20e51 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 665cd97c35ef2db63050176d5dfb7f1a7ece403e +Subproject commit 87e20e519fd3ebdf1df0697ef0e9763d7d65a046 From 9d566d89050f4193a2c2da4f4aaaef9f51c79eed Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 11 May 2018 03:06:18 +0300 Subject: [PATCH 078/106] Add debugger to env PATH --- platformio/builder/tools/pioplatform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/builder/tools/pioplatform.py b/platformio/builder/tools/pioplatform.py index bc5f4663..16c64ec9 100644 --- a/platformio/builder/tools/pioplatform.py +++ b/platformio/builder/tools/pioplatform.py @@ -69,7 +69,7 @@ def LoadPioPlatform(env, variables): # Add toolchains and uploaders to $PATH for name in installed_packages: type_ = p.get_package_type(name) - if type_ not in ("toolchain", "uploader"): + if type_ not in ("toolchain", "uploader", "debugger"): continue path = p.get_package_dir(name) if isdir(join(path, "bin")): From 5ee194b2b93c6c62699a8c340330b8bed2c8c553 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 11 May 2018 03:06:28 +0300 Subject: [PATCH 079/106] Document "Debug Level" for ESP32 --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 87e20e51..3fb38879 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 87e20e519fd3ebdf1df0697ef0e9763d7d65a046 +Subproject commit 3fb388794657186b70c5c8fefe56888b6ce92b0c From ba352454edb4896a449f16da6fde586f5f7a8335 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 11 May 2018 20:02:33 +0300 Subject: [PATCH 080/106] RISC-V dev/platform; Debug for ESP32 --- docs | 2 +- examples | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs b/docs index 3fb38879..a8f041bd 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 3fb388794657186b70c5c8fefe56888b6ce92b0c +Subproject commit a8f041bd3daebc22f51dfea9ccd358130fd85e7a diff --git a/examples b/examples index db8b4f3c..e3b80fb1 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit db8b4f3c77cf9694986eb55280038c37dd43548a +Subproject commit e3b80fb1fcbd1011fbb814a84d9b364aaadb2853 From 29064b6c63962a01d3f38aa07184bca39422bebd Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 14 May 2018 18:53:16 -0700 Subject: [PATCH 081/106] Rename "monitor_baud" option to "monitor_speed" --- HISTORY.rst | 1 + docs | 2 +- platformio/commands/run.py | 7 ++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 47d29c4d..f6c48fdd 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -19,6 +19,7 @@ PlatformIO 3.0 which will be used by `PlatformIO Home `_ * Updated Unity tool to 2.4.3 * Improved support for Black Magic Probe in "uploader" mode +* Renamed "monitor_baud" option to "monitor_speed" * Fixed issue when a custom `lib_dir `__ was not handled correctly (`issue #1473 `_) * Fixed issue with useless project rebuilding for case insensitive file diff --git a/docs b/docs index a8f041bd..b7168a2b 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit a8f041bd3daebc22f51dfea9ccd358130fd85e7a +Subproject commit b7168a2b1af5f6a08d20592d1cda727f6a379469 diff --git a/platformio/commands/run.py b/platformio/commands/run.py index e0fe7707..209e2ca0 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -144,14 +144,14 @@ class EnvironmentProcessor(object): "debug_init_cmds", "debug_extra_cmds", "debug_server", "debug_init_break", "debug_load_cmd", "debug_load_mode", "debug_svd_path", "monitor_port", - "monitor_baud", "monitor_rts", "monitor_dtr") + "monitor_speed", "monitor_rts", "monitor_dtr") IGNORE_BUILD_OPTIONS = ("test_transport", "test_filter", "test_ignore", "test_port", "test_speed", "debug_port", "debug_init_cmds", "debug_extra_cmds", "debug_server", "debug_init_break", "debug_load_cmd", "debug_load_mode", - "monitor_port", "monitor_baud", "monitor_rts", + "monitor_port", "monitor_speed", "monitor_rts", "monitor_dtr") REMAPED_OPTIONS = {"framework": "pioframework", "platform": "pioplatform"} @@ -159,7 +159,8 @@ class EnvironmentProcessor(object): RENAMED_OPTIONS = { "lib_use": "lib_deps", "lib_force": "lib_deps", - "extra_script": "extra_scripts" + "extra_script": "extra_scripts", + "monitor_baud": "monitor_speed" } RENAMED_PLATFORMS = {"espressif": "espressif8266"} From 19003ea51b9ea9f0418d818621f3265b29ceac4c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 14 May 2018 22:13:42 -0700 Subject: [PATCH 082/106] Simplify configuration for PIO Unit Testing --- HISTORY.rst | 2 ++ docs | 2 +- examples | 2 +- platformio/builder/main.py | 1 + platformio/builder/tools/piomisc.py | 7 ++----- platformio/builder/tools/platformio.py | 21 ++++++++------------- platformio/managers/core.py | 2 +- 7 files changed, 16 insertions(+), 21 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index f6c48fdd..c821888e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -13,6 +13,8 @@ PlatformIO 3.0 - "Recent News" block on "Welcome" page - Direct import of development platform's example +* Simplify configuration for `PIO Unit Testing `__: separate main program from a test build process, drop + requirement for ``#ifdef UNIT_TEST`` guard * Configure a custom path to SVD file using `debug_svd_path `__ option * Custom project `description `_ diff --git a/docs b/docs index b7168a2b..0889b198 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit b7168a2b1af5f6a08d20592d1cda727f6a379469 +Subproject commit 0889b198d3b0e6490aca6bf02b66d2a3e5f0c9c7 diff --git a/examples b/examples index e3b80fb1..41f3396c 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit e3b80fb1fcbd1011fbb814a84d9b364aaadb2853 +Subproject commit 41f3396c5883d54e6cc5603d380400ca46df8876 diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 84fabc65..cdd7d5d1 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -99,6 +99,7 @@ DEFAULT_ENV_OPTIONS = dict( BUILD_DIR=join("$PROJECTBUILD_DIR", "$PIOENV"), BUILDSRC_DIR=join("$BUILD_DIR", "src"), BUILDTEST_DIR=join("$BUILD_DIR", "test"), + LIBPATH=["$BUILD_DIR"], LIBSOURCE_DIRS=[ util.get_projectlib_dir(), util.get_projectlibdeps_dir(), diff --git a/platformio/builder/tools/piomisc.py b/platformio/builder/tools/piomisc.py index bff38d6e..b01ea1a2 100644 --- a/platformio/builder/tools/piomisc.py +++ b/platformio/builder/tools/piomisc.py @@ -295,11 +295,8 @@ def ProcessTest(env): src_filter.append("+<%s%s>" % (env['PIOTEST'], sep)) env.Replace(PIOTEST_SRC_FILTER=src_filter) - return env.CollectBuildFiles( - "$BUILDTEST_DIR", - "$PROJECTTEST_DIR", - "$PIOTEST_SRC_FILTER", - duplicate=False) + return env.CollectBuildFiles("$BUILDTEST_DIR", "$PROJECTTEST_DIR", + "$PIOTEST_SRC_FILTER") def GetExtraScripts(env, scope): diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index bb2dd1c6..9d7f333c 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -30,12 +30,11 @@ SRC_HEADER_EXT = ["h", "hpp"] SRC_C_EXT = ["c", "cc", "cpp"] SRC_BUILD_EXT = SRC_C_EXT + ["S", "spp", "SPP", "sx", "s", "asm", "ASM"] SRC_FILTER_DEFAULT = ["+<*>", "-<.git%s>" % sep, "-" % sep] +SRC_FILTER_PATTERNS_RE = re.compile(r"(\+|\-)<([^>]+)>") def scons_patched_match_splitext(path, suffixes=None): - """ - Patch SCons Builder, append $OBJSUFFIX to the end of each target - """ + """Patch SCons Builder, append $OBJSUFFIX to the end of each target""" tokens = Util.splitext(path) if suffixes and tokens[1] and tokens[1] in suffixes: return (path, tokens[1]) @@ -91,16 +90,14 @@ def BuildProgram(env): # Handle SRC_BUILD_FLAGS env.ProcessFlags(env.get("SRC_BUILD_FLAGS")) - env.Append( - LIBPATH=["$BUILD_DIR"], - PIOBUILDFILES=env.CollectBuildFiles( - "$BUILDSRC_DIR", - "$PROJECTSRC_DIR", - src_filter=env.get("SRC_FILTER"), - duplicate=False)) - if "__test" in COMMAND_LINE_TARGETS: env.Append(PIOBUILDFILES=env.ProcessTest()) + else: + env.Append( + PIOBUILDFILES=env.CollectBuildFiles( + "$BUILDSRC_DIR", + "$PROJECTSRC_DIR", + src_filter=env.get("SRC_FILTER"))) if not env['PIOBUILDFILES'] and not COMMAND_LINE_TARGETS: sys.stderr.write( @@ -197,8 +194,6 @@ def IsFileWithExt(env, file_, ext): # pylint: disable=W0613 def MatchSourceFiles(env, src_dir, src_filter=None): - SRC_FILTER_PATTERNS_RE = re.compile(r"(\+|\-)<([^>]+)>") - def _append_build_item(items, item, src_dir): if env.IsFileWithExt(item, SRC_BUILD_EXT + SRC_HEADER_EXT): items.add(item.replace(src_dir + sep, "")) diff --git a/platformio/managers/core.py b/platformio/managers/core.py index c5fb0084..3aa37fe7 100644 --- a/platformio/managers/core.py +++ b/platformio/managers/core.py @@ -23,7 +23,7 @@ from platformio.managers.package import PackageManager CORE_PACKAGES = { "contrib-piohome": ">=0.9.5,<2", "contrib-pysite": ">=0.2.0,<2", - "tool-pioplus": ">=1.3.0,<2", + "tool-pioplus": ">=1.3.1,<2", "tool-unity": "~1.20403.0", "tool-scons": "~2.20501.4" } From cb2c3b1b638b09c7b3b15b7520429f2fdf888cbc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 14 May 2018 22:14:10 -0700 Subject: [PATCH 083/106] Bump version to 3.5.3b4 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 73d8d91e..9db47c05 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3b3") +VERSION = (3, 5, "3b4") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From e399c6b3631d0b0807989689d2da0f06cc99721e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 15 May 2018 14:05:29 -0700 Subject: [PATCH 084/106] Fix issue with `monitor_speed` option --- platformio/commands/device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/commands/device.py b/platformio/commands/device.py index 877b62e6..8b6dbd89 100644 --- a/platformio/commands/device.py +++ b/platformio/commands/device.py @@ -166,7 +166,7 @@ def device_monitor(**kwargs): # pylint: disable=too-many-branches monitor_options = {k: v for k, v in project_options or []} if monitor_options: for k in ("port", "baud", "rts", "dtr"): - k2 = "monitor_%s" % k + k2 = "monitor_%s" % ("speed" if k == "baud" else k) if kwargs[k] is None and k2 in monitor_options: kwargs[k] = monitor_options[k2] if k != "port": From 98852caefa4b672362266d219a4e7b47c03b02bf Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 15 May 2018 14:06:12 -0700 Subject: [PATCH 085/106] Bump version to 3.5.3b5 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 9db47c05..0cc689b9 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3b4") +VERSION = (3, 5, "3b5") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From 6a1a1956c8125e4c0f63ca7cba95f41c47e81d72 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 15 May 2018 15:13:11 -0700 Subject: [PATCH 086/106] Docs: add ft2232h as debug tool --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 0889b198..bad43dc8 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 0889b198d3b0e6490aca6bf02b66d2a3e5f0c9c7 +Subproject commit bad43dc880632db1bd0e47236da5ce871459b587 From e22335984f72dc24fd7ad2a935bf0ccfe66de24f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 15 May 2018 15:23:09 -0700 Subject: [PATCH 087/106] Default debugging configuration for ESP-WROVER-KIT --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index bad43dc8..17698be3 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit bad43dc880632db1bd0e47236da5ce871459b587 +Subproject commit 17698be3cdb1e5493ea7dfd201664a00d46320ca From f7053928f0a7d3d65385e80e1f99b513364e4345 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 15 May 2018 17:22:03 -0700 Subject: [PATCH 088/106] Better explanation how to switch between stable/upstream dev/platforms --- docs | 2 +- scripts/docspregen.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs b/docs index 17698be3..670dad7c 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 17698be3cdb1e5493ea7dfd201664a00d46320ca +Subproject commit 670dad7cf4330330276ec2b349ceb9cca6a1b0d7 diff --git a/scripts/docspregen.py b/scripts/docspregen.py index 9d1c2371..e18bb832 100644 --- a/scripts/docspregen.py +++ b/scripts/docspregen.py @@ -302,7 +302,7 @@ Stable and upstream versions You can switch between `stable releases `__ of {title} development platform and the latest upstream version using -:ref:`projectconf_env_platform` option as described below: +:ref:`projectconf_env_platform` option in :ref:`projectconf` as described below: .. code-block:: ini From 8cda6db02d8d739dfaee676a0de0dbbc7e92856e Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 25 May 2018 01:46:53 +0300 Subject: [PATCH 089/106] Rename LDF compatibility mode from "light" to "soft" --- docs | 2 +- platformio/builder/tools/piolib.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs b/docs index 670dad7c..3f618145 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 670dad7cf4330330276ec2b349ceb9cca6a1b0d7 +Subproject commit 3f618145977e971f1d51c32794dba1449b7d9f39 diff --git a/platformio/builder/tools/piolib.py b/platformio/builder/tools/piolib.py index 2d77d167..9048ea1c 100644 --- a/platformio/builder/tools/piolib.py +++ b/platformio/builder/tools/piolib.py @@ -86,8 +86,8 @@ class LibBuilderBase(object): LDF_MODES = ["off", "chain", "deep", "chain+", "deep+"] LDF_MODE_DEFAULT = "chain" - COMPAT_MODES = ["off", "light", "strict"] - COMPAT_MODE_DEFAULT = "light" + COMPAT_MODES = ["off", "soft", "strict"] + COMPAT_MODE_DEFAULT = "soft" CLASSIC_SCANNER = SCons.Scanner.C.CScanner() CCONDITIONAL_SCANNER = SCons.Scanner.C.CConditionalScanner() @@ -758,7 +758,7 @@ def GetLibBuilders(env): # pylint: disable=too-many-branches sys.stderr.write( "Platform incompatible library %s\n" % lb.path) return False - if compat_mode == "light" and "PIOFRAMEWORK" in env and \ + if compat_mode == "soft" and "PIOFRAMEWORK" in env and \ not lb.is_frameworks_compatible(env.get("PIOFRAMEWORK", [])): if verbose: sys.stderr.write( From 4a2594c12e0361d52a6ef2b99953c6b07881d531 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 25 May 2018 15:31:31 +0300 Subject: [PATCH 090/106] Docs: revert back to 'sphinx' theme for Pygments --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 3f618145..c81c85b8 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 3f618145977e971f1d51c32794dba1449b7d9f39 +Subproject commit c81c85b861bd59e06978d37611ab68b3a54633da From 2f07a58e4f0d6a225b688c428f508d3be68ae1a5 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 25 May 2018 16:17:02 +0300 Subject: [PATCH 091/106] Split stable/upstream docs for dev/platforms --- docs | 2 +- scripts/docspregen.py | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/docs b/docs index c81c85b8..4ccbe4a4 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit c81c85b861bd59e06978d37611ab68b3a54633da +Subproject commit 4ccbe4a41e38da952cc135894b8069864cfd4225 diff --git a/scripts/docspregen.py b/scripts/docspregen.py index e18bb832..cd56034c 100644 --- a/scripts/docspregen.py +++ b/scripts/docspregen.py @@ -302,21 +302,31 @@ Stable and upstream versions You can switch between `stable releases `__ of {title} development platform and the latest upstream version using -:ref:`projectconf_env_platform` option in :ref:`projectconf` as described below: +:ref:`projectconf_env_platform` option in :ref:`projectconf` as described below. + +Stable +~~~~~~ .. code-block:: ini - ; Custom stable version - [env:stable] - platform ={name}@x.y.z + ; Latest stable version + [env:latest_stable] + platform = {name} board = ... - ... - ; The latest upstream/development version - [env:upstream] + ; Custom stable version + [env:custom_stable] + platform = {name}@x.y.z + board = ... + +Upstream +~~~~~~~~ + +.. code-block:: ini + + [env:upstream_develop] platform = https://github.com/platformio/platform-{name}.git board = ... - ... """.format(name=p.name, title=p.title)) # From 357c932a88a61cf918ea4cf00dbdedfdf555bf4b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 25 May 2018 19:06:23 +0300 Subject: [PATCH 092/106] Fix broken link --- HISTORY.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index c821888e..404635c5 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -22,7 +22,8 @@ PlatformIO 3.0 * Updated Unity tool to 2.4.3 * Improved support for Black Magic Probe in "uploader" mode * Renamed "monitor_baud" option to "monitor_speed" -* Fixed issue when a custom `lib_dir `__ was not handled correctly +* Fixed issue when a custom `lib_dir `__ + was not handled correctly (`issue #1473 `_) * Fixed issue with useless project rebuilding for case insensitive file systems (Windows) From e48e15b0140ea678bebbcf7551a585aab0f717fc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 25 May 2018 21:13:47 +0300 Subject: [PATCH 093/106] Fix "memoized" helper when "expire" is not used --- platformio/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platformio/util.py b/platformio/util.py index 49ff8547..ca081c22 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -122,7 +122,8 @@ class memoized(object): def wrapper(*args, **kwargs): key = str(args) + str(kwargs) if (key not in self.cache - or self.cache[key][0] < time.time() - self.expire): + or (self.expire > 0 + and self.cache[key][0] < time.time() - self.expire)): self.cache[key] = (time.time(), func(*args, **kwargs)) return self.cache[key][1] From 5011c3e21c836c05d4df1824f7002a91f10d82f7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 25 May 2018 21:18:08 +0300 Subject: [PATCH 094/106] API to update BoardConfig manifest --- platformio/managers/platform.py | 9 +++++++++ platformio/util.py | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/platformio/managers/platform.py b/platformio/managers/platform.py index 7bb450af..03010fdc 100644 --- a/platformio/managers/platform.py +++ b/platformio/managers/platform.py @@ -665,6 +665,15 @@ class PlatformBoardConfig(object): else: raise KeyError("Invalid board option '%s'" % path) + def update(self, path, value): + newdict = None + for key in path.split(".")[::-1]: + if newdict is None: + newdict = {key: value} + else: + newdict = {key: newdict} + util.merge_dicts(self._manifest, newdict) + def __contains__(self, key): try: self.get(key) diff --git a/platformio/util.py b/platformio/util.py index ca081c22..e37660e2 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -754,6 +754,18 @@ def format_filesize(filesize): return "%d%sB" % ((base * filesize / unit), suffix) +def merge_dicts(d1, d2, path=None): + if path is None: + path = [] + for key in d2: + if (key in d1 and isinstance(d1[key], dict) + and isinstance(d2[key], dict)): + merge_dicts(d1[key], d2[key], path + [str(key)]) + else: + d1[key] = d2[key] + return d1 + + def rmtree_(path): def _onerror(_, name, __): From 9ba5dc0a602801ef08b8b02d6f98d40660b871b3 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 26 May 2018 01:02:52 +0300 Subject: [PATCH 095/106] Override any option from board manifest in Project Configuration File "platformio.ini" // Resolve #1612 --- HISTORY.rst | 2 ++ docs | 2 +- platformio/builder/main.py | 2 ++ platformio/builder/tools/pioplatform.py | 18 ++++++++++---- platformio/builder/tools/platformio.py | 6 ++--- platformio/commands/run.py | 31 +++++++++++++++---------- 6 files changed, 40 insertions(+), 21 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 404635c5..7d3886ea 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -15,6 +15,8 @@ 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 `Project Configuration File "platformio.ini" `__ + (`issue #1612 `_) * Configure a custom path to SVD file using `debug_svd_path `__ option * Custom project `description `_ diff --git a/docs b/docs index 4ccbe4a4..bea5f7fa 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 4ccbe4a41e38da952cc135894b8069864cfd4225 +Subproject commit bea5f7fa6c0758878a9e563e243f57994be4d91b diff --git a/platformio/builder/main.py b/platformio/builder/main.py index cdd7d5d1..caafda5b 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -54,10 +54,12 @@ commonvars.AddVariables( # board options ("BOARD",), + # deprecated options, use board_{object.path} instead ("BOARD_MCU",), ("BOARD_F_CPU",), ("BOARD_F_FLASH",), ("BOARD_FLASH_MODE",), + # end of deprecated options # upload options ("UPLOAD_PORT",), diff --git a/platformio/builder/tools/pioplatform.py b/platformio/builder/tools/pioplatform.py index 16c64ec9..0b7cb6a5 100644 --- a/platformio/builder/tools/pioplatform.py +++ b/platformio/builder/tools/pioplatform.py @@ -14,6 +14,7 @@ from __future__ import absolute_import +import base64 import sys from os.path import isdir, isfile, join @@ -83,16 +84,23 @@ def LoadPioPlatform(env, variables): if "BOARD" not in env: return + # update board manifest with a custom data board_config = env.BoardConfig() - for k in variables.keys(): - if k in env or \ - not any([k.startswith("BOARD_"), k.startswith("UPLOAD_")]): + for key, value in variables.UnknownVariables().items(): + if not key.startswith("BOARD_"): continue - _opt, _val = k.lower().split("_", 1) + board_config.update(key.lower()[6:], base64.b64decode(value)) + + # update default environment variables + for key in variables.keys(): + if key in env or \ + not any([key.startswith("BOARD_"), key.startswith("UPLOAD_")]): + continue + _opt, _val = key.lower().split("_", 1) if _opt == "board": _opt = "build" if _val in board_config.get(_opt): - env.Replace(**{k: board_config.get("%s.%s" % (_opt, _val))}) + env.Replace(**{key: board_config.get("%s.%s" % (_opt, _val))}) if "build.ldscript" in board_config: env.Replace(LDSCRIPT_PATH=board_config.get("build.ldscript")) diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 9d7f333c..9c6f6d0d 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -20,7 +20,7 @@ from glob import glob from os import sep, walk from os.path import basename, dirname, isdir, join, realpath -from SCons import Action, Builder, Util +from SCons import Builder, Util from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, DefaultEnvironment, SConscript) @@ -108,8 +108,8 @@ def BuildProgram(env): program = env.Program( join("$BUILD_DIR", env.subst("$PROGNAME")), env['PIOBUILDFILES']) - checksize_action = Action.Action(env.CheckUploadSize, - "Checking program size") + checksize_action = env.VerboseAction(env.CheckUploadSize, + "Checking program size") AlwaysBuild(env.Alias("checkprogsize", program, checksize_action)) if set(["upload", "program"]) & set(COMMAND_LINE_TARGETS): env.AddPostAction(program, checksize_action) diff --git a/platformio/commands/run.py b/platformio/commands/run.py index 209e2ca0..f2d4636c 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -131,16 +131,15 @@ class EnvironmentProcessor(object): "src_dir", "build_dir", "data_dir", "test_dir", "boards_dir", "lib_extra_dirs") - KNOWN_ENV_OPTIONS = ("platform", "framework", "board", "board_mcu", - "board_f_cpu", "board_f_flash", "board_flash_mode", - "build_flags", "src_build_flags", "build_unflags", - "src_filter", "extra_scripts", "targets", - "upload_port", "upload_protocol", "upload_speed", - "upload_flags", "upload_resetmethod", "lib_deps", - "lib_ignore", "lib_extra_dirs", "lib_ldf_mode", - "lib_compat_mode", "lib_archive", "piotest", - "test_transport", "test_filter", "test_ignore", - "test_port", "test_speed", "debug_tool", "debug_port", + KNOWN_ENV_OPTIONS = ("platform", "framework", "board", "build_flags", + "src_build_flags", "build_unflags", "src_filter", + "extra_scripts", "targets", "upload_port", + "upload_protocol", "upload_speed", "upload_flags", + "upload_resetmethod", "lib_deps", "lib_ignore", + "lib_extra_dirs", "lib_ldf_mode", "lib_compat_mode", + "lib_archive", "piotest", "test_transport", + "test_filter", "test_ignore", "test_port", + "test_speed", "debug_tool", "debug_port", "debug_init_cmds", "debug_extra_cmds", "debug_server", "debug_init_break", "debug_load_cmd", "debug_load_mode", "debug_svd_path", "monitor_port", @@ -160,7 +159,11 @@ class EnvironmentProcessor(object): "lib_use": "lib_deps", "lib_force": "lib_deps", "extra_script": "extra_scripts", - "monitor_baud": "monitor_speed" + "monitor_baud": "monitor_speed", + "board_mcu": "board_build.mcu", + "board_f_cpu": "board_build.f_cpu", + "board_f_flash": "board_build.f_flash", + "board_flash_mode": "board_build.flash_mode" } RENAMED_PLATFORMS = {"espressif": "espressif8266"} @@ -238,7 +241,11 @@ class EnvironmentProcessor(object): v = self.RENAMED_PLATFORMS[v] # warn about unknown options - if k not in self.KNOWN_ENV_OPTIONS and not k.startswith("custom_"): + unknown_conditions = [ + k not in self.KNOWN_ENV_OPTIONS, not k.startswith("custom_"), + not k.startswith("board_") + ] + if all(unknown_conditions): click.secho( "Detected non-PlatformIO `%s` option in `[env:%s]` section" % (k, self.name), From d50dfe19d9874aa341ff9ffbfe79b29281cfb2e2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 26 May 2018 01:04:38 +0300 Subject: [PATCH 096/106] Bump version to 3.5.3rc1 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 0cc689b9..9c3b8c38 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3b5") +VERSION = (3, 5, "3rc1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From b213a302e3777a5b2ad78576e88f6b0c6204bcdb Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 30 May 2018 14:14:42 +0300 Subject: [PATCH 097/106] Handle _MCU and _F_CPU variables for AVR native // Resolve #1641 --- platformio/builder/tools/pioplatform.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/platformio/builder/tools/pioplatform.py b/platformio/builder/tools/pioplatform.py index 0b7cb6a5..340ebd37 100644 --- a/platformio/builder/tools/pioplatform.py +++ b/platformio/builder/tools/pioplatform.py @@ -23,6 +23,8 @@ from SCons.Script import COMMAND_LINE_TARGETS from platformio import exception, util from platformio.managers.platform import PlatformFactory +# pylint: disable=too-many-branches + @util.memoized() def initPioPlatform(name): @@ -82,6 +84,12 @@ def LoadPioPlatform(env, variables): env.Prepend(LIBPATH=[join(p.get_dir(), "ldscripts")]) if "BOARD" not in env: + # handle _MCU and _F_CPU variables for AVR native + for key, value in variables.UnknownVariables().items(): + if not key.startswith("BOARD_"): + continue + env.Replace( + **{key.upper().replace("BUILD.", ""): base64.b64decode(value)}) return # update board manifest with a custom data @@ -106,7 +114,7 @@ def LoadPioPlatform(env, variables): env.Replace(LDSCRIPT_PATH=board_config.get("build.ldscript")) -def PrintConfiguration(env): # pylint: disable=too-many-branches +def PrintConfiguration(env): platform_data = ["PLATFORM: %s >" % env.PioPlatform().title] system_data = ["SYSTEM:"] mcu = env.subst("$BOARD_MCU") From e4440ed94cabfa70aaba2a9423e6b3cde9977f6f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 30 May 2018 14:16:46 +0300 Subject: [PATCH 098/106] Bump version to 3.5.3rc2 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index 9c3b8c38..5b90542b 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3rc1") +VERSION = (3, 5, "3rc2") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From df437995df6e3f17ef8bf46f0dcda499795f4f19 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 30 May 2018 19:12:30 +0300 Subject: [PATCH 099/106] Enable C++ exceptions for ESP32 and ESP-IDF --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index bea5f7fa..11c75a39 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit bea5f7fa6c0758878a9e563e243f57994be4d91b +Subproject commit 11c75a3910fa1bcfc00582e6b787f8530ac66a9f From fb29c9c0f6c792d2c0a2abc19f49eef41466c1ea Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 30 May 2018 20:25:59 +0300 Subject: [PATCH 100/106] Support old version of `monitor_baud` option for device monitor --- platformio/commands/device.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platformio/commands/device.py b/platformio/commands/device.py index 8b6dbd89..78bb7cdc 100644 --- a/platformio/commands/device.py +++ b/platformio/commands/device.py @@ -165,8 +165,10 @@ def device_monitor(**kwargs): # pylint: disable=too-many-branches kwargs['environment']) monitor_options = {k: v for k, v in project_options or []} if monitor_options: - for k in ("port", "baud", "rts", "dtr"): - k2 = "monitor_%s" % ("speed" if k == "baud" else k) + for k in ("port", "baud", "speed", "rts", "dtr"): + k2 = "monitor_%s" % k + if k == "speed": + k = "baud" if kwargs[k] is None and k2 in monitor_options: kwargs[k] = monitor_options[k2] if k != "port": From ffc94a88fe0003152eb21a334289861bbbe7cb36 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 31 May 2018 14:31:28 +0300 Subject: [PATCH 101/106] Sync dccs --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 11c75a39..48295313 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 11c75a3910fa1bcfc00582e6b787f8530ac66a9f +Subproject commit 4829531302df5f2e6cc031fa8807f6854e979115 From f4b4f5c434a698e0b0a4ec6a889d9325ca2489d6 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 31 May 2018 15:21:39 +0300 Subject: [PATCH 102/106] Improve docs for `lib_ignore` option --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 48295313..7c206c57 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 4829531302df5f2e6cc031fa8807f6854e979115 +Subproject commit 7c206c57f03279271aee4c5043ea5a50b95c8edc From f465befa6807540a05038d0390316807eaed7bc9 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 31 May 2018 16:11:22 +0300 Subject: [PATCH 103/106] Rename "Standalone" to "Desktop" for IDE --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index 7c206c57..e1480f35 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 7c206c57f03279271aee4c5043ea5a50b95c8edc +Subproject commit e1480f3594a2067cedec700560f490f8e5da6355 From 3243a84dbab3ae8fcebe74f9f4a6081aa193a9c2 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 31 May 2018 16:38:33 +0300 Subject: [PATCH 104/106] Fix incorrect handling of C/C++ standards passed via build_flags --- .../ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl b/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl index e5868d7c..d481de89 100644 --- a/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl +++ b/platformio/ide/tpls/vscode/.vscode/c_cpp_properties.json.tpl @@ -46,12 +46,14 @@ "intelliSenseMode": "clang-x64", % import re % STD_RE = re.compile(r"\-std=[a-z\+]+(\d+)") +% cc_stds = STD_RE.findall(cc_flags) +% cxx_stds = STD_RE.findall(cxx_flags) % -% if STD_RE.search(cc_flags): - "cStandard": "c{{ STD_RE.search(cc_flags).group(1) }}", +% if cc_stds: + "cStandard": "c{{ cc_stds[-1] }}", % end -% if STD_RE.search(cxx_flags): - "cppStandard": "c++{{ STD_RE.search(cxx_flags).group(1) }}", +% if cxx_stds: + "cppStandard": "c++{{ cxx_stds[-1] }}", % end "compilerPath": "{{ cc_path.replace('\\\\', '/').replace('\\', '/').replace('"', '\\"') }}" } From 32dbf22d44c67e0fd35f129179cfcfb470bf55fc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 31 May 2018 20:03:03 +0300 Subject: [PATCH 105/106] ESP32: Calculate an absolute path for a custom partitions table --- docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs b/docs index e1480f35..9027fb91 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit e1480f3594a2067cedec700560f490f8e5da6355 +Subproject commit 9027fb91806573c063ef5cdc93d0541c38816e4f From 7db04b1c3f75c83c37476d840f98b4eb376ccb03 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 1 Jun 2018 17:01:32 +0300 Subject: [PATCH 106/106] Bump version to 3.5.3 (issue #1641 issue #1612 issue #1473 issue #1528 issue #1546 issue #1282 issue #1516 issue #1381 issue #1474) --- HISTORY.rst | 2 +- docs | 2 +- platformio/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 7d3886ea..4bcb68f6 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,7 +4,7 @@ Release Notes PlatformIO 3.0 -------------- -3.5.3 (2018-??-??) +3.5.3 (2018-06-01) ~~~~~~~~~~~~~~~~~~ * `PlatformIO Home `__ - diff --git a/docs b/docs index 9027fb91..3ad76be8 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 9027fb91806573c063ef5cdc93d0541c38816e4f +Subproject commit 3ad76be8f73ab1b3766bafa7ffca4284051aca4c diff --git a/platformio/__init__.py b/platformio/__init__.py index 5b90542b..6de67c99 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 5, "3rc2") +VERSION = (3, 5, 3) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio"