Skip to content

Commit

Permalink
Start prepping 24.11.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
ubernostrum committed Nov 11, 2024
1 parent 396f2cc commit c55f147
Show file tree
Hide file tree
Showing 15 changed files with 376 additions and 121 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI

on:
push:
branches: [trunk]
branches: [ trunk ]
pull_request:
workflow_dispatch:

Expand All @@ -12,7 +12,7 @@ env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_NO_PYTHON_VERSION_WARNING: "1"

permissions: {}
permissions: { }

jobs:
build-package:
Expand All @@ -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
Expand Down Expand Up @@ -74,6 +75,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: "3.12"
Expand Down Expand Up @@ -140,17 +143,17 @@ 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
python -Im site
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:
Expand All @@ -166,15 +169,15 @@ 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
python -Im site
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:
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,10 @@ dmypy.json

# Cython debug symbols
cython_debug/

# IDEs
.idea/
.vscode/

# PDM local file.
.pdm-python
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "3.12"

sphinx:
configuration: docs/conf.py

python:
install:
- method: pip
path: .[docs]
path: .
- requirements: docs/requirements.txt
103 changes: 103 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -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
<https://editorconfig.org>`_. 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 <https://pre-commit.com>`_
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 <https://pdm-project.org/>`_

* `nox <https://nox.thea.codes/en/stable/>`_

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
<https://pdm-project.org/latest/usage/project/#install-python-interpreters-with-pdm>`_
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
<https://pycqa.github.io/isort/>`_ and `Black
<https://black.readthedocs.io/>`_. 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``).
13 changes: 0 additions & 13 deletions MANIFEST.in

This file was deleted.

9 changes: 8 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~~~~~~

Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion docs/conformance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,6 +15,8 @@ following versions of Python:

* Python 3.12

* Python 3.13


Installing ``webcolors``
------------------------
Expand Down
13 changes: 13 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit c55f147

Please sign in to comment.