-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[python] Drop poetry v1 support #22653
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
base: master
Are you sure you want to change the base?
Conversation
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 <[email protected]>
poetry 2.x is a year old now. We no longer need to keep this workaround. Signed-off-by: Stephen Finucane <[email protected]>
This is more efficient and allows for seamless use of the package in e.g. tox Signed-off-by: Stephen Finucane <[email protected]>
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 <[email protected]>
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 <[email protected]>
We only need to generate these for convenience if we are not generating a pyproject.toml file. Signed-off-by: Stephen Finucane <[email protected]>
The sleep itself has been commented out for a long time (commit 04fa53b from September 2023, to be specific). Signed-off-by: Stephen Finucane <[email protected]>
ba7312c to
10a6206
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| * typing-extensions >= 4.7.1 | ||
| This python library package is generated without supporting files like `pyproject.toml`. | ||
| To be able to use it, you will need these dependencies in your own package that uses this library. | ||
| Requirements files (`requirement.txt`, `test-requirements.txt`) are provided for this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Typo: requirement.txt should be requirements.txt (missing 's'). This inconsistency would confuse users trying to follow the installation instructions.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At modules/openapi-generator/src/main/resources/python/README_onlypackage.mustache, line 27:
<comment>Typo: `requirement.txt` should be `requirements.txt` (missing 's'). This inconsistency would confuse users trying to follow the installation instructions.</comment>
<file context>
@@ -16,36 +16,24 @@ The `{{packageName}}` package is automatically generated by the [OpenAPI Generat
-* typing-extensions >= 4.7.1
+This python library package is generated without supporting files like `pyproject.toml`.
+To be able to use it, you will need these dependencies in your own package that uses this library.
+Requirements files (`requirement.txt`, `test-requirements.txt`) are provided for this.
+
+```
</file context>
| Requirements files (`requirement.txt`, `test-requirements.txt`) are provided for this. | |
| Requirements files (`requirements.txt`, `test-requirements.txt`) are provided for this. |
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 ba7312c. Summary will update on new commits.