Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Benoit Rousselle
bliss
Commits
d3b83d0c
Commit
d3b83d0c
authored
Mar 18, 2019
by
Linus Pithan
Browse files
pin down version in case same version is used in test and specified in the req. file
parent
71e5e6b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/modify_requirements_add_max_version.py
View file @
d3b83d0c
...
...
@@ -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
))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment