Initial work on standard Python support for pyproject.toml files#5661
Initial work on standard Python support for pyproject.toml files#5661deivid-rodriguez merged 10 commits intomainfrom
pyproject.toml files#5661Conversation
accbd0c to
eaddce8
Compare
954e0d6 to
874e35c
Compare
|
I'd be curious if this can handle something as complex as |
mctofu
left a comment
There was a problem hiding this comment.
I know very little about Poetry or pep621 but I gave this a first pass. Nice job keeping these changes to a minimum!
Is there any test coverage for doing a standard python update? I see from the PR description that it can perform updates but I'm not seeing an added test case for the updater. It'd be great to have one (or more) if it's not there!
Also, is there anything else missing besides the optional-dependencies? Would we want to feature flag this till we have more complete or tested support?
|
Thanks for having a look @mctofu!
That's the one task I had pending before considering this PR finished, I will add those soon :)
We could also potentially support updating build dependencies. See this comment for useful links. But that sounds much trickier and I'm not sure how many people would find it useful, so I would not add support for now. Regarding feature flagging this, I'm not sure. It seems a simple update but it's true that Dependabot will start considering many files it didn't consider before so maybe it makes sense, yeah. |
a485486 to
3a8bddb
Compare
|
I'm finding a few more things missing, so I'll recap those here. I believe all of them are suitable for follow up work, and not necessarily need to block this PR.
|
|
It seems like the focus is on For example, pip-tools separates For pyproject.toml based tools, I'd expect the same thing: the pyproject file is the template with constraints, and tools generate a lock file with specific versions that I'd want bumped. For example, PDM generates |
3a8bddb to
ea1ad25
Compare
|
@davidism The behavior you're suggesting is implemented by the I'm now satisfied with this PR, by the way! 😄 |
|
I'm worried that only supporting pins in |
Dependabot does not encourage any way of handling dependencies, it respects what users are already doing, and just tries to help them keep things up to date. So it will only use pins in
This is just a first iteration, we will be happy to add support for lock file formats using standard Python in the future. |
|
I'm worried that users seeing that Dependabot supports pins in the file will encourage users to put pins there, not that Dependabot will put them there itself. Basically, supporting this will mean that more people use it, when it's probably not the best practice to encourage. |
|
How will users "see" that we support pins, if they are not already using pins? I'm not following your logic of how Dependabot will encourage a bad thing here. |
|
Presumably by seeing an announcement that Dependabot supports pins in pyproject.toml, or reading the Dependabot documentation about what pins it supports. |
I don't think we should explicitly announce or document that we support pins in Also, by "pins", do you mean "full pins" (like In any case, I'm pretty sure that library authors fully pinning their dependencies are going to find out how that's bad the hard way, regardless of Dependabot 😅. |
ea1ad25 to
af36126
Compare
94ef960 to
97c9500
Compare
97c9500 to
d140db7
Compare
|
Everyone is excited for this 😄 |
It's no longer used since 2115484.
It's unused since it was first introduced at 65ee6f8, since it's duplicated in `PoetryFilesParser`.
To make room for standard python specs and clarify what fixture manifests test.
Reuse the same logic used for detecting poetry libraries. Also for consistency, since standard Python does not have a caret operator, change existing poetry update checker specs to use the tilde operator instead, which is also implemented in standard python.
d140db7 to
df42850
Compare
|
Alright let's do this! 🎢 |
pyproject.toml files
This adds initial support for
pyproject.tomlfiles.Dependabot will be able to parse
[project]dependenciesand provide version and security updates., but will not yet be able to parseEDIT: We also added support for updating dependencies under[project.optional-dependencies].[project.optional-dependencies].Since poetry can also uses pyproject.toml files, this also support parsing poetry dependencies. Using poetry's version constraint syntax was added in #5735
Here's an example PR generated with the `standard_python.toml` file
Pull Request Title: Bump ansys-templates from 0.3.0 to 0.3.1
Bumps ansys-templates from 0.3.0 to 0.3.1.
Commits
5175dd8Bump 0.3.1 version