swagger-api / swagger-api/swagger-codegen-generators
[Python] Unable to use both -DpackageName and -DpackageVersion parameters in one invocation
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 299
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
Description
When using -DpackageName and -DpackageVersion to specify values for NAME and VERSION in setup.py, whichever is the last parameter is the one that takes effect. The first one gets replaced by a default value.
Swagger-codegen version
3.0.22
Command line used for generation
The following invocation...
docker run --rm -v ${TARGET_DIR}:/local/path swaggerapi/swagger-codegen-cli-v3:3.0.22 generate \
-i /local/path/input.json \
-l python \
-o /local/path/package_directory \
-DpackageVersion=X.Y.Z \
-DpackageName=my_package_name
produces these values in setup.py:
NAME = "my_package_name"
VERSION = "1.0.0" # This is a default value
On the other hand, if I swap the order of -DpackageName and -DpackageVersion in the previous invocation so that the version comes last, setup.py contains these values:
NAME = "swagger-client" # This is a default value
VERSION = "X.Y.Z"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the Docker generation command from the issue with both -DpackageName and -DpackageVersion values, then inspect the Python generator or template responsible for the generated setup.py. Verify that changing the parameter order no longer replaces either value with its default, using the generated NAME and VERSION as the completion check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100