Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
(#1254) Fix issue with nexgen semantic versioning constraint causing …
Browse files Browse the repository at this point in the history
…prerelease workflow to fail
  • Loading branch information
rtuck99 committed Mar 13, 2024
1 parent 77b9234 commit 021c107
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pin_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from sys import stderr, stdout

SETUP_CFG_PATTERN = re.compile("(.*?)\\s*(@(.*))?\n")
SETUP_UNPINNED_PATTERN = re.compile("(.*?)\\s*([<>=]+(.*))?\n")
PIP = "pip"


Expand Down Expand Up @@ -77,7 +78,7 @@ def write_with_comment(comment, text, output_file):

def update_setup_cfg_line(version_map: dict[str, str], line, output_file):
stripped_line, comment = strip_comment(line)
if match := SETUP_CFG_PATTERN.match(stripped_line):
if match := SETUP_UNPINNED_PATTERN.match(stripped_line):
normalized_name = normalize(match[1].strip())
if normalized_name not in version_map:
stderr.write(
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_data/pip_freeze.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ mypy==1.8.0
mypy-extensions==1.0.0
mysql-connector-python==8.3.0
networkx==3.2.1
nexgen==0.8.0
nexgen==0.8.4
nodeenv==1.8.0
nose2==0.14.0
nslsii==0.9.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_data/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ install_requires =
ispyb
scanspec
numpy
nexgen @ git+https://github.com/dials/nexgen.git@db4858f6d91a3d07c6c0f815ef752849c0bf79d4
nexgen>0.8.3
opentelemetry-distro
opentelemetry-exporter-jaeger
ophyd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_data/setup.cfg.pinned
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ install_requires =
ispyb @ 10.0.0
scanspec @ 0.6.5
numpy @ 1.26.3
nexgen @ 0.8.0
nexgen @ 0.8.4
opentelemetry-distro @ 0.43b0
opentelemetry-exporter-jaeger @ 1.21.0
ophyd @ 1.9.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_data/setup.cfg.unpinned
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ install_requires =
ispyb
scanspec
numpy
nexgen
nexgen>0.8.3
opentelemetry-distro
opentelemetry-exporter-jaeger
ophyd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_pin_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_write_commit_message(mock_stdout, patched_run_pip_freeze):
installed_versions = pin_versions.fetch_pin_versions()
pin_versions.write_commit_message(installed_versions)
mock_stdout.write.assert_called_once_with(
"Pin dependencies prior to release. Dodal 1.13.1, nexgen 0.8.0"
"Pin dependencies prior to release. Dodal 1.13.1, nexgen 0.8.4"
)


Expand Down

0 comments on commit 021c107

Please sign in to comment.