-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Standard Python support #3290
Comments
This should be pretty straightforward (if one knows ruby, which I don’t). You already have
So you just have to read the TOML lists |
I just got a dependabot PR of my project using pdm! Hope this has been finally accepted 🙂 |
now that setuptools supports PEP621, It would be nice to see this |
I would say to read |
Minor correction: |
I am surprised after finding that dependabot was able to parse a |
Both required and optional dependencies were parsed |
However, when using Flit as the build-system, dependabot did not opened any PR. |
[PEP 621](https://peps.python.org/pep-0621) provides a standardised way for storing project metadata including dependencies declaratively in pyproject.toml, instead of setup.py which is very dynamic. PEP 621 is now [supported by setuptools](https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html). This PR uses project settings in pyproject.toml to configure setuptools to build the sdist and wheel. The built distribution is the same, except the PKG-INFO now includes classifies, keywords, and the full text of the license. NB: pyproject.toml dependencies are not yet supported by renovatebot (see [#10187](renovatebot/renovate#10187)) or dependabot (see [#3290](dependabot/dependabot-core#3290))
It seems that this issue also causes projects moving towards pyproject.toml adoption to lose their list of dependents, unless the name of the project is also repeated in setup.py. See https://github.saobby.my.eu.orgmunity/t/bug-project-not-showing-network-dependents/3161 for examples. |
@jorgepiloto @vnmabus exactly my problem after moving to To be honest, I am surprised that @dependabot doesn’t support such a fundamental and standardized process, and quite concerned that this issue isn’t being addressed. We’re actually now exploring alternatives, e.g. @renovatebot (link). |
Hey, thanks for the pings on this! It's definitely on our radar and we want to support this, but I can't share a timeline as to when we'll be able to ship support for this across both Dependabot and the Dependency Graph. |
I've left some comments on the PR that's about to get merged. #5661 I'm worried that only supporting pins in |
We've shipped preliminary support for updating dependencies following PEP621 in pyproject.toml files with #5661. Of course there may be bugs and missing features, but I'm closing this main issue now and will track any future enhancements as separate issues. Thanks! |
@davidism Why it is bad if libraries pin like that? |
@zhan9san https://iscinumpy.dev/post/bound-version-constraints/ But there's no cause for concern:
|
I just came back here to say THANK YOU @deivid-rodriguez and everyone involved! 🤗 I'm now getting Dependabot upgrades in my projects with |
Thank you for the kind words @tiangolo, we're glad this is turning out useful for your projects 🎉. |
Despite the issue being closed, still wanted to share that the changed needed from the Dependency Graph side has been shipped. |
@annarosenthal, that’s great to hear. But it still says “pyproject.toml has no dependencies or is too large to display” for us. See iterative/dvc for example. Also, does this mean that we can now use |
@annarosenthal Awesome! Are there docs? |
Thanks for flagging. We looked into it and this is caused by a discrepancy in assumptions we made for different/older PEP standards. Apologies about it. However, I filed a bug issue internally asking to update this issue once the fix ships. |
What kind of docs are looking for, in particular? We have this general doc - please let me know what kind of specific questions and/or topics aren't covered there that you still have questions about. |
Hello! From my perspective, I do see one source of confusion, in the Supported package ecosystems section of the About the dependency graph document. The Supported package ecosystems section has a list of supported package managers. For Python, there are two: pip and Python Poetry. Today, the |
I think the idea behind the docs is simply: “we recommend using a lockfile”. I’m not sure why that is – It’s not a good idea to pin versions for Python libraries and for libraries, I rather run tests with the newest version of everything instead of some older lockfile version, because that’s what people get when they install my library.
pip-compile --generate-hashes pyproject.toml --output-file=requirements.txt But as long as dependabot recommends lockfiles, and Python doesn’t have a standard lockfile format, it makes sense to say “we recommend using Maybe the whole segment should be reworded to be more clear.
|
That helps, thanks! |
👋 Hi folks -- with the latest changelog you should be seeing the expected dependencies from your Thank you for your feedback on the docs! I'll share it with the docs team. |
I may be in a small minority doing this, but we only use When a dependency gets bumped I'm seeing Dependabot PRs that update the
Yes, I guess I could change my workflow to use poetry for the install (though I think there's potentially a bootstrapping problem there). But it would also be nice if Dependabot could just keep Examples: A Dependabot PR that modifies |
Does this mean we can remove the stub setup.py from project using poetry? Will this also for PDM? 😊 |
There’s exactly two standard ways of specifying dependencies, none of which dependabot supports.
PEP 517’s
prepare_metadata_for_build_wheel()
.The legacy way to specify Python dependencies is
requirements.txt
. The standard way is having a PEP 517 build system configured. That build system can optionally define a function calledprepare_metadata_for_build_wheel
. If that function exists, the dependencies can be obtained (from the metadata) without building a wheel, otherwisebuild_wheel()
needs to be called.Code to just do the above would look like:
PEP 631 a new standardized way to specify dependencies in a Python project (now merged into PEP 621).
It’s supported by
flit
and a bunch of other new build backends. So if you want to continue your (incomplete) way of just parsing files and not calling into Python, this needs to be supported.The text was updated successfully, but these errors were encountered: