-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 regex safe constraints path #57
Conversation
4855213
to
a58bc9b
Compare
😠 This test fixture doesn't seem to be working on the Windows tests hatch-pip-compile/tests/conftest.py Lines 167 to 172 in 2559a6e
https://github.com/juftin/hatch-pip-compile/actions/runs/7450650936/job/20270034562 EDIT: Actually, this looks like it's happening outside of the tests 🤔 |
@@ -54,7 +54,7 @@ def process_lock(self, lockfile: pathlib.Path) -> None: | |||
) | |||
if self.constraints_file is not None: | |||
constraint_sha = hashlib.sha256(self.constraints_file.read_bytes()).hexdigest() | |||
constraints_path = self.constraints_file.relative_to(self.project_root) | |||
constraints_path = self.constraints_file.relative_to(self.project_root).as_posix() | |||
constraints_line = f"# [constraints] {constraints_path} (SHA256: {constraint_sha})" | |||
joined_dependencies = "\n".join([constraints_line, "#", joined_dependencies]) | |||
cleaned_input_file = re.sub( |
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.
This is what I was referring to, I think it should work
- f"-c {constraints_path}",
+ lambda m: f"-c {constraints_path}",
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.
Thanks for clarifying that here, I will test it out. I appreciate the help on this, RegEx is my developer kryptonite.
.github/workflows/tests.yaml
Outdated
- { | ||
name: Hatch-Windows, | ||
python: "3.11", | ||
command: "matrix:cov", | ||
matrix: "+py=3.11", | ||
hatch_version: "1.0", | ||
os: windows-latest, | ||
} |
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.
This testing matrix is actually kind of problematic. See https://github.com/juftin/hatch-pip-compile/actions/runs/7450650936/job/20270034562
It looks like changing between Linux and Windows makes hatch-pip-compile
try to recreate the lockfile.
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.
For some reason when running in Windows lockfile_up_to_date
is False but lockfile_up_to_date
is True when run on Linux.
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.
# [v1.9.1](v1.9.0...v1.9.1) (2024-01-09) ## 🐛 Bug Fixes - [`9924e1f`](9924e1f) regex safe constraints path (Issues: [`#57`](#57)) [skip ci]
🎉 This PR is included in version 1.9.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Closes #56