Skip to content
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

Prefer setup.cfg to setup.py #28

Merged
merged 4 commits into from
Dec 7, 2022

Conversation

zwimer
Copy link
Contributor

@zwimer zwimer commented Nov 30, 2022

setuptools has supported setup.cfg for quite a while now; it is preferred over setup.py.

Actually, the most recent versions of setuptools support purely pyproject.toml files, but if you want to support older versions of setuptools then you may prefer the setup.cfg approach.

Hypothetically, this should still work for python2 as setuptools and pip are not part of the python standard library and get independent updates, but that is only if those tools have been updated in the past few years. Python2 has been EOL for coming on 3 years now so I would personally say it is ok to drop it, but that's up to you.

@albertosottile
Copy link
Owner

Thank you for this PR. I am the only user of setup.py, as users of darkdetect should either use the wheels or vendor the package. Therefore, I never invested time in porting it to the modern ecosystem.

Personally, I would be fine to move everything to pyproject.toml and drop Python 2. In the beginning, I only supported it because it happened "for free", but now I see this is hindering some improvements and, furthermore, we should not foster support of deprecated Python versions.

Would you be willing to adapt this PR to move everything to pyproject.toml? Thanks

@zwimer zwimer mentioned this pull request Dec 7, 2022
@zwimer
Copy link
Contributor Author

zwimer commented Dec 7, 2022

This is what pip show -v gives:

Note that Author is as Author-email is preferred. Also note that Homepage is not set, but Project-URLs has homepage correct; this is an open bug in pip's show command: pypa/pip#11221 so ignore it since you can see the package data itself is correct.

Name: darkdetect
Version: 0.7.1
Summary: Detect OS Dark Mode from Python
Home-page:
Author:
Author-email: Alberto Sottile <[email protected]>
License: BSD-3-Clause
Location: /Users/zwimer/.virtualenvs/test3/lib/python3.10/site-packages
Requires:
Required-by:
Metadata-Version: 2.1
Installer: pip
Classifiers:
  License :: OSI Approved :: BSD License
  Operating System :: MacOS :: MacOS X
  Operating System :: Microsoft :: Windows :: Windows 10
  Operating System :: POSIX :: Linux
  Programming Language :: Python :: 3
  Programming Language :: Python :: 3.5
  Programming Language :: Python :: 3.6
  Programming Language :: Python :: 3.7
  Programming Language :: Python :: 3.8
  Programming Language :: Python :: 3.9
  Programming Language :: Python :: 3.10
Entry-points:
Project-URLs:
  homepage, http://github.com/albertosottile/darkdetect
  download, http://github.com/albertosottile/darkdetect/releases

@zwimer
Copy link
Contributor Author

zwimer commented Dec 7, 2022

This PR no longer supports python2.

pyproject.toml Outdated Show resolved Hide resolved
@albertosottile
Copy link
Owner

LGTM, thanks for this PR.

@albertosottile albertosottile merged commit e172ae8 into albertosottile:master Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants