albertosottile / darkdetect

Detect OS Dark Mode from Python
Other
171 stars 18 forks source link

Prefer setup.cfg to setup.py #28

Closed zwimer closed 1 year ago

zwimer commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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: https://github.com/pypa/pip/issues/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 <asottile@gmail.com>
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 commented 1 year ago

This PR no longer supports python2.

albertosottile commented 1 year ago

LGTM, thanks for this PR.