-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Dependency groups #4260
Dependency groups #4260
Conversation
2d453e0
to
60159be
Compare
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
not_found = set(packages).difference(removed) | ||
if not_found: | ||
raise ValueError( | ||
"The following packages were not found: {}".format( |
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.
"The following packages were not found: {}".format( | |
f"The following packages were not found: {', '.join(sorted(not_found))}" |
""" | ||
Removing without specifying a group removes packages from all groups. | ||
""" | ||
installed.add_package(Package("foo", "2.0.0")) |
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.
What do you think about maybe creating constants for the strings baz
, foo
, 1.0.0
, and 2.0.0
, since they are repeated so often?
If you agree, you will need to change the other test files that use these same values.
installer.with_groups(["dev"]) | ||
installer.run() | ||
|
||
assert 0 == installer.executor.installations_count |
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.
Maybe create a constant for the value 0
?
@@ -86,7 +86,7 @@ def test_lock_file_data_is_ordered(locker, root): | |||
[metadata] | |||
lock-version = "1.1" | |||
python-versions = "*" | |||
content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8" | |||
content-hash = "178f2cd01dc40e96be23a4a0ae1094816626346346618335e5ff4f0b2c0c5831" |
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.
It would be interesting to create a constant for content-hash
. Here we see an example that if it had a constant, it would not be necessary to make 7 changes to the same value.
60159be
to
5c5af42
Compare
Poetry first switched from dev dependencies [to dependency groups](python-poetry/poetry#4260) in version [1.2.0a2](https://github.com/python-poetry/poetry/blob/master/CHANGELOG.md#120a2---2021-08-01). The dev dependencies are currently deprecated and will be removed at some point, so this change switches to the new groups configuration. For more information about dependency groups, see [the section in the official documentation](https://python-poetry.org/docs/master/managing-dependencies#dependency-groups).
Poetry 1.2+ includes a new organization for dev dependencies. This patch checks both locations, starting with the pre-1.2 location. Ref: python-poetry/poetry#4260 Closes: #1
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This PR adds support for dependency groups to have a more granular organization of dependencies.
For a complete list of changes and improvements you can refer to the updated documentation in this PR.
Pull Request Check List
Resolves: #1644