Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

setup.py vs. setup.cfg #137

Open
jGaboardi opened this issue Apr 26, 2021 · 1 comment
Open

setup.py vs. setup.cfg #137

jGaboardi opened this issue Apr 26, 2021 · 1 comment
Assignees

Comments

@jGaboardi
Copy link
Member

Originally raised by @ronnie-llamado in #136.

Potential updating setup.py to the more modern setup.cfg.

See also setuptools-declarative-requirements for managing requirement declarations in a setup.cfg.

@ronnie-llamado
Copy link
Member

For easier referencing, here's the previous conversation:

@jGaboardi Looks good. While you're in there updating it, do you have any take on a setup.py vs setup.cfg?

I have never used a setup.cfg file myself (actually never even seen one). It appears to be useful for passing in command line args? I'm not sure about the need or usefulness of having one for this project. Is there a case you have in mind for using/needing a setup.cfg?

PyPA suggests using setup.cfg in most cases since it's static metadata compared to setup.py's dynamic metadata (Packaging Python Projects).
I think you're right though - the implications on this project are minimal. The one added benefit for this project would be configurations for tools like pytest or flake8 would be also be contained in setup.cfg.

Indeed very interesting and elegant. What I can see as a pain point here is that setup.py extracts the version from cenpy.__init__.py. Not sure on how to accomplish this within setup.cfg. Also, where are requirements stipulated in setup.cfg files?

I think this setuptools documentation shows a better example of setup.cfg.

For the version, one can use the attr directive (very snazzy);

[metadata]
...
version = attr: cenpy.__version__

For the requirements, it would be relisted under install_requires (not so snazzy):

[options]
...
install_requires =
    requests
    ...
    geopandas

Not a huge fan manually listing out the requirements though.

Let's leave the decision up to @ljwolf. Also, it might be good to have that in a separate PR. It is a relatively minor thing, but a break from the norm since cenpy's inception.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants