asottile / setup-cfg-fmt

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

`setup-cfg` removes the empty `packages` #211

Closed lnxpy closed 1 year ago

lnxpy commented 1 year ago

When I run setup-cfg-fmt setup.cfg, it removes the following valid line from the file.

[options]
python_requires = >=3.8
-packages = 
+

Since I have setup-cfg as part of my pre-commit hook, it made me set the skipsdist to true in tox.

asottile commented 1 year ago

you're going to need to clarify the problem. it's not clear why either of those things would be needed

lnxpy commented 1 year ago

In some cases, I guess that's fine if we develop a python application in the form of a python distribution like having all configs and metadata that tools such as setuptools can figure them out. In my case, I'm using the setup.cfg file to manage the dependencies of my project as well as the versioning stuff. My project is basically not meant to be distributed but I'm using setup.cfg for managing the dependencies and configuring other tools.

For more precise vision, here is the project that I'm working on.

Sorry for misinforming btw. :)

lnxpy commented 1 year ago

I totally agree that the approach that I used to develop my application might not be quite clever but still, empty packages is meaningful and I feel like if it's declared to be empty, it should stay empty not ignored or dropped by a third-party lever. I tried it a few times and noticed that if you don't want to include any package or module into your distribution, not declaring packages = in setup.cfg would cause problems.

asottile commented 1 year ago

ok then you shouldn't use this tool