Skip to content

[python] Fix poetry deprecation warnings #21268

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

Merged
merged 6 commits into from
May 25, 2025

Conversation

4c0n
Copy link
Contributor

@4c0n 4c0n commented May 12, 2025

Since the release of Poetry 2.0.0 the format of pyproject.toml that it is expecting changed.
See also: https://python-poetry.org/blog/announcing-poetry-2.0.0

This PR aims to update the pyproject.toml file to a format that does not use (now) deprecated features introduced by Poetry 1.

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request. (@cbornet @tomplus @krjakbrjak @fa0311 @multani)

@wing328
Copy link
Member

wing328 commented May 13, 2025

thanks for the pr

is the change backward compatible with poetry 1.x?

@4c0n
Copy link
Contributor Author

4c0n commented May 13, 2025

thanks for the pr

is the change backward compatible with poetry 1.x?

Hi @wing328, It is not backwards compatible with Poetry 1.x.
We haven't seen a 1.x release since December 6, 2024 and there has not been active development on 1.x since the release of 2.0, which has seen regular releases since: https://github.com/python-poetry/poetry/releases

That is also why I added this line: https://github.com/4c0n/openapi-generator/blob/b554c1bc3adc621f144c46112b6a00a526e59246/modules/openapi-generator/src/main/resources/python/pyproject.mustache#L32

If people are still using 1.x I'd say it's about time to upgrade or use an older version of the generator as well😄.

@wing328
Copy link
Member

wing328 commented May 13, 2025

for the upcoming release v7.14.0, we only allow breaking changes with fallbacks only.

can we add an option (default to false) to let users fallback to poetry 1.x?

@4c0n
Copy link
Contributor Author

4c0n commented May 14, 2025

@wing328 I added a fallback option, hope this is sufficient?
When would we be allowed to drop support for Poetry 1.x?

@wing328
Copy link
Member

wing328 commented May 20, 2025

if no one has feedback/question on this pr, i'll merge it later this week

@wing328 wing328 merged commit 041d36c into OpenAPITools:master May 25, 2025
35 checks passed
@wing328
Copy link
Member

wing328 commented May 25, 2025

fyi. merged #21328 to update samples with a test

@wing328 wing328 added this to the 7.14.0 milestone May 25, 2025
@4c0n
Copy link
Contributor Author

4c0n commented May 25, 2025

Thank you @wing328 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants