Skip to content

Commit

Permalink
Prep for 24.11.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
ubernostrum committed Nov 10, 2024
1 parent 21ac60c commit 3761316
Show file tree
Hide file tree
Showing 17 changed files with 442 additions and 350 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,6 @@ 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
82 changes: 55 additions & 27 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ have been set up to make the process easier for everyone (including
you!).


Dev environment recommendations
-------------------------------
Prerequisites
-------------

* Please use a code editor/IDE that supports `EditorConfig
<https://editorconfig.org>`_. Most editors do nowadays, so you
Expand All @@ -18,43 +18,77 @@ Dev environment recommendations
installed, and in your local checkout of this repository run
``pre-commit install`` to set up the pre-commit hooks.

* Please have `nox <https://nox.thea.codes/en/stable/>`_ installed on
your computer, and run at least the unit-test suite (``python -m nox
--tag tests``) before you push your commits to GitHub. If you can
manage it, installing the full set of supported Python versions and
running the entire suite (``python -m nox``) is even better. Tools
like `pyenv <https://github.com/pyenv/pyenv>`_ or ``asdf
<https://asdf-vm.com>`_ can help with installing and managing
multiple Python versions.
The following two tools are *required* for working with this
repository:

Following these steps will catch a lot of potential problems for you,
and can even fix several of them automatically.
* `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
``akismet`` 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/testing.rst``.


Code style
----------

The pre-commit hooks will auto-format code with `isort
<https://pycqa.github.io/isort/>`_ and `Black
<https://black.readthedocs.io/>`_. Most editors and IDEs also support
<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 versions of Python currently
supported by the Python core team. See `the Python dev guide
<https://devguide.python.org/versions/>`_ for a current chart of
supported versions.
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 on the first line after the file's
docstring. You can copy and paste the license identifier comment
from any existing file, where it looks like this: ``#
SPDX-License-Identifier: BSD-3-Clause``
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
Expand All @@ -67,9 +101,3 @@ Other guidelines
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``).

* Other than the tests in the special ``tests/end_to_end.py`` file,
tests for this module must not make real requests to the Akismet web
service and must not require a valid Akismet API key -- see the
existing test files for examples of how to write tests that use mock
responses.
14 changes: 0 additions & 14 deletions MANIFEST.in

This file was deleted.

8 changes: 8 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ 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 Python 3.9, 3.10, 3.11, 3.12, and 3.13.


Version 24.5.1
~~~~~~~~~~~~~~

Expand Down
5 changes: 2 additions & 3 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ What versions of Python are supported?

The |release| release of ``akismet`` supports the following versions of Python:


* Python 3.8

* Python 3.9

* Python 3.10
Expand All @@ -23,6 +20,8 @@ The |release| release of ``akismet`` supports the following versions of Python:

* Python 3.12

* Python 3.13

Older versions of Python are not supported and will cause errors.


Expand Down
28 changes: 8 additions & 20 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ Installation guide
The |release| version of ``akismet`` 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 @@ on the following versions of Python:

* Python 3.12

* Python 3.13


Installing ``akismet``
----------------------
Expand Down Expand Up @@ -74,10 +74,11 @@ default to ``1.0`` (one second).

.. _source-install:

Installing from a source checkout
---------------------------------
Installing for local development
--------------------------------

If you want to work on ``akismet``, you can obtain a source checkout.
If you want to work on ``akismet``, you can obtain a source
checkout.

The development repository for ``akismet`` is at
<https://github.com/ubernostrum/akismet>. If you have `git
Expand All @@ -86,18 +87,5 @@ typing::

git clone https://github.com/ubernostrum/akismet.git

From there, you can use git commands to check out the specific revision you
want, and perform an "editable" install (allowing you to change code as you
work on it) by typing:

.. tab:: macOS/Linux/other Unix

.. code-block:: shell
python -m pip install -e .
.. tab:: Windows

.. code-block:: shell
py -m pip install -e .
Then follow the instructions in the file ``CONTRIBUTING.rst`` in the root
directory of the source checkout.
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
10 changes: 3 additions & 7 deletions docs/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ Running this library's tests

A standard install of ``akismet`` does not install the test suite; you will
need to perform :ref:`a source checkout as described in the installation guide
<source-install>`, though performing the "editable" install step is not
necessary for running the tests.
<source-install>`.

``akismet``'s testing tasks are run using `nox <https://nox.thea.codes/>`_, so
you will also need to install it, after which you can run ``nox``, which should
Expand Down Expand Up @@ -190,11 +189,8 @@ example, to run tasks for Python 3.10 only, you could run:
py -m nox --python "3.10"
By default, ``nox`` will only run the tasks whose associated Python versions
are available on your system. For example, if you have only Python 3.8 and 3.9
installed, test runs for Python 3.10, 3.11, and 3.12 would be skipped. To
install and manage multiple versions of Python, tools like `pyenv
<https://github.com/pyenv/pyenv>`_ or `asdf <https://asdf-vm.com>`_ are
recommended.
are available on your system. For example, if you have only Python 3.9 and 3.13
installed, test runs for Python 3.10, 3.11, and 3.12 would be skipped.

To see a list of all available test tasks, run:

Expand Down
Loading

0 comments on commit 3761316

Please sign in to comment.