Browse Source

Apply code-review suggestions.

CURA-9068
pull/1/head
Remco Burema 4 years ago
parent
commit
d6a15cafa7
  1. 4
      generators/CuraPackage.py
  2. 19
      generators/VirtualPythonEnv.py

4
generators/CuraPackage.py

@ -14,7 +14,7 @@ from conans.util.files import mkdir, sha256sum
from conans.tools import Version
FILTERED_FILES = ["conaninfo.txt", "conanmanifest.txt"]
FILTERED_DIRS = ["include"]
FILTERED_DIRS = ["include", ".git", ".github"]
def _hashPath(path: str, verbose: bool = False) -> str:
@ -161,7 +161,7 @@ from pathlib import Path
from conans.util.files import mkdir, sha256sum
FILTERED_DIRS = ["deps", "__pycache__"]
FILTERED_DIRS = ["deps", "__pycache__", ".git", ".github"]
def configure(source_dir, build_dir):

19
generators/VirtualPythonEnv.py

@ -55,19 +55,18 @@ class VirtualPythonEnv(Generator):
envvars = env.vars(self.conanfile, scope = "run")
if hasattr(self.conanfile, "requirements_txts"):
if self.conanfile.requirements_txts:
if hasattr(self.conanfile.requirements_txts, "__iter__") and not isinstance(self.conanfile.requirements_txts, str):
for req_txt in self.conanfile.requirements_txts:
with envvars.apply():
self.conanfile.run(
f"{python_interpreter} -m pip install -r {os.path.join(self.conanfile.source_folder, req_txt)}",
run_environment = True, env = "conanrun")
else:
if hasattr(self.conanfile, "requirements_txts") and self.conanfile.requirements_txts:
if hasattr(self.conanfile.requirements_txts, "__iter__") and not isinstance(self.conanfile.requirements_txts, str):
for req_txt in self.conanfile.requirements_txts:
with envvars.apply():
self.conanfile.run(
f"{python_interpreter} -m pip install -r {os.path.join(self.conanfile.source_folder, self.conanfile.requirements_txts)}",
f"{python_interpreter} -m pip install -r {os.path.join(self.conanfile.source_folder, req_txt)}",
run_environment = True, env = "conanrun")
else:
with envvars.apply():
self.conanfile.run(
f"{python_interpreter} -m pip install -r {os.path.join(self.conanfile.source_folder, self.conanfile.requirements_txts)}",
run_environment = True, env = "conanrun")
template = Template("""\
deactivate()

Loading…
Cancel
Save