diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 97ae8fc..f0d68b0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,10 +28,14 @@ jobs: - name: Run the Test Suite run: |- set -x - pip install -U setuptools # for Python >=3.12 - pip install pytest - python setup.py sdist + python -m pip install build pytest + python -m build cd dist/ tar xf hsluv-*.tar.gz cd hsluv-*/ + python -m pip install . pytest -v tests/ + cd .. + python -m pip install --force-reinstall hsluv-*.whl + python -c 'import hsluv; from importlib.metadata import version; assert hsluv.__version__ == version("hsluv")' + python -m unittest discover -s hsluv-*/tests -v diff --git a/README.md b/README.md index 96ac227..720b5bc 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,9 @@ For HPLuv (the pastel variant), use `hpluv_to_hex`, `hpluv_to_rgb`, `hex_to_hplu ## Testing -Run `python setup.py test`. +Run `python -m unittest discover -v`. ## Authors * Robert McGinley ([mcginleyr1](https://github.com/mcginleyr1)) * Alexei Boronine ([boronine](https://github.com/boronine)) - diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0a46900 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +[build-system] +requires = ["setuptools>=77.0.3"] +build-backend = "setuptools.build_meta" + +[project] +name = "hsluv" +dynamic = ["version"] +description = "Human-friendly HSL" +readme = "README.md" +license = "MIT" +license-files = ["LICENSE.txt"] +authors = [{email = "alexei@boronine.com"}] +requires-python = ">=3.11" +keywords = ["color", "hsl", "cie", "cieluv", "colorwheel", "hsluv", "hpluv"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Topic :: Software Development", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", + "Programming Language :: Python :: 3 :: Only", +] + +[project.urls] +Homepage = "https://www.hsluv.org" +"Bug Tracker" = "https://github.com/hsluv/hsluv-python/issues" +"Source Code" = "https://github.com/hsluv/hsluv-python" + +[tool.setuptools] +py-modules = ["hsluv"] + +[tool.setuptools.dynamic] +version = {attr = "hsluv.__version__"} diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 2a9acf1..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal = 1 diff --git a/setup.py b/setup.py deleted file mode 100644 index 9edb8d5..0000000 --- a/setup.py +++ /dev/null @@ -1,40 +0,0 @@ -#! /usr/bin/env python3 -from setuptools import setup - -from hsluv import __version__ - -setup( - name='hsluv', - version=__version__, - description='Human-friendly HSL', - long_description=open('README.md').read(), - long_description_content_type='text/markdown', - license="MIT", - author_email="alexei@boronine.com", - url="https://www.hsluv.org", - keywords="color hsl cie cieluv colorwheel hsluv hpluv", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Topic :: Software Development", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", - "Programming Language :: Python :: 3.15", - "Programming Language :: Python :: 3 :: Only", - ], - python_requires='>=3.11', - setup_requires=[ - 'setuptools>=38.6.0', # for long_description_content_type - ], - py_modules=["hsluv"], - test_suite="tests.test_hsluv", - project_urls={ - "Bug Tracker": "https://github.com/hsluv/hsluv-python/issues", - "Source Code": "https://github.com/hsluv/hsluv-python", - } -)