Repository navigation
Fix parsed requirement equality. #3341
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
Open
jsirois
wants to merge
7
commits into
pex-tool:main
Choose a base branch
from
jsirois:issues/3333
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+100
−24
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
69d5239
Add a failing IT.
jsirois bd1ec01
Fix parsed requirement equality.
jsirois b44b6aa
Prepare a release.
jsirois b1b1b94
Fix unrelated test impacted by packaging 26.4.
jsirois badc29e
Fix test.
jsirois 7277f28
Merge branch 'pex-tool:main' into issues/3333
jsirois bb5a728
Fix `test_resolve_python_requires_full_version`.
jsirois File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # Copyright 2015 Pex project contributors. | ||
| # Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
|
||
| __version__ = "2.107.3" | ||
| __version__ = "2.107.4" |
This file contains hidden or 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,74 @@ | ||
| # Copyright 2026 Pex project contributors. | ||
| # Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
|
||
| from __future__ import absolute_import, print_function | ||
|
|
||
| from pex.typing import TYPE_CHECKING | ||
| from testing import PY311, ensure_python_interpreter | ||
| from testing.cli import run_pex3 | ||
| from testing.pytest_utils.tmp import Tempdir | ||
|
|
||
| if TYPE_CHECKING: | ||
| from typing import List | ||
|
|
||
|
|
||
| ORIGINAL_REQUIREMENTS = [ | ||
| 'six==1.16.0; sys_platform == "linux"', | ||
| 'six==1.17.0; sys_platform == "darwin"', | ||
| "psycopg-binary==3.2.4", | ||
| ] | ||
| UPDATED_REQUIREMENTS = [ | ||
| 'six==1.16.0; sys_platform == "linux"', | ||
| 'six==1.17.0; sys_platform == "darwin"', | ||
| "psycopg-binary==3.2.5", | ||
| ] | ||
|
|
||
|
|
||
| def assert_sync( | ||
| tmpdir, # type: Tempdir | ||
| original_requirements_args, # type: List[str] | ||
| updated_requirements_args, # type: List[str] | ||
| ): | ||
| # type: (...) -> None | ||
|
|
||
| py311 = ensure_python_interpreter(PY311) | ||
| lock_file = tmpdir.join("lock.json") | ||
|
|
||
| common_args = [ | ||
| "--style", | ||
| "universal", | ||
| "--interpreter-constraint", | ||
| "==3.11.*", | ||
| "--target-system", | ||
| "linux", | ||
| "--target-system", | ||
| "mac", | ||
| "--indent", | ||
| "2", | ||
| ] | ||
|
|
||
| create_args = ["lock", "create", "-o", lock_file] + common_args + original_requirements_args | ||
| run_pex3(*create_args, python=py311).assert_success() | ||
|
|
||
| sync_args = ["lock", "sync", "--lock", lock_file] + common_args + updated_requirements_args | ||
| run_pex3(*sync_args, python=py311).assert_success() | ||
|
|
||
|
|
||
| def test_sync_via_positional_requirements(tmpdir): | ||
| # type: (Tempdir) -> None | ||
|
|
||
| assert_sync(tmpdir, ORIGINAL_REQUIREMENTS, UPDATED_REQUIREMENTS) | ||
|
|
||
|
|
||
| def test_sync_via_requirements_files(tmpdir): | ||
| # type: (Tempdir) -> None | ||
|
|
||
| with open(tmpdir.join("before.txt"), "w") as before_fp: | ||
| for req in ORIGINAL_REQUIREMENTS: | ||
| print(req, file=before_fp) | ||
|
|
||
| with open(tmpdir.join("after.txt"), "w") as after_fp: | ||
| for req in UPDATED_REQUIREMENTS: | ||
| print(req, file=after_fp) | ||
|
|
||
| assert_sync(tmpdir, ["-r", before_fp.name], ["-r", after_fp.name]) | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
N.B.:
test_sync_via_positional_requirementspassed before the fix, buttest_sync_via_requirements_filesfailed here similar to the OP issue with: