[python] Drop poetry v1 support#22653
Open
stephenfin wants to merge 6 commits intoOpenAPITools:masterfrom
Open
[python] Drop poetry v1 support#22653stephenfin wants to merge 6 commits intoOpenAPITools:masterfrom
stephenfin wants to merge 6 commits intoOpenAPITools:masterfrom
Conversation
ba7312c to
10a6206
Compare
There was a problem hiding this comment.
1 issue found across 97 files
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache">
<violation number="1" location="modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache:27">
P2: Typo: `requirement.txt` should be `requirements.txt` (missing 's'). This inconsistency would confuse users trying to follow the installation instructions.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache
Outdated
Show resolved
Hide resolved
Done with: # remove existing artifacts rm -rf samples/client/echo_api/python/* rm -rf samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/* rm -rf samples/openapi3/client/petstore/python/* rm -rf samples/openapi3/client/petstore/python-aiohttp/* rm -rf samples/openapi3/client/petstore/python-httpx/* rm -rf samples/openapi3/client/petstore/python-lazyImports/* # restore manually added tests git checkout -f HEAD -- samples/client/echo_api/python/tests git checkout -f HEAD -- samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/tests git checkout -f HEAD -- samples/openapi3/client/petstore/python/tests git checkout -f HEAD -- samples/openapi3/client/petstore/python-aiohttp/tests git checkout -f HEAD -- samples/openapi3/client/petstore/python-httpx/tests git checkout -f HEAD -- samples/openapi3/client/petstore/python-lazyImports/tests # ...and test files git checkout -f HEAD -- samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/testfiles git checkout -f HEAD -- samples/openapi3/client/petstore/python/testfiles git checkout -f HEAD -- samples/openapi3/client/petstore/python-aiohttp/testfiles git checkout -f HEAD -- samples/openapi3/client/petstore/python-httpx/testfiles git checkout -f HEAD -- samples/openapi3/client/petstore/python-lazyImports/testfiles # regenerate samples ./mvnw clean package -DskipTests ./bin/generate-samples.sh bin/configs/python.yaml bin/configs/python-echo-api.yaml This highlights a number of file mode changes along with some tests and docs for things that no longer exist in the relevant OpenAPI specs. Signed-off-by: Stephen Finucane <stephen@that.guru>
poetry 2.x is a year old now. We no longer need to keep this workaround. Signed-off-by: Stephen Finucane <stephen@that.guru>
This is more efficient and allows for seamless use of the package in e.g. tox Signed-off-by: Stephen Finucane <stephen@that.guru>
We now use poetry so a setuptools setup.py file is unnecessary. The READMEs are also updated to reflect this. Signed-off-by: Stephen Finucane <stephen@that.guru>
This has the advantage of being able to automatically format the generated code for us as well as validating it. It also allows us to remove the setup.cfg file. Signed-off-by: Stephen Finucane <stephen@that.guru>
We only need to generate these for convenience if we are not generating a pyproject.toml file. Signed-off-by: Stephen Finucane <stephen@that.guru>
25a88cc to
8b45bf1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a collection of individual changes that collectively bump the minimum version of poetry to v2, remove stuff that was only applicable for older versions, and migrates things from flake8 to ruff. This PR is likely easier to review on a commit-by-commit basis: I've tried to provide as much detail as possible about what I've done and why I did it in each commit, and the whole thing should be fully bisectable.
CC: @cbornet @tomplus @krjakbrjak @fa0311 @multani
PR checklist
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.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)Summary by cubic
Drops Poetry v1 support and switches Python outputs to Poetry 2 with poetry-core, replacing setuptools scaffolding. Also migrates linting to Ruff and stops generating requirements.txt by default; samples and docs updated.
Refactors
Migration
Written for commit 8b45bf1. Summary will update on new commits.