migrate setup.py to pyproject.toml
Overview
Installing json2html on pip 25.x raises the following warning:
DEPRECATION: Building 'json2html' using the legacy setup.py bdist_wheel mechanism, which will be removed in a future version. pip 25.3 will enforce this behaviour change. A possible replacement is to use the standardized build interface by setting the
--use-pep517option, (possibly combined with--no-build-isolation), or adding apyproject.tomlfile to the source tree of 'json2html'. Discussion can be found at https://github.com/pypa/pip/issues/6334
This pull request provides pyproject.toml support.
What has changed?
-
setup.py,setup.cfgandMANIFEST.inhave been removed and swapped to usepyproject.tomlwith a setuptools build backend. - patch version has been bumped to reflect changes
Will this change functionality?
Yes, in the following ways
-
pyproject.tomlbased builds do not support python2, so this will have to be dropped.
The requires-python >= 3.6 is arbitrary, this can be adjusted if you believe older versions still need support.
How do I build and deploy this now?
Using build and twine
- Install the build dependencies
pip install build twine
- Build the package
python -m build .
-
Test
- ⚠️ Didn't know how to migrate this
coverage run --source=json2html setup.py test?
- ⚠️ Didn't know how to migrate this
-
Upload the package
twine upload dist/*
Did you test this?
Yes, in the following manner:
- Build the package --->
python -m build . - Install to local venv --->
pip install ./dist/progress-1.3.1-py3-none-any.whl - Move test script to somewhere it can't locally pickup the progress dist
- Run the tests
python run_tests.py
Closes #60
@softvar Could you take a look at it?