Skip to content

Commit

Permalink
Fixed an issue with "ImportError: cannot import name '_get_backend' f…
Browse files Browse the repository at this point in the history
…rom 'cryptography.hazmat.backends'" when using Remote Development // Resolve #3652
  • Loading branch information
ivankravets committed Sep 6, 2020
1 parent 9695720 commit 4234dfb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ PlatformIO Core 5
~~~~~~~~~~~~~~~~~~

- Fixed an issue when using a custom git/ssh package with `platform_packages <https://docs.platformio.org/page/projectconf/section_env_platform.html#platform-packages>`__ option (`issue #3624 <https://github.com/platformio/platformio-core/issues/3624>`_)
- Fixed an issue with "ImportError: cannot import name '_get_backend' from 'cryptography.hazmat.backends'" when using `Remote Development <https://docs.platformio.org/page/plus/pio-remote.html>`__ on RaspberryPi device (`issue #3652 <https://github.com/platformio/platformio-core/issues/3652>`_)

5.0.0 (2020-09-03)
~~~~~~~~~~~~~~~~~~
Expand Down
32 changes: 22 additions & 10 deletions platformio/package/manager/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from platformio import __core_packages__, exception, fs, util
from platformio.compat import PY2
from platformio.package.manager.tool import ToolPackageManager
from platformio.package.meta import PackageSpec
from platformio.package.meta import PackageItem, PackageSpec
from platformio.proc import get_pythonexe_path


Expand Down Expand Up @@ -95,16 +95,8 @@ def build_contrib_pysite_deps(target_dir):
if os.path.isdir(target_dir):
fs.rmtree(target_dir)
os.makedirs(target_dir)
with open(os.path.join(target_dir, "package.json"), "w") as fp:
json.dump(
dict(
name="contrib-pysite",
version="2.%d%d.0" % (sys.version_info.major, sys.version_info.minor),
system=util.get_systype(),
),
fp,
)

# build dependencies
pythonexe = get_pythonexe_path()
for dep in get_contrib_pysite_deps():
subprocess.check_call(
Expand All @@ -115,11 +107,31 @@ def build_contrib_pysite_deps(target_dir):
"install",
# "--no-cache-dir",
"--no-compile",
"--no-binary",
":all:",
"-t",
target_dir,
dep,
]
)

# build manifests
with open(os.path.join(target_dir, "package.json"), "w") as fp:
json.dump(
dict(
name="contrib-pysite",
version="2.%d%d.0" % (sys.version_info.major, sys.version_info.minor),
system=util.get_systype(),
),
fp,
)
pm = ToolPackageManager()
pkg = PackageItem(target_dir)
pkg.metadata = pm.build_metadata(
target_dir, PackageSpec(owner="platformio", name="contrib-pysite")
)
pkg.dump_meta()

return True


Expand Down

0 comments on commit 4234dfb

Please sign in to comment.