Skip to content

Commit 72260eb

Browse files
authored
Use uv for dependencies and packaging (#449)
* switch from setup.py to uv * reduce dependencies lower bounds It looks like pytest only supports '-p=no:randomly' since v8.0.0. For backwards compatibility, we now use '-p', 'no:randomly' * ci: use uv in github actions * try to fix segmentation fault in CI
1 parent b6c8b6b commit 72260eb

20 files changed

+583
-255
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,14 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v5
1616

17-
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v6
17+
- name: Install uv and set the Python version
18+
uses: astral-sh/setup-uv@v6
1919
with:
2020
python-version: ${{ matrix.python-version }}
21+
enable-cache: true
2122

2223
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
pip install -r requirements.txt
26-
pip install -r test_requirements.txt
24+
run: uv sync --locked --dev
2725

2826
- name: Run tests
29-
run: python -m pytest
30-
continue-on-error: false
27+
run: uv run pytest

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

CONTRIBUTING.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ Setup
66

77
First fork the repository and clone your fork.
88

9-
Install the dependencies:
9+
We use [uv](https://docs.astral.sh/uv/) to manage dependencies.
10+
All `uv` commands will implicitly install the required dependencies,
11+
however you can also explicitly install them with `uv sync`:
1012

1113
.. code-block:: console
1214
13-
pip install -r requirements.txt -r test_requirements.txt
15+
uv sync
1416
1517
Running the tests
1618
-----------------
1719

1820
.. code-block:: console
1921
20-
pytest
22+
uv run pytest
2123
2224
This also runs E2E tests that verify that `mutmut run` produces the same output as before. If your code changes should change the output of `mutmut run` and this test fails, try to delete the `snapshots/*.json` files (as described in the test errors).
2325

MANIFEST.in

Lines changed: 0 additions & 6 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 52 deletions
This file was deleted.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ You can add and override pytest arguments:
206206
.. code-block:: python
207207
208208
# for CLI args that select or deselect tests, use `pytest_add_cli_args_test_selection`
209-
pytest_add_cli_args_test_selection = ["-m", "not fail", "-k=test_include"]
209+
pytest_add_cli_args_test_selection = ["-m", "not fail", "-k", "test_include"]
210210
211211
# for other CLI args, use `pytest_add_cli_args`
212212
pytest_add_cli_args = ["-p", "no:some_plugin"] # disable a plugin

pyproject.toml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[project]
2+
name = "mutmut"
3+
version = "3.3.1"
4+
description = "mutation testing for Python 3"
5+
keyowrds = ["mutmut", "mutant", "mutation", "test", "testing"]
6+
authors = [
7+
{ name = "Anders Hovmöller", email = "[email protected]" },
8+
]
9+
requires-python = ">=3.10"
10+
readme = "README.rst"
11+
license = "BSD-3-Clause"
12+
license-files = ["LICENSE"]
13+
14+
classifiers = [
15+
"Development Status :: 4 - Beta",
16+
"Intended Audience :: Developers",
17+
"Natural Language :: English",
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
22+
"Programming Language :: Python :: 3.13",
23+
"Programming Language :: Python :: 3.14",
24+
]
25+
26+
dependencies = [
27+
"click>=8.0.0",
28+
"coverage>=7.3.0",
29+
"libcst>=1.8.5",
30+
"pytest>=6.2.5",
31+
"setproctitle>=1.1.0",
32+
"textual>=1.0.0",
33+
"toml>=0.10.2 ; python_full_version < '3.11'",
34+
]
35+
36+
[project.urls]
37+
Homepage = "https://github.com/boxed/mutmut"
38+
Documentation = "https://mutmut.readthedocs.io/en/latest/"
39+
Repository = "https://github.com/boxed/mutmut"
40+
Issues = "https://github.com/boxed/mutmut/issues"
41+
Changelog = "https://github.com/boxed/mutmut/blob/main/HISTORY.rst"
42+
43+
44+
[project.scripts]
45+
mutmut = "mutmut.__main__:cli"
46+
47+
[build-system]
48+
requires = ["uv_build>=0.9.5,<0.10.0"]
49+
build-backend = "uv_build"
50+
51+
[tool.uv.build-backend]
52+
source-include = ["HISTORY.rst"]
53+
54+
[dependency-groups]
55+
dev = [
56+
"pytest-asyncio>=1.0.0",
57+
]
58+
59+
[tool.pytest.ini_options]
60+
testpaths = [
61+
"tests",
62+
]

requirements.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 17 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 112 deletions
This file was deleted.

0 commit comments

Comments
 (0)