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
Add basic poetry support #12
Conversation
pip_check_updates/__init__.py
Outdated
for key, val in dependencies: | ||
if key == 'python': | ||
continue | ||
|
||
if type(val) is str: | ||
if val == "*": | ||
continue | ||
results.append(f"{key}=={val}") |
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.
in a pyproject.toml
file, see example
the val
can be a string or dict-like object. I think the logic in load_pipfile
still applies.
I would remove checking the python
as a key since this can be done in the pcufile
config.
According to the example aforementioned, we should add the caret in the get_current_version()
function so that it can handle splitting the dependency name and version string.
name, current_version = [token for token in re.split(r"[><=~!]", dep) if token]
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.
Hi @zehengl thanks for looking at my PR so fast. I tried to address your comments. Do they look ok to you? I left in the filtering of python
dependency, since it's something all poetry pyproject.toml
s have.
Do you want me to add a few tests with actual requirements files too?
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 changes. LGTM 👍
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.
BTW, feel free to add tests on a different PR. That's also on my todo list but I don't have time to work on it yet. Appreciate your contribution!
Poetry version specifiers can be either strings or a dicts with key version inside.
@all-contributors please add @nikolaik for code |
I've put up a pull request to add @nikolaik! 🎉 |
This builds on the Pipfile checking support and adapts it to support poetry dependencies in
pyproject.toml
.I manage projects using a mix of different package management tools pip (
requirements.txt
), pipenv and poetry, so having one tool to support them all would be a time saver for me.