json2html icon indicating copy to clipboard operation
json2html copied to clipboard

migrate setup.py to pyproject.toml

Open felixp98 opened this issue 6 months ago • 1 comments

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-pep517 option, (possibly combined with --no-build-isolation), or adding a pyproject.toml file 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.cfg and MANIFEST.in have been removed and swapped to use pyproject.toml with a setuptools build backend.
  • patch version has been bumped to reflect changes

Will this change functionality?

Yes, in the following ways

  • pyproject.toml based 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?
  • Upload the package

twine upload dist/*

Did you test this?

Yes, in the following manner:

  1. Build the package ---> python -m build .
  2. Install to local venv ---> pip install ./dist/progress-1.3.1-py3-none-any.whl
  3. Move test script to somewhere it can't locally pickup the progress dist
  4. Run the tests python run_tests.py

Closes #60

felixp98 avatar Jun 30 '25 16:06 felixp98

@softvar Could you take a look at it?

felixp98 avatar Aug 09 '25 09:08 felixp98