From 7159c74e9f67a03571d4683f4d43c31f731b88e2 Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Fri, 13 Nov 2026 21:16:42 +0100 Subject: [PATCH 1/2] Remove py38 env --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ece8b148d..646b02029 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] isolated_build = true envlist = - py{38,39,310,311,312,313,314,315} + py{39,310,311,312,313,314,315} pypy3 py{38}-pytz py{311,312,313,314,315}-setuptools From 21f08e1a1c484e5174d1804a5747d95776c04acf Mon Sep 17 00:00:00 2001 From: Tomas Roun Date: Fri, 13 Nov 2026 21:27:18 +0100 Subject: [PATCH 2/2] Update tox + switch to dependency groups --- .github/workflows/ci.yml | 2 +- CONTRIBUTING.md | 2 +- pyproject.toml | 22 +++++++++++++--------- tox.ini | 10 +++++----- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b31f805b..f6581a386 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,7 +119,7 @@ jobs: with: python-version: "3.14" activate-environment: 'true' - - run: uv pip install -e .[dev] pytest-codspeed + - run: uv pip install -e . --group dev pytest-codspeed - run: make import-cldr - uses: CodSpeedHQ/action@88472375d0a4572cf70a9f1fe3a4e0ab8da1b924 # v5.0.1 with: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9f39be1cc..65e65c82b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ After you've cloned the repository, 1. Set up a Python virtualenv (the methods vary depending on tooling and operating system) and activate it. -2. Install Babel in editable mode with development dependencies: `pip install -e .[dev]` +2. Install Babel in editable mode with development dependencies: `pip install -e . --group dev` 3. Run `make import-cldr` to import the CLDR database. This will download the CLDR database and convert it to a format that Babel can use. 4. Run `make test` to run the tests. You can also run e.g. `pytest --cov babel .` to diff --git a/pyproject.toml b/pyproject.toml index d873f86c0..8b85ee256 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,22 +37,26 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", ] -[project.optional-dependencies] -# TODO: use a `dev` dependency group instead -dev = [ +[project.urls] +Homepage = "https://babel.pocoo.org/" +Source = "https://github.com/python-babel/babel" + +[dependency-groups] +# Bare minimum to run the test suite +test = [ "freezegun~=1.0", - "jinja2>=3.0", "pytest-cov", "pytest>=6.0", + "tzdata;sys_platform == 'win32'", +] +# Optional packages Babel integrates with +dev = [ + { include-group = "test" }, + "jinja2>=3.0", "pytz", "setuptools", - "tzdata;sys_platform == 'win32'", ] -[project.urls] -Homepage = "https://babel.pocoo.org/" -Source = "https://github.com/python-babel/babel" - [tool.hatch.version] path = "babel/__init__.py" diff --git a/tox.ini b/tox.ini index 646b02029..43a00abfd 100644 --- a/tox.ini +++ b/tox.ini @@ -3,15 +3,15 @@ isolated_build = true envlist = py{39,310,311,312,313,314,315} pypy3 - py{38}-pytz - py{311,312,313,314,315}-setuptools - py{312,313,314,315}-jinja + py314-bare [testenv] # The CLDR data is imported by `commands`, so isn't there yet when packaging package = editable -extras = - dev +dependency_groups = + !bare: dev + # The bare environment runs the tests without optional dependencies (pytz, jinja2, setuptools) + bare: test deps = # On Python 3.9, we need a version of Setuptools that still has pkg_resources # to be able to run the Jinja extractor tests.