Skip to content
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

refactor dependency specification parsing logic #5554

Merged

Conversation

abn
Copy link
Member

@abn abn commented May 6, 2022

This change moves, cleans up and refactors dependency specification parsing logic from InitCommand to poetry.utils.dependency_specification. This is done to improve usability and maintainability of this logic.

This has been bugging me for a while now, so decided to clean it up a bit.

Additionally, with this change, users can now add dependencies using valid PEP 508 strings.

$ poetry add 'cachecontrol[filecache] (>=0.12.9,<0.13.0); python_version >= "3.6"' --lock

Updating dependencies
Resolving dependencies... (0.5s)

Writing lock file
$ cat pyproject.toml | grep -i cachecontrol
CacheControl = {version = ">=0.12.9,<0.13.0", markers = "python_version >= \"3.6\"", extras = ["filecache"]}

abn added 2 commits May 7, 2022 17:33
This change moves, cleans up and refactors dependency specification
parsing logic from `InitCommand` to
`poetry.utils.dependency_specification`. This is done to improve
usability and maintainability of this logic.
With this change, users can now add dependencies using valid PEP 508
strings.
@abn abn force-pushed the refactor-init-parse-requirements branch from cb05e08 to 49dda75 Compare May 7, 2022 15:41
Copy link
Member

@neersighted neersighted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a whole lot cleaner and easier to read -- nice work!

@neersighted neersighted merged commit 73a6dbe into python-poetry:master May 7, 2022
@abn abn deleted the refactor-init-parse-requirements branch May 7, 2022 16:26
@abn abn mentioned this pull request Jun 6, 2022
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants