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

Poetry version support #1556

Open
ulgens opened this issue Dec 4, 2019 · 44 comments
Open

Poetry version support #1556

ulgens opened this issue Dec 4, 2019 · 44 comments
Labels
F: language-support Issues specific to a particular language or ecosystem; may be paired with an L: label. Keep Exempt this from being marked by stalebot L: python:poetry Python packages via poetry T: feature-request Requests for new features versioning

Comments

@ulgens
Copy link
Contributor

ulgens commented Dec 4, 2019

Dependabot supports Poetry but it doesn't use given version in pyproject.toml file. When i use any version newer than 1.0.0a1, update check fails because of changed lock file syntax.

@rebelagentm rebelagentm added L: python:poetry Python packages via poetry T: feature-request Requests for new features labels Dec 4, 2019
@tommilligan
Copy link
Contributor

Would also be interested in this. Just upgraded to the newly released poetry v1 and getting the error:

updater | ERROR <job_17789943> Error processing tld (Dependabot::SharedHelpers::HelperSubprocessFailed)
updater | ERROR <job_17789943>                                   
updater | <job_17789943> [NonExistentKey]   
updater | <job_17789943> 'Key "hashes" does not exist.'  
updater | <job_17789943>                                   
updater | <job_17789943> update [--no-dev] [--dry-run] [--lock] [--] [<packages>]...
updater | <job_17789943> 

@sobolevn
Copy link
Contributor

sobolevn commented Dec 18, 2019

I am all in for this change!

Repo that has this problem: https://github.com/wemake-services/wemake-python-styleguide/blob/master/pyproject.toml

Poetry version is specified in the build file:

[build-system]
requires = ["poetry>=1.0"]
build-backend = "poetry.masonry.api"

But, it does not work. What website says:
Снимок экрана 2019-12-18 в 11 27 18

Logs:

updater | ERROR <job_18040832> Error processing astboom (Dependabot::SharedHelpers::HelperSubprocessFailed)
updater | ERROR <job_18040832>                                   
updater | <job_18040832> [NonExistentKey]   
updater | <job_18040832> 'Key "hashes" does not exist.'  
updater | <job_18040832>                                   
updater | <job_18040832> update [--no-dev] [--dry-run] [--lock] [--] [<packages>]...
updater | <job_18040832> 
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-python-0.113.28/lib/dependabot/python/update_checker/poetry_version_resolver.rb:319:in `run_poetry_command'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-python-0.113.28/lib/dependabot/python/update_checker/poetry_version_resolver.rb:85:in `block (2 levels) in fetch_latest_resolvable_version_string'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-common-0.113.28/lib/dependabot/shared_helpers.rb:143:in `with_git_configured'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-python-0.113.28/lib/dependabot/python/update_checker/poetry_version_resolver.rb:73:in `block in fetch_latest_resolvable_version_string'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-common-0.113.28/lib/dependabot/shared_helpers.rb:37:in `block (2 levels) in in_a_temporary_directory'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-common-0.113.28/lib/dependabot/shared_helpers.rb:37:in `chdir'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-common-0.113.28/lib/dependabot/shared_helpers.rb:37:in `block in in_a_temporary_directory'
updater | ERROR <job_18040832> /usr/lib/ruby/2.6.0/tmpdir.rb:93:in `mktmpdir'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-common-0.113.28/lib/dependabot/shared_helpers.rb:34:in `in_a_temporary_directory'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-python-0.113.28/lib/dependabot/python/update_checker/poetry_version_resolver.rb:72:in `fetch_latest_resolvable_version_string'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-python-0.113.28/lib/dependabot/python/update_checker/poetry_version_resolver.rb:42:in `latest_resolvable_version'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-python-0.113.28/lib/dependabot/python/update_checker.rb:43:in `latest_resolvable_version'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-common-0.113.28/lib/dependabot/update_checkers/base.rb:70:in `preferred_resolvable_version'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-common-0.113.28/lib/dependabot/update_checkers/base.rb:233:in `preferred_version_resolvable_with_unlock?'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-common-0.113.28/lib/dependabot/update_checkers/base.rb:225:in `numeric_version_can_update?'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-common-0.113.28/lib/dependabot/update_checkers/base.rb:175:in `version_can_update?'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/vendor/ruby/2.6.0/gems/dependabot-common-0.113.28/lib/dependabot/update_checkers/base.rb:38:in `can_update?'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/lib/dependabot/updater.rb:208:in `requirements_to_unlock'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/lib/dependabot/updater.rb:159:in `check_and_create_pull_request'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/lib/dependabot/updater.rb:62:in `check_and_create_pr_with_error_handling'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/lib/dependabot/updater.rb:48:in `block in run'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/lib/dependabot/updater.rb:48:in `each'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/lib/dependabot/updater.rb:48:in `run'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/lib/dependabot/update_files_job.rb:16:in `perform_job'
updater | ERROR <job_18040832> /home/dependabot/dependabot-updater/lib/dependabot/base_job.rb:29:in `run'
updater | ERROR <job_18040832> bin/update_files.rb:21:in `<main>'

