asottile / setup-cfg-fmt

apply a consistent format to `setup.cfg` files
MIT License
152 stars 20 forks source link

`python_requires` gets rewriten even when `--min-py-version` is **not** specified #230

Closed Cube707 closed 6 months ago

Cube707 commented 6 months ago

Currently setup-cfg-fmt applies the default setting of 3.8 even to config files that specify they allow smaller python version. This should happen in my opinion, only if the user specifies a --min-py-version should it override the existing values.

steps to reproduce:

assume the following setup.cfg:

[metadata]
name = tinker
classifiers =
    Programming Language :: Python :: 3
    Programming Language :: Python :: 3 :: Only
    Programming Language :: Python :: 3.7
    Programming Language :: Python :: 3.8

[options]
python_requires = >=3.7

now running setup-cfg-fmt --include-version-classifiers setup.cfg will update the version-classifiers and require_python to a minimum of 3.8

Notes

this is already fixed in #178. installing pip install -U git+https://github.com/mxr/setup-cfg-fmt#parse-min and running the command again results in the expected behavior

asottile commented 6 months ago

you found the duplicate and yet still made an issue?

Cube707 commented 6 months ago

I do not believe this is a duplicate. Both #178 and #179 started out about different things. Its only a happy accident that the fix for theses also fixes this.

This is still an existing problem in the current version that others might face, so please keep it open until the PR is merged.

asottile commented 6 months ago

no, I'm not changing this behavior

Cube707 commented 6 months ago

than #179 is not beeing continued?

asottile commented 6 months ago

not in it's current state, no