imagehash
imagehash copied to clipboard
Moved the metadata into `PEP 621`-compliant `pyproject.toml`.
Coverage decreased (-2.4%) to 87.762% when pulling 91819510e154a989649535a16777a8066bea8cae on KOLANICH-libs:pyproject.toml into 8c774c00824f07797fa9cc21f4b5ab9c7bf8f6b6 on JohannesBuchner:master.
Please explain the PR.
- The first commit moves the data from Turing-complete
setup.py
into a declarativesetup.cfg
supported bysetuptools
since 2016. But the actual support ofsetup.py
-less packages has appeared later with PEP 517 being implemented insetuptools
.pyproject.toml
added in that commit implementsPEP 517
and allows to build a package usingpython3 -m build
. No execution of Turing-complete code happens, which is a security benefit. Also declarative config can be parsed by other tools. -
setup.cfg
was a messy dialect ofini
that can be properly parsed usingsetuptools
or an own reinventions of a wheel. Unlikesetup.cfg
pyproject.toml
is a properTOML
that can be parsed and serialized by any lib for dealing with TOML. Since PEP 517 got implemented analogues tosetuptools
have been created. Each initially used an own format of metadata stored inpyproject.toml
. In order to decrease amount of messPEP 621
has been created, that defines the format multiple build backends have implemented reading, so with it it is easier to switch a build backend. This yearsetuptools
got support ofPEP 621
, so I have migrated the metadata to it. - Also
pip
enables PEP 660 only when PEP 621 is used. When PEP 660 is used the issue with editable installs on Debian-based distros whensetuptools
is used is worked around.
I am surprised this works also for the old pythons (2.7, 3.5), at least according to the CI.
Maybe then the flake8 config should also move there to remove that file.
The previous CI tested the pip install .
command a user may use after downloading the git repo. I think this should still be tested, perhaps in addition to the wheel build&install? What do you think?
The previous CI tested the pip install . command a user may use after downloading the git repo. I think this should still be tested, perhaps in addition to the wheel build&install? What do you think?
It won't work.setuptools
has dropped support of old Python versions. Since now users of old python versions cannot install the sdists of imagehash
(because under the hood pip install .
still builds a wheel, and since now they cannot build a wheel (well, if they backport setuptools
to old versions, they can, but who will do it, if it is easier to just upgrade python
(well, not easier, python has dropped Windows XP long ago, so python has to be backported too (I have heard that there were unofficial builds of cpython by third parties supporting XP, but I have never used them and don't even remember where I can download them), also 3.9 has dropped Windows 7 (which is not an issue for the purpose of this PR, since PEP621-compatible setuptools
requires only 3.7
, but still has to be mentioned, if were are talking about version compatibility), fortunately it is worked around well by https://github.com/nalexandru/api-ms-win-core-path-HACK ) ?) ), only prebuilt wheels.
Then I am not sure how this PR can be merged and a single python 2.7-3.10 install from source instruction provided.
The first commit within it is compatible to both 2.7 and 3.4. Only the second one drops the possibility to build the packages on 3.5.
Hi @KOLANICH, sorry for the picking this up again so late. In the meantime, python 2 support has been dropped in imagehash. Considering this, could you please update the PR?