diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cef2e96..14315e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: push: - branches: [trunk] + branches: [ trunk ] pull_request: workflow_dispatch: @@ -12,7 +12,7 @@ env: PIP_DISABLE_PIP_VERSION_CHECK: "1" PIP_NO_PYTHON_VERSION_WARNING: "1" -permissions: {} +permissions: { } jobs: build-package: @@ -23,6 +23,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + persist-credentials: false - uses: hynek/build-and-inspect-python-package@v2 id: baipp @@ -74,6 +75,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + persist-credentials: false - uses: actions/setup-python@v5 with: python-version: "3.12" @@ -140,7 +143,7 @@ jobs: - run: tar xf dist/*.tar.gz --strip-components=1 - uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Set up test runner run: | python -VV @@ -148,9 +151,9 @@ jobs: python -Im pip install --upgrade nox python -Im nox --version - name: Check code formatting - run: "python -Im nox --non-interactive --error-on-external-run --tag formatters --python 3.12" + run: "python -Im nox --non-interactive --error-on-external-run --tag formatters --python 3.13" - name: Lint code - run: "python -Im nox --non-interactive --error-on-external-run --tag linters --python 3.12" + run: "python -Im nox --non-interactive --error-on-external-run --tag linters --python 3.13" check-package: @@ -166,7 +169,7 @@ jobs: - run: tar xf dist/*.tar.gz --strip-components=1 - uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Set up test runner run: | python -VV @@ -174,7 +177,7 @@ jobs: python -Im pip install --upgrade nox python -Im nox --version - name: Check package - run: "python -Im nox --non-interactive --error-on-external-run --tag packaging --python 3.12" + run: "python -Im nox --non-interactive --error-on-external-run --tag packaging --python 3.13" required-checks-pass: diff --git a/.gitignore b/.gitignore index 8a33477..f90904f 100644 --- a/.gitignore +++ b/.gitignore @@ -131,3 +131,10 @@ dmypy.json # Cython debug symbols cython_debug/ + +# IDEs +.idea/ +.vscode/ + +# PDM local file. +.pdm-python diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ee9101f..80d0fc9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-added-large-files - id: check-ast @@ -16,10 +16,10 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 24.8.0 + rev: 24.10.0 hooks: - id: black - language_version: python3.8 + language_version: python3.13 name: black (Python formatter) - repo: https://github.com/pycqa/flake8 rev: 7.1.1 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 9a1d3b0..7ca56e5 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,7 +7,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.11" + python: "3.12" sphinx: configuration: docs/conf.py @@ -15,4 +15,5 @@ sphinx: python: install: - method: pip - path: .[docs] + path: . + - requirements: docs/requirements.txt diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 0000000..8928c9e --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,103 @@ +Contributor guide +================= + +Contributions are welcome, and several things about this repository +have been set up to make the process easier for everyone (including +you!). + + +Prerequisites +------------- + +* Please use a code editor/IDE that supports `EditorConfig + `_. Most editors do nowadays, so you + probably don't have to worry about it, but it will help to + automatically apply some formatting and style rules. + +* Please make sure you have `pre-commit `_ + installed, and in your local checkout of this repository run + ``pre-commit install`` to set up the pre-commit hooks. + +The following two tools are *required* for working with this +repository: + +* `PDM `_ + +* `nox `_ + +You will also need at least one supported Python version. It is also +recommended that you test against *all* the supported Python verisions +before opening a pull request; you can use `PDM's Python installer +`_ +to install any versions of Python you need. + + +Local setup +----------- + +Once you have the tools above installed, run the following in the root +of your git checkout:: + + pdm install + +This will create a local virtual environment and install +``webcolors`` and its dependencies. + + +Testing +------- + +To run the tests, use ``nox``:: + + nox --tags tests + +By default this will run against as many supported Python versions as +you have installed. To select a single specific Python version, you +can run:: + + nox --tags tests --python "3.11" + +You can also run the full CI suite locally by just invoking +``nox``. This will run the tests, check the documentation, lint the +code and check formatting, and build a package and perform checks on +it. + +For more information about available tasks, run ``nox --list`` or read +the file ``noxfile.py`` in the root of your source checkout, or the +testing documentation in the file ``docs/conformance.rst``. + + +Code style +---------- + +The pre-commit hooks will auto-format code with `isort +`_ and `Black +`_. Many editors and IDEs also support +auto-formatting with these tools every time you save a file. The CI +suite will disallow any code that does not follow the isort/Black +format. + +All code must also be compatible with all supported versions of +Python. + + +Other guidelines +---------------- + +* If you need to add a new file of code, please make sure to put a + license identifier comment near the top of the file. You can copy + and paste the license identifier comment from any existing file, + where it looks like this: + ``# SPDX-License-Identifier: BSD-3-Clause`` + +* Documentation and tests are not just recommended -- they're + required. Any new file, class, method or function must have a + docstring and must either include that docstring (via autodoc) in + the built documentation, or must have manually-written documentation + in the ``docs/`` directory. Any new feature or bugfix must have + sufficient tests to prove that it works, and the test coverage + report must come out at 100%. The CI suite will fail if test + coverage is below 100%, if there's any code which doesn't have a + docstring, or if there are any misspelled words in the documentation + (and if there's a word the spell-checker should learn to recognize, + add it to ``docs/spelling_wordlist.txt``). diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 5c44e81..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,13 +0,0 @@ -include LICENSE -include MANIFEST.in -include .editorconfig -include *.yaml -include docs/*.rst docs/*.txt docs/*.py docs/*.bat docs/Makefile -include .flake8 -include pyproject.toml -include noxfile.py -include tox.ini -graft src -graft tests -global-exclude *.pyc -prune docs/_build diff --git a/docs/changelog.rst b/docs/changelog.rst index 15facf0..312f38d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -56,6 +56,13 @@ The API stability/deprecation policy for this library is as follows: Releases under CalVer --------------------- +Version 24.11.0 +~~~~~~~~~~~~~~~ + +*Under development* + +* Supported Python versions are now 3.9, 3.10, 3.11, 3.12, and 3.13. + Version 24.8.0 ~~~~~~~~~~~~~~ @@ -72,7 +79,7 @@ Version 24.6.0 Released June 2024 -* Supported Python versions are now 3.8, 3.9, 3.10, and 3.11. +* Supported Python versions are now 3.8, 3.9, 3.10, and 3.12. * Running the unit tests no longer uses a third-party test runner; the standard-library ``unittest`` module's runner is used instead. diff --git a/docs/conf.py b/docs/conf.py index ddcdbc8..1793287 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,10 +20,10 @@ "sphinx_inline_tabs", ] templates_path = ["_templates"] -source_suffix = ".rst" +source_suffix = {".rst": "restructuredtext"} master_doc = "index" project = "webcolors" -copyright = "James Bennett, and contributors" +copyright = "James Bennett and contributors" version = get_version("webcolors") release = version exclude_trees = ["_build"] diff --git a/docs/conformance.rst b/docs/conformance.rst index 9e7db80..3d7256c 100644 --- a/docs/conformance.rst +++ b/docs/conformance.rst @@ -161,7 +161,7 @@ To run the normal test suite: py -m nox This will attempt to test against each supported version of Python (for -``webcolors`` |release|, this is 3.8, 3.9, 3.10, 3.11, and 3.12), skipping any +``webcolors`` |release|, this is 3.9, 3.10, 3.11, 3.12, and 3.12), skipping any which are missing on your machine. To test only against a specific version of Python, use the ``--python`` flag and pass the version to test. For example, to test on Python 3.10: diff --git a/docs/faq.rst b/docs/faq.rst index 3d5cc91..323eccb 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -13,8 +13,8 @@ General What versions of Python are supported? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Version |release| of ``webcolors`` supports and is tested on Python 3.8, 3.9, -3.10, 3.11, and 3.12. +Version |release| of ``webcolors`` supports and is tested on Python 3.9, +3.10, 3.11, 3.12, and 3.13. How am I allowed to use this module? diff --git a/docs/install.rst b/docs/install.rst index c363f7f..4482111 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -7,8 +7,6 @@ Installation guide Version |release| of ``webcolors`` is officially tested and supported on the following versions of Python: -* Python 3.8 - * Python 3.9 * Python 3.10 @@ -17,6 +15,8 @@ following versions of Python: * Python 3.12 +* Python 3.13 + Installing ``webcolors`` ------------------------ diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..220d244 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,13 @@ +# These dependencies are not "extras" defined in the pyproject.toml, +# because they're not something you actually want to install alongside +# the main package. They're also not "dev dependencies" in the PDM +# sense of the term, because PDM would constrain them to the oldest +# Python version the main package supports (3.9), while all our +# documentation jobs, whether run via nox or via readthedocs, run on +# Python 3.12. +furo +sphinx +sphinx-copybutton +sphinx-inline-tabs +sphinx-notfound-page +sphinxext-opengraph diff --git a/noxfile.py b/noxfile.py index b78dcdd..48eea40 100644 --- a/noxfile.py +++ b/noxfile.py @@ -38,7 +38,7 @@ ) -def clean(paths: typing.Iterable[os.PathLike] = ARTIFACT_PATHS) -> None: +def clean(paths: typing.Iterable[pathlib.Path] = ARTIFACT_PATHS) -> None: """ Clean up after a test run. @@ -58,13 +58,17 @@ def clean(paths: typing.Iterable[os.PathLike] = ARTIFACT_PATHS) -> None: # ----------------------------------------------------------------------------------- -@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"], tags=["tests"]) +@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13"], tags=["tests"]) def tests_with_coverage(session: nox.Session) -> None: """ Run the package's unit tests, with coverage instrumentation. """ - session.install(".[tests]") + session.install( + ".[tests]", + "coverage", + 'tomli; python_full_version < "3.11.0a7"', + ) session.run( f"python{session.python}", "-Wonce::DeprecationWarning", @@ -80,7 +84,7 @@ def tests_with_coverage(session: nox.Session) -> None: clean() -@nox.session(python=["3.12"], tags=["tests"]) +@nox.session(python=["3.13"], tags=["tests"]) def coverage_report(session: nox.Session) -> None: """ Combine coverage from the various test runs and output the report. @@ -100,7 +104,7 @@ def coverage_report(session: nox.Session) -> None: session.run(f"python{session.python}", "-Im", "coverage", "erase") -@nox.session(python=["3.12"], tags=["tests", "release"]) +@nox.session(python=["3.13"], tags=["release"]) def tests_definitions(session: nox.Session) -> None: """ Run the full color definitions test suite (requires an internet connection). @@ -113,7 +117,7 @@ def tests_definitions(session: nox.Session) -> None: clean() -@nox.session(python=["3.12"], tags=["tests", "release"]) +@nox.session(python=["3.13"], tags=["release"]) def tests_full_colors(session: nox.Session) -> None: """ Run the full color conversion test suite (slow/CPU-intensive). @@ -130,24 +134,31 @@ def tests_full_colors(session: nox.Session) -> None: # ----------------------------------------------------------------------------------- +# The documentation jobs ordinarily would want to use the latest Python version, but +# currently that's 3.13 and Read The Docs doesn't yet support it. So to ensure the +# documentation jobs are as closely matched to what would happen on RTD, these jobs stay +# on 3.12 for now. @nox.session(python=["3.12"], tags=["docs"]) def docs_build(session: nox.Session) -> None: """ Build the package's documentation as HTML. """ - session.install(".[docs]") - session.chdir("docs") + session.install(".", "-r", "docs/requirements.txt") + build_dir = session.create_tmp() session.run( - f"python{session.python}", + f"{session.bin}/python{session.python}", "-Im", "sphinx", - "-b", + "--builder", "html", - "-d", - f"{session.bin}/../tmp/doctrees", - ".", - f"{session.bin}/../tmp/html", + "--write-all", + "-c", + "docs/", + "--doctree-dir", + f"{build_dir}/doctrees", + "docs/", + f"{build_dir}/html", ) clean() @@ -159,10 +170,7 @@ def docs_docstrings(session: nox.Session) -> None: methods. """ - # interrogate implicitly depends on pkg_resources, which is part of setuptools but - # as of Python 3.12, the venv module no longer automatically installed setuptools - # into newly-created environments. So we install it manually here. - session.install("interrogate", "setuptools") + session.install("interrogate") session.run(f"python{session.python}", "-Im", "interrogate", "--version") session.run( f"python{session.python}", @@ -182,23 +190,21 @@ def docs_spellcheck(session: nox.Session) -> None: Spell-check the package's documentation. """ - session.install( - "pyenchant", - "sphinxcontrib-spelling", - ".[docs]", - ) + session.install(".", "-r", "docs/requirements.txt") + session.install("pyenchant", "sphinxcontrib-spelling") build_dir = session.create_tmp() - session.chdir("docs") session.run( - f"python{session.python}", + f"{session.bin}/python{session.python}", "-Im", "sphinx", "-W", # Promote warnings to errors, so that misspelled words fail the build. - "-b", + "--builder", "spelling", - "-d", + "-c", + "docs/", + "--doctree-dir", f"{build_dir}/doctrees", - ".", + "docs/", f"{build_dir}/html", # On Apple Silicon Macs, this environment variable needs to be set so # pyenchant can find the "enchant" C library. See @@ -208,29 +214,6 @@ def docs_spellcheck(session: nox.Session) -> None: clean() -@nox.session(python=["3.12"], tags=["docs"]) -def docs_test(session: nox.Session) -> None: - """ - Run the code samples in the documentation with doctest, to ensure they are - correct. - - """ - session.install(".[docs]") - session.run( - f"python{session.python}", - "-Im", - "sphinx", - "-c", - "docs/", - "-b", - "doctest", - "-d", - "docs/_build/doctrees/html", - "docs/", - "docs/_build/html", - ) - - # Code formatting checks. # # These checks do *not* reformat code -- that happens in pre-commit hooks -- but will @@ -238,7 +221,7 @@ def docs_test(session: nox.Session) -> None: # ----------------------------------------------------------------------------------- -@nox.session(python=["3.12"], tags=["formatters"]) +@nox.session(python=["3.13"], tags=["formatters"]) def format_black(session: nox.Session) -> None: """ Check code formatting with Black. @@ -260,7 +243,7 @@ def format_black(session: nox.Session) -> None: clean() -@nox.session(python=["3.12"], tags=["formatters"]) +@nox.session(python=["3.13"], tags=["formatters"]) def format_isort(session: nox.Session) -> None: """ Check import order with isort. @@ -286,7 +269,7 @@ def format_isort(session: nox.Session) -> None: # ----------------------------------------------------------------------------------- -@nox.session(python=["3.12"], tags=["linters", "security"]) +@nox.session(python=["3.13"], tags=["linters", "security"]) def lint_bandit(session: nox.Session) -> None: """ Lint code with the Bandit security analyzer. @@ -307,7 +290,7 @@ def lint_bandit(session: nox.Session) -> None: clean() -@nox.session(python=["3.12"], tags=["linters"]) +@nox.session(python=["3.13"], tags=["linters"]) def lint_flake8(session: nox.Session) -> None: """ Lint code with flake8. @@ -327,16 +310,13 @@ def lint_flake8(session: nox.Session) -> None: clean() -@nox.session(python=["3.12"], tags=["linters"]) +@nox.session(python=["3.13"], tags=["linters"]) def lint_pylint(session: nox.Session) -> None: """ Lint code with Pylint. """ - # Pylint requires that all dependencies be importable during the run. This package - # does not have any direct dependencies, nor does the normal test suite, but the - # full conformance suite does require a few extra libraries, so they're installed - # here. + # Pylint requires that all dependencies be importable during the run. session.install("pylint", "bs4", "html5lib", "requests") session.run(f"python{session.python}", "-Im", "pylint", "--version") session.run(f"python{session.python}", "-Im", "pylint", "src/", "tests/") @@ -347,7 +327,7 @@ def lint_pylint(session: nox.Session) -> None: # ----------------------------------------------------------------------------------- -@nox.session(python=["3.12"], tags=["packaging"]) +@nox.session(python=["3.13"], tags=["packaging"]) def package_build(session: nox.Session) -> None: """ Check that the package builds. @@ -359,7 +339,7 @@ def package_build(session: nox.Session) -> None: clean() -@nox.session(python=["3.12"], tags=["packaging"]) +@nox.session(python=["3.13"], tags=["packaging"]) def package_description(session: nox.Session) -> None: """ Check that the package description will render on the Python Package Index. @@ -383,7 +363,7 @@ def package_description(session: nox.Session) -> None: clean() -@nox.session(python=["3.12"], tags=["packaging"]) +@nox.session(python=["3.13"], tags=["packaging"]) def package_manifest(session: nox.Session) -> None: """ Check that the set of files in the package matches the set under version control. @@ -397,7 +377,7 @@ def package_manifest(session: nox.Session) -> None: clean() -@nox.session(python=["3.12"], tags=["packaging"]) +@nox.session(python=["3.13"], tags=["packaging"]) def package_pyroma(session: nox.Session) -> None: """ Check package quality with pyroma. @@ -408,7 +388,7 @@ def package_pyroma(session: nox.Session) -> None: clean() -@nox.session(python=["3.12"], tags=["packaging"]) +@nox.session(python=["3.13"], tags=["packaging"]) def package_wheel(session: nox.Session) -> None: """ Check the built wheel package for common errors. diff --git a/pdm.lock b/pdm.lock new file mode 100644 index 0000000..5607e8d --- /dev/null +++ b/pdm.lock @@ -0,0 +1,141 @@ +# This file is @generated by PDM. +# It is not intended for manual editing. + +[metadata] +groups = ["default", "tests"] +strategy = ["inherit_metadata"] +lock_version = "4.5.0" +content_hash = "sha256:51fdb4b676102bbac5ee91a02110ebc2da1aa01ae32bbeaae8fbd417bbe25512" + +[[metadata.targets]] +requires_python = ">=3.9,<3.10" + +[[metadata.targets]] +requires_python = ">=3.10" + +[[package]] +name = "argcomplete" +version = "3.5.1" +requires_python = ">=3.8" +summary = "Bash tab completion for argparse" +groups = ["tests"] +files = [ + {file = "argcomplete-3.5.1-py3-none-any.whl", hash = "sha256:1a1d148bdaa3e3b93454900163403df41448a248af01b6e849edc5ac08e6c363"}, + {file = "argcomplete-3.5.1.tar.gz", hash = "sha256:eb1ee355aa2557bd3d0145de7b06b2a45b0ce461e1e7813f5d066039ab4177b4"}, +] + +[[package]] +name = "colorama" +version = "0.4.6" +requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +summary = "Cross-platform colored terminal text." +groups = ["tests"] +marker = "sys_platform == \"win32\"" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "colorlog" +version = "6.9.0" +requires_python = ">=3.6" +summary = "Add colours to the output of Python's logging module." +groups = ["tests"] +dependencies = [ + "colorama; sys_platform == \"win32\"", +] +files = [ + {file = "colorlog-6.9.0-py3-none-any.whl", hash = "sha256:5906e71acd67cb07a71e779c47c4bcb45fb8c2993eebe9e5adcd6a6f1b283eff"}, + {file = "colorlog-6.9.0.tar.gz", hash = "sha256:bfba54a1b93b94f54e1f4fe48395725a3d92fd2a4af702f6bd70946bdc0c6ac2"}, +] + +[[package]] +name = "distlib" +version = "0.3.9" +summary = "Distribution utilities" +groups = ["tests"] +files = [ + {file = "distlib-0.3.9-py2.py3-none-any.whl", hash = "sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87"}, + {file = "distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"}, +] + +[[package]] +name = "filelock" +version = "3.16.1" +requires_python = ">=3.8" +summary = "A platform independent file lock." +groups = ["tests"] +files = [ + {file = "filelock-3.16.1-py3-none-any.whl", hash = "sha256:2082e5703d51fbf98ea75855d9d5527e33d8ff23099bec374a134febee6946b0"}, + {file = "filelock-3.16.1.tar.gz", hash = "sha256:c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435"}, +] + +[[package]] +name = "nox" +version = "2024.10.9" +requires_python = ">=3.8" +summary = "Flexible test automation." +groups = ["tests"] +dependencies = [ + "argcomplete<4,>=1.9.4", + "colorlog<7,>=2.6.1", + "packaging>=20.9", + "tomli>=1; python_version < \"3.11\"", + "virtualenv>=20.14.1", +] +files = [ + {file = "nox-2024.10.9-py3-none-any.whl", hash = "sha256:1d36f309a0a2a853e9bccb76bbef6bb118ba92fa92674d15604ca99adeb29eab"}, + {file = "nox-2024.10.9.tar.gz", hash = "sha256:7aa9dc8d1c27e9f45ab046ffd1c3b2c4f7c91755304769df231308849ebded95"}, +] + +[[package]] +name = "packaging" +version = "24.2" +requires_python = ">=3.8" +summary = "Core utilities for Python packages" +groups = ["tests"] +files = [ + {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, + {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, +] + +[[package]] +name = "platformdirs" +version = "4.3.6" +requires_python = ">=3.8" +summary = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." +groups = ["tests"] +files = [ + {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, + {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, +] + +[[package]] +name = "tomli" +version = "2.0.2" +requires_python = ">=3.8" +summary = "A lil' TOML parser" +groups = ["tests"] +marker = "python_version < \"3.11\" and python_version >= \"3.9\"" +files = [ + {file = "tomli-2.0.2-py3-none-any.whl", hash = "sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38"}, + {file = "tomli-2.0.2.tar.gz", hash = "sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed"}, +] + +[[package]] +name = "virtualenv" +version = "20.27.1" +requires_python = ">=3.8" +summary = "Virtual Python Environment builder" +groups = ["tests"] +dependencies = [ + "distlib<1,>=0.3.7", + "filelock<4,>=3.12.2", + "importlib-metadata>=6.6; python_version < \"3.8\"", + "platformdirs<5,>=3.9.1", +] +files = [ + {file = "virtualenv-20.27.1-py3-none-any.whl", hash = "sha256:f11f1b8a29525562925f745563bfd48b189450f61fb34c4f9cc79dd5aa32a1f4"}, + {file = "virtualenv-20.27.1.tar.gz", hash = "sha256:142c6be10212543b32c6c45d3d3893dff89112cc588b7d0879ae5a1ec03a47ba"}, +] diff --git a/pyproject.toml b/pyproject.toml index 2bc5416..791ca4d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["setuptools>=61.0"] -build-backend = "setuptools.build_meta" +requires = ["pdm-backend"] +build-backend = "pdm.backend" [project] authors = [ - {name = "James Bennett", email = "james@b-list.org"} + {name = "James Bennett"} ] classifiers = [ "Development Status :: 5 - Production/Stable", @@ -14,43 +14,33 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Utilities", ] name = "webcolors" description = "A library for working with the color formats defined by HTML and CSS." -dynamic = ["version"] keywords = ["color", "css", "html", "web"] license = {text = "BSD-3-Clause"} readme = "README.rst" -requires-python = ">=3.8" +requires-python = ">=3.9" +version = "24.11.0a1" [project.urls] -documentation = "https://webcolors.readthedocs.io" -homepage = "https://github.com/ubernostrum/webcolors" +"Documentation" = "https://webcolors.readthedocs.io" +"Source Code" = "https://github.com/ubernostrum/webcolors" -[project.optional-dependencies] -docs = [ - "furo", - "sphinx", - "sphinx-copybutton", - "sphinx-inline-tabs", - "sphinx-notfound-page", - "sphinxext-opengraph", -] -tests = [ - "coverage[toml]", -] +[dependency-groups] +tests = ["nox"] [tool.bandit] skips = ["B101"] [tool.black] -target-version = ["py38", "py39", "py310", "py311", "py312"] +target-version = ["py39", "py310", "py311", "py312", "py313"] [tool.coverage.paths] source = ["src", ".nox/tests_with_coverage*/**/site-packages"] @@ -64,10 +54,33 @@ parallel = true source = ["webcolors"] [tool.interrogate] +fail-under = 100 +ignore-init-method = true ignore-init-module = true [tool.isort] profile = "black" -[tool.setuptools.dynamic] -version = {attr = "webcolors.__version__"} +[tool.pdm] +distribution = true + +[tool.pdm.build] +source-includes = [ + ".editorconfig", + ".flake8", + ".pre-commit-config.yaml", + ".readthedocs.yaml", + "AUTHORS", + "CONTRIBUTING.rst", + "docs/", + "noxfile.py", + "pdm.lock", + "runtests.py", + "tests/", +] + +[tool.pylint] +disable = [ + "duplicate-code", + "protected-access", +]