In case making a support for several versions is a hard thing, then I suggest to drop [email protected] support in favour of [email protected] support. Because update process is easy for developers.

@sobolevn
Copy link
Contributor

At this point I have upgraded almost all my packages to [email protected] and dependabot almost stoped working to me 😞

@m-aciek
Copy link

m-aciek commented Jan 8, 2020

Related pull requests: #1571, #1623, #1624. Related issue on feedback repo: https://github.com/dependabot/feedback/issues/798.

@gabor-boros
Copy link

Any update on this?

@cjolowicz
Copy link

The automated pull request for Poetry 1.0.3 is here: #1667

gtramontina added a commit to gtramontina/docker-diagrams that referenced this issue Feb 16, 2020
Note: this is supposed to be working automatically with dependabot, but
there's an outstanding issue yet to be resolved at dependabot/dependabot-core#1556
Hopefully this gets resolved soon.
@ulgens
Copy link
Contributor Author

ulgens commented Mar 14, 2020

#1710

Does anyone have any idea why this test fails?

Tests are failing because dependabot can't parse new lock file format. Any Ruby developers to help with it? 🤕

@sobolevn
Copy link
Contributor

dependendabot is not working for me for almost 4 month now. Sadly, but there's nothing I can do about it.

@tommilligan
Copy link
Contributor

@ulgens I've submitted PR #1739, which fixes the failing tests you mentioned. The fix is only in the tests themselves, so hopefully should be a quick review.

@tetienne
Copy link

Issue is now solved.

@sobolevn
Copy link
Contributor

Not fully. There are several issues:

  1. I got a lot of spam like this: https://github.com/wemake-services/wemake-python-styleguide/issues?q=is%3Aissue+author%3Aapp%2Fdependabot-preview+is%3Aclosed
  2. Every dependency update has merge conflicts. Because of the [metadata].content-hash field: https://github.com/wemake-services/wemake-python-styleguide/pull/1287/files#diff-41fe8bebc1a2a52eb5321b759e40b3a8R1627 Now all merge must be done like: merge first -> rebase second -> merge second. I guess it is a problem with poetry. Here's the upstream issue: Make the lock file more merge-friendly python-poetry/poetry#496

There's a workaround for the second problem: https://pypi.org/project/poetry-merge-lock/

@sobolevn
Copy link
Contributor

Also dependabot cannot update my deps, here's what it says: wemake-services/wemake-python-styleguide#1286 (comment)

gtramontina added a commit to gtramontina/docker-diagrams that referenced this issue Apr 21, 2020
Note: this is supposed to be working automatically with dependabot, but
there's an outstanding issue yet to be resolved at dependabot/dependabot-core#1556
Hopefully this gets resolved soon.
@donbowman
Copy link

Not fully. There are several issues:

  1. I got a lot of spam like this: https://github.com/wemake-services/wemake-python-styleguide/issues?q=is%3Aissue+author%3Aapp%2Fdependabot-preview+is%3Aclosed
  2. Every dependency update has merge conflicts. Because of the [metadata].content-hash field: https://github.com/wemake-services/wemake-python-styleguide/pull/1287/files#diff-41fe8bebc1a2a52eb5321b759e40b3a8R1627 Now all merge must be done like: merge first -> rebase second -> merge second. I guess it is a problem with poetry. Here's the upstream issue: python-poetry/poetry#496

There's a workaround for the second problem: https://pypi.org/project/poetry-merge-lock/

python-poetry/poetry#2654 is my PR to poetry to try and resolve this issue upstream. It seeks to make content-hash omitted, so no merge conflict.

@infin8x infin8x added the F: language-support Issues specific to a particular language or ecosystem; may be paired with an L: label. label Jul 20, 2020
@chbndrhnns
Copy link

https://pypi.org/project/poetry-merge-lock/ seems archived now.
Are other known workarounds to this issue?

@cjolowicz
Copy link

@chbndrhnns These days I use a small shell script with these commands:

git restore --worktree --staged poetry.lock
poetry lock --no-update
git add poetry.lock

See this comment for more details.

jtpavlock added a commit to MoeMusic/Moe that referenced this issue Jul 12, 2021
Some annoyances & errors, doesn't seem like poetry support is fully developed.

dependabot/dependabot-core#1556
jtpavlock added a commit to MoeMusic/Moe that referenced this issue Jul 12, 2021
Some annoyances & errors, doesn't seem like poetry support is fully developed.

dependabot/dependabot-core#1556
@tianhuil
Copy link

tianhuil commented Apr 1, 2023

Any updates here?

@larsakerson
Copy link

Any updates here? Dependabot's commits aren't honoring the python patch version specified in pyproject.toml. They consistently replace it in poetry.lock with a tilde version specification, causing build failures.

@denys-marichev-sumup
Copy link

denys-marichev-sumup commented Jun 5, 2023

Any updates here? Dependabot's commits aren't honoring the python patch version specified in pyproject.toml. They consistently replace it in poetry.lock with a tilde version specification, causing build failures.

Same problem 🥲

In my pyproject.toml file:

[tool.poetry.dependencies]
python = "3.9.16"

And Dependabot is always trying to replace the line python-versions = "3.9.16" with python-versions = "~3.9" in poetry.lock file 😟

@jeffwidman
Copy link
Member

☝️ sounds like a specific bug that isn't related to this general thread of "support multiple versions of poetry/poetry.lock"...

Can you spin that off as a specific issue? I can't guarantee that we'll get to it (in fact a PR would be most welcome!) but it should be a lot more tractable to say "retain specific python pin from pyproject.toml to poetry.lock than it is to say "run with my desired poetry version"... because we should be retaining specific python pins no matter whether we stick with a single poetry version or mutliple.

@cedric-spinergie
Copy link

Hello!
My team and I just stumbled upon this but in the opposite direction: we need to stay on poetry 1.5.1 while the one used by dependabot is 1.8.3.

Would a "quickfix" like specifying the poetry version inside the dependabot.yml be feasible? Or maybe some place else like in the pyproject.toml.

@saada
Copy link

saada commented Jan 16, 2025

Even when using 1.8.3, we started getting 1.8.5 changes. I'm assuming dependabot just bumped their version again

@ulgens
Copy link
Contributor Author

ulgens commented Jan 22, 2025

It's been 5 years, and the same issue happens between 1.8.5 and 2.0.1 now. Therhas e been a major version update and the lock file has a new version now. Github tries to revert it with each Dependabot run.

@OldSneerJaw
Copy link

Our build process requires the poetry export command, but it has been moved into an optional dependency in Poetry v2 (see here). There is a new tool.poetry.requires-plugins config option in v2 that lets you set your project's Poetry plugins declaratively, but because Dependabot still uses Poetry 1.8, it considers the configuration file invalid. The solution is to add plugins imperatively (instructions), but that's a nuisance because every user that needs to run that command now has to manually install the plugin.

@d33bs
Copy link

d33bs commented Feb 19, 2025

Just a bump to mention I ran into the same as above; using Poetry 2.x configurations (with requires-plugins config) causes Dependabot to fail. Hoping we can get a fix for this, thanks in advance!

@d33bs
Copy link

d33bs commented Feb 20, 2025

This issue could possibly be closed through #11642 (and more specific issues moving forward).

@ulgens
Copy link
Contributor Author

ulgens commented Feb 20, 2025

@d33bs Issues like #11642 solves a different problem. Having the latest version active is important, but now there won't be a chance to use a pre-v2.0.0 version with Github and the projects that are stuck with a later version won't be able to use dependabot.

@edgarrmondragon
Copy link
Contributor

At least starting with Poetry 2, dependabot should be able to use requires-poetry if available to install a custom Poetry version.

@ulgens
Copy link
Contributor Author

ulgens commented Feb 20, 2025

@edgarrmondragon I'm not sure that parameter installs a custom Poetry version. AFAIK, it only raises an error if the requirement is not met.

@edgarrmondragon
Copy link
Contributor

@edgarrmondragon I'm not sure that parameter installs a custom Poetry version. AFAIK, it only raises an error if the requirement is not met.

I know, but Dependabot could use that constraint to install at runtime a Poetry version the project supports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: language-support Issues specific to a particular language or ecosystem; may be paired with an L: label. Keep Exempt this from being marked by stalebot L: python:poetry Python packages via poetry T: feature-request Requests for new features versioning
Projects
Status: Planned
Development

No branches or pull requests