Skip to content

Update pyproject.toml in line with Poetry 2.x #18432

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

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

anoadragon453
Copy link
Member

@anoadragon453 anoadragon453 commented May 12, 2025

Our pyproject.toml was generating a number of errors in our CI. This appears to be a follow-on from #18251. I noticed this when debugging an unrelated PR.

Click to see error log
Run echo "dir=$(python -m poetry env info -p || echo $(pwd)/.venv)" >> "$GITHUB_OUTPUT"
The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead.
Run actions/cache@v3
Cache not found for input keys: poetry-venv-Linux-3.13.3-75a3531907848fcb5135e329bb1b67981e783f587bd06c529d75259b473c2d49-
Run poetry check --lock
The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead.
Error: pyproject.toml changed significantly since poetry.lock was last generated. Run `poetry lock` to fix the lock file.
Warning: The "poetry.dev-dependencies" section is deprecated and will be removed in a future version. Use "poetry.group.dev.dependencies" instead.
Warning: [tool.poetry.name] is deprecated. Use [project.name] instead.
Warning: [tool.poetry.version] is set but 'version' is not in [project.dynamic]. If it is static use [project.version]. If it is dynamic, add 'version' to [project.dynamic].
If you want to set the version dynamically via `poetry build --local-version` or you are using a plugin, which sets the version dynamically, you should define the version in [tool.poetry] and add 'version' to [project.dynamic].
Warning: [tool.poetry.description] is deprecated. Use [project.description] instead.
Warning: [tool.poetry.readme] is set but 'readme' is not in [project.dynamic]. If it is static use [project.readme]. If it is dynamic, add 'readme' to [project.dynamic].
If you want to define multiple readmes, you should define them in [tool.poetry] and add 'readme' to [project.dynamic].
Warning: [tool.poetry.license] is deprecated. Use [project.license] instead.
Warning: [tool.poetry.authors] is deprecated. Use [project.authors] instead.
Warning: [tool.poetry.classifiers] is set but 'classifiers' is not in [project.dynamic]. If it is static use [project.classifiers]. If it is dynamic, add 'classifiers' to [project.dynamic].
ATTENTION: Per default Poetry determines classifiers for supported Python versions and license automatically. If you define classifiers in [project], you disable the automatic enrichment. In other words, you have to define all classifiers manually. If you want to use Poetry's automatic enrichment of classifiers, you should define them in [tool.poetry] and add 'classifiers' to [project.dynamic].
Warning: [tool.poetry.repository] is deprecated. Use [project.urls] instead.
Warning: [tool.poetry.extras] is deprecated. Use [project.optional-dependencies] instead.
Warning: Defining console scripts in [tool.poetry.scripts] is deprecated. Use [project.scripts] instead. ([tool.poetry.scripts] should only be used for scripts of type 'file').

Original GHA workflow run logs: https://github.com/element-hq/synapse/actions/runs/14931031372/job/41947086455?pr=18417#step:3:67

This PR fixes those issues by updating our pyproject.toml file to make use of the new keys defined by PEP 621.

Paired with matrix-org/sytest#1403 which updates poetry-core to 2.1.3 in Sytest.

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct
    (run the linters)

@anoadragon453 anoadragon453 marked this pull request as ready for review May 12, 2025 16:52
@anoadragon453 anoadragon453 requested a review from a team as a code owner May 12, 2025 16:52
@anoadragon453 anoadragon453 changed the title Update pyproject.toml according to Poetry documentation Update pyproject.toml in line with Poetry 2.x May 12, 2025
@anoadragon453 anoadragon453 force-pushed the anoa/update_pyproject branch 4 times, most recently from a1a8610 to 7564524 Compare May 12, 2025 18:40
@anoadragon453 anoadragon453 marked this pull request as draft May 13, 2025 11:54
@anoadragon453 anoadragon453 force-pushed the anoa/update_pyproject branch from d276294 to 830e54d Compare May 13, 2025 11:59
anoadragon453 added a commit to matrix-org/sytest that referenced this pull request May 13, 2025
If we're only defining static classifiers, then they should live under
`project` instead of `tool.poetry`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant