Commit d3b83d0c authored by Linus Pithan's avatar Linus Pithan
Browse files

pin down version in case same version is used in test and specified in the req. file

parent 71e5e6b3
......@@ -9,7 +9,7 @@ based on the currently installed version of a package
"""
# requirements file of the project
req_filepath = "requirements-conda.txt"
req_filepath = "../requirements-conda.txt"
# file generated by 'conda env export > current_env.yml'
# could also be done with subprocess
......@@ -43,7 +43,7 @@ with open(req_filepath) as fp:
# in case there is no version specifier in the requirements
if str(req.specifier) == "":
spec = SpecifierSet("<=" + deps[req.name])
req.specifier = req.specifier & spec
req.specifier = spec
print(str(req))
else:
req_version = Version(str(req.specifier).strip("~=<>"))
......@@ -56,6 +56,6 @@ with open(req_filepath) as fp:
# in case the same version is specified in req. file and used in current env,
else:
spec = SpecifierSet("<=" + deps[req.name])
spec = SpecifierSet("==" + deps[req.name])
req.specifier = spec
print(str(req))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment