Skip to content

Commit

Permalink
Use virtual python env to get dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton committed Nov 19, 2024
1 parent 23b8962 commit 5e204ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class CuraConan(ConanFile):
build_policy = "missing"
exports = "LICENSE*", "*.jinja"
settings = "os", "compiler", "build_type", "arch"
generators = "VirtualPythonEnv"

# FIXME: Remove specific branch once merged to main
python_requires = "translationextractor/[>=2.2.0]@ultimaker/cura_11622"
Expand Down Expand Up @@ -147,9 +148,8 @@ def _python_installs(self):
outer = '"' if self.settings.os == "Windows" else "'"
inner = "'" if self.settings.os == "Windows" else '"'
buffer = StringIO()
env_path = str(self._root_dir.joinpath("virtual_python_env"))
self.run(f"""python -c {outer}import importlib.metadata; print({inner};{inner}.join([(package.metadata[{inner}Name{inner}]+{inner},{inner}+ package.metadata[{inner}Version{inner}]) for package in importlib.metadata.distributions()])){outer}""",
env = env_path,
env = "virtual_python_env",
stdout = buffer)

packages = str(buffer.getvalue()).strip('\r\n').split(";")
Expand Down

0 comments on commit 5e204ab

Please sign in to comment.