-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* enforce requirements in sync * sync LiquidsReflectometer version
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,5 @@ numpy | |
PyQt5 | ||
qtpy | ||
setuptools | ||
lr_reduction@git+https://github.com/neutrons/[email protected].13#egg=lr_reduction | ||
lr_reduction@git+https://github.com/neutrons/[email protected].18#egg=lr_reduction | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# standard imports | ||
import logging | ||
import os | ||
import re | ||
import sys | ||
|
||
script_dir: str = os.path.dirname(os.path.realpath(__file__)) | ||
repo_dir: str = os.path.dirname(script_dir) | ||
|
||
|
||
def check_dependencies_synced(): | ||
r"""Check that the dependencies of environment.yml and requirements.txt are in sync""" | ||
|
||
conda_env = open(os.path.join(repo_dir, "environment.yml"), "r").read() | ||
reqs_env = open(os.path.join(repo_dir, "requirements.txt"), "r").read() | ||
|
||
# check for LiquidsReflectometer versions | ||
lr_conda = re.search(r'LiquidsReflectometer\.git@([^#]+)', conda_env).group(1) | ||
lr_reqs = re.search(r'LiquidsReflectometer\.git@([^#]+)', reqs_env).group(1) | ||
if lr_conda != lr_reqs: | ||
raise RuntimeError("environment.yml and requirements.txt ask different versions of LiquidsReflectometer") | ||
|
||
|
||
if __name__ == "__main__": | ||
try: | ||
check_dependencies_synced() | ||
except RuntimeError as e: | ||
logging.error(f"{e}") | ||
sys.exit(1) | ||
sys.exit(0) |
ca1750b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitLab pipeline for refred-dev has been submitted for this commit: "https://code.ornl.gov/sns-hfir-scse/deployments/conda-legacy-deploy/-/pipelines/536070"