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 support for the project
section (PEP 621)
#9135
base: main
Are you sure you want to change the base?
Conversation
991f3e2
to
198961a
Compare
Deploy preview for website ready! ✅ Preview Built with commit 52b65ac. |
e16fee2
to
a2d9055
Compare
a2d9055
to
a9450c9
Compare
e8593a0
to
163afdd
Compare
After this is released, Poetry can be added to the PyPA packaging tutorial. 🚀 |
48358c6
to
aad680e
Compare
First of all, thank you for the great work! I'm a bit confused by the entire extra business (which is pretty complicated itself), and especially how For this example [project.optional-dependencies]
# ...
dev = ["cython (>=3.0.10,<4.0.0)", "black >= 24"] # added So I go to Suppose I already work with dependencies = [
# ...
"cython[highlight] (>=3.0.10,<4.0.0)"] # added where It looks to me we need a command that "given existing extras
|
c27eb38
to
281fc21
Compare
That's unfortunate but not easy to change as we do not keep track of which extras (of your project) were installed. Furhter, it is not specific to this PR and thereby out of scope here. I suppose there is already an issue about this but I can't find it right now. Feel free to create a new issue. (In case it's a duplicate someone will tell you.)
This conclusion is not correct.
That's expected. See
Both are equivalent.
In the lockfile, only extras of dependencies are fix. All extras of your project are locked and you can/must decide which to install when running
Maybe, you should consider using dependency groups instead of extras. However, dependency groups are only available during development when using Poetry and not visible in the sdist/wheel or to other tools. All in all, there is some room for improvement considering extras but everything that goes beyond my recent change regarding |
281fc21
to
352edf0
Compare
This seems to be working great on our end: meltano/sdk#2407 Even mtkennerly/poetry-dynamic-versioning works smoothly in conjunction with |
Can confirm this works with https://github.com/wandb/openui/blob/main/backend/pyproject.toml 👏 |
Can confirm this works on a fairly complex internal project with a lot of deps. Very nice. We are using |
… poetry-core (python-poetry#9135) - update some pyproject.toml files to avoid deprecation warnings in tests for `poetry check` - add explicit test for deprecation warnings that should be printed when running `poetry check` with a legacy project
…ulating the content hash for the lock file (python-poetry#9135)
- add notes about `dynamic` use cases - deprecate `tool.poetry` fields that can be completely replaced by `project` fields - add hint about `poetry check`
…ndencies` and `tool.poetry.dependencies`, update examples (python-poetry#9135)
…an extra the optional dependency is added to (python-poetry#9135)
Can also confirm this works on a fairly complex internal project with a lot of deps (40 direct deps, 332 total deps) |
I actually encountered one small issue when testing 8f98ee2:
Note UPDATE: on a closer look at the traceback, this actually seems to be caused by Full traceback
|
When I use this patch on this project with this change: @@ -1,4 +1,4 @@
-[tool.poetry]
+[project]
name = "poetry"
version = "1.9.0.dev0"
description = "Python dependency management and packaging made easy." I get $ poetry run ls
The Poetry configuration is invalid:
- project.license must be valid exactly by one definition (0 matches found) |
@hexmode That's because |
- add notes about `dynamic` use cases - deprecate `tool.poetry` fields that can be completely replaced by `project` fields - add hint about `poetry check`
…ndencies` and `tool.poetry.dependencies`, update examples (python-poetry#9135)
…an extra the optional dependency is added to (python-poetry#9135)
Hi, when will we have this feature available in Poetry? I assume this update will be part of Poetry 2.0, but does the team have a rough estimate for the release? I just want to know because I'm building a small package and currently using |
Pull Request Check List
Resolves: #3332
Resolves: python-poetry/roadmap#3
Requires: python-poetry/poetry-core#708
should not be squashed
Current state:
project
section (PEP 621) poetry-core#708check
,lock
,install
,build
,add
,remove
,init
,new
project
fields and use cases fordynamic
(version
,readme
,classifiers
) in the section "The pyproject.toml file".project
fields instead oftool.poetry
fields.You can install this branch with pipx as follows:
This will install Poetry with the suffix "_pep621" so that you have to call
poetry_pep621
instead ofpoetry
. (The suffix is arbitrary, you can choose a different one.)There is no automatic conversion of existing
pyproject.toml
files (yet?) butpoetry check
will give you information which fields should be transferred fromtool.poetry
toproject
.