diff --git a/HISTORY.rst b/HISTORY.rst index 7401f2d6..d6803d0b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -18,8 +18,10 @@ PlatformIO Core 5 * `pio pkg outdated `__ - check for project outdated packages * `pio pkg exec `_ - run command from package tool (`issue #4163 `_) + - Dropped automatic updates of global libraries and development platforms (`issue #4179 `_) + - Dropped support for "pythonPackages" field in "platform.json" manifest in favor of `Extra Python Dependencies `__ + * Improved PIO Remote setup on credit-card sized computers (Raspberry Pi, BeagleBon, etc) (`issue #3865 `_) -* Dropped automatic updates of global libraries and development platforms (`issue #4179 `_) 5.2.5 (2022-02-10) ~~~~~~~~~~~~~~~~~~ diff --git a/docs b/docs index 5a4ab6ac..87396f76 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 5a4ab6acb49ee3b118e1d3aa25fb540ba0b1defb +Subproject commit 87396f762b6aa8cb0079fcf9b4d147e52d26cc3f diff --git a/platformio/package/manager/platform.py b/platformio/package/manager/platform.py index 0b438018..6251f9aa 100644 --- a/platformio/package/manager/platform.py +++ b/platformio/package/manager/platform.py @@ -47,7 +47,9 @@ class PlatformPackageManager(BasePackageManager): # pylint: disable=too-many-an with_all_packages=False, silent=False, force=False, + project_env=None, ): + already_installed = self.get_package(spec) pkg = super(PlatformPackageManager, self).install( spec, silent=silent, force=force, skip_dependencies=True ) @@ -60,6 +62,9 @@ class PlatformPackageManager(BasePackageManager): # pylint: disable=too-many-an ) raise e + if project_env: + p.configure_project_packages(project_env) + if with_all_packages: with_packages = list(p.packages) @@ -70,8 +75,8 @@ class PlatformPackageManager(BasePackageManager): # pylint: disable=too-many-an silent=silent, force=force, ) - p.install_python_packages() - p.on_installed() + if not already_installed: + p.on_installed() return pkg def uninstall(self, spec, silent=False, skip_dependencies=False): @@ -83,7 +88,6 @@ class PlatformPackageManager(BasePackageManager): # pylint: disable=too-many-an pkg, silent=silent, skip_dependencies=True ) if not skip_dependencies: - p.uninstall_python_packages() p.on_uninstalled() return pkg diff --git a/platformio/platform/base.py b/platformio/platform/base.py index c5d9d636..75cf6f24 100644 --- a/platformio/platform/base.py +++ b/platformio/platform/base.py @@ -13,12 +13,10 @@ # limitations under the License. import os -import subprocess -import click import semantic_version -from platformio import __version__, fs, proc +from platformio import __version__, fs from platformio.package.manager.tool import ToolPackageManager from platformio.package.version import pepver_to_semver from platformio.platform._packages import PlatformPackagesMixin @@ -104,10 +102,6 @@ class PlatformBase( # pylint: disable=too-many-instance-attributes,too-many-pub packages[spec.name].update(**options) return packages - @property - def python_packages(self): - return self._manifest.get("pythonPackages") - def ensure_engine_compatible(self): if not self.engines or "platformio" not in self.engines: return True @@ -238,37 +232,3 @@ class PlatformBase( # pylint: disable=too-many-instance-attributes,too-many-pub def on_uninstalled(self): pass - - def install_python_packages(self): - if not self.python_packages: - return None - click.echo( - "Installing Python packages: %s" - % ", ".join(list(self.python_packages.keys())), - ) - args = [proc.get_pythonexe_path(), "-m", "pip", "install", "--upgrade"] - for name, requirements in self.python_packages.items(): - if any(c in requirements for c in ("<", ">", "=")): - args.append("%s%s" % (name, requirements)) - else: - args.append("%s==%s" % (name, requirements)) - try: - return subprocess.call(args) == 0 - except Exception as e: # pylint: disable=broad-except - click.secho( - "Could not install Python packages -> %s" % e, fg="red", err=True - ) - return None - - def uninstall_python_packages(self): - if not self.python_packages: - return - click.echo("Uninstalling Python packages") - args = [proc.get_pythonexe_path(), "-m", "pip", "uninstall", "--yes"] - args.extend(list(self.python_packages.keys())) - try: - subprocess.call(args) == 0 - except Exception as e: # pylint: disable=broad-except - click.secho( - "Could not install Python packages -> %s" % e, fg="red", err=True - )