Skip to content

Commit 94fd055

Browse files
committed
Merge remote-tracking branch 'origin/main' into cln/type-hints
2 parents 918d29f + fe6546d commit 94fd055

6 files changed

Lines changed: 369 additions & 26 deletions

File tree

.github/workflows/on-commit.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,25 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
python-version: ['3.8', '3.10', '3.12', '3.13', '3.14', 'pypy3.11']
13+
python-version: ['3.10', '3.12', '3.13', '3.14', '3.14t', 'pypy3.11']
1414

1515
steps:
1616
- uses: actions/checkout@v5
17-
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v6
17+
- uses: astral-sh/setup-uv@v6
1918
with:
20-
python-version: ${{ matrix.python-version }}
21-
cache: 'pip'
22-
cache-dependency-path: 'requirements/test.txt'
23-
allow-prereleases: true
24-
- name: Install dependencies
25-
run: python -m pip install -r requirements/test.txt
19+
version: "0.9.7"
2620
- name: Check types with mypy
27-
run: python -m mypy .
28-
# Skip type check for Python 3.14, since it's hitting an argparse-related
29-
# issue in mypy: https://github.com/python/mypy/pull/19020
30-
if: matrix.python-version != '3.14'
21+
run: uv run --python ${{ matrix.python-version }} mypy
3122
- name: Test with pytest
32-
run: python -m pytest
23+
run: uv run --python ${{ matrix.python-version }} pytest
3324

3425
style:
3526
runs-on: ubuntu-latest
3627

3728
steps:
3829
- uses: actions/checkout@v5
39-
- name: Install ruff and apply 'ruff check'
40-
uses: astral-sh/ruff-action@v3
41-
with:
42-
version: 'latest'
43-
- name: Check for formatting changes
44-
run: ruff format --check --diff
30+
- uses: astral-sh/setup-uv@v6
31+
- name: Lint
32+
run: uvx ruff check
33+
- name: Check formatting
34+
run: uvx ruff format --check

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Python bytecode
22
*.pyc
33

4+
# Coverage database
5+
.coverage
6+
47
# Build and distribution
58
/dist/
69
/src/*.egg-info/

DEVELOP.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Development quick start
2+
3+
We recommend using [uv](https://github.com/astral-sh/uv) for development tasks.
4+
5+
We use `mypy` in strict mode for type checking, `pytest` for testing,
6+
and `ruff` for linting and formatting.
7+
8+
From the root directory of the repository:
9+
10+
- Run `uv run mypy` to check types.
11+
- Run `uv run pytest` to execute the test suite.
12+
- Run `uv run coverage run` to execute the test suite under coverage.
13+
- Run `uvx ruff check` for linting checks.
14+
- Run `uvx ruff format` to format the code.

pyproject.toml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
[build-system]
2-
requires = ['setuptools>=77.0.3', 'setuptools-scm>=8', 'wheel']
3-
build-backend = 'setuptools.build_meta'
2+
requires = ["uv_build>=0.9.7,<0.10.0"]
3+
build-backend = "uv_build"
44

55
[project]
66
name = 'simplefractions'
7+
version = '1.4.0'
78
description = 'Find the simplest fraction for a given float or interval'
89
readme = 'README.md'
9-
requires-python = '>=3.8'
10+
requires-python = '>=3.10'
1011
authors = [{name = 'Mark Dickinson', email = 'dickinsm@gmail.com'}]
1112
keywords = ['fractions', 'continued fractions', 'approximation']
1213
classifiers = [
@@ -15,13 +16,31 @@ classifiers = [
1516
'Programming Language :: Python :: 3',
1617
'Topic :: Scientific/Engineering :: Mathematics',
1718
]
18-
dynamic = ['version']
1919

2020
[project.urls]
2121
source = 'https://github.com/mdickinson/simplefractions'
2222

23+
[dependency-groups]
24+
dev = [
25+
"coverage>=7.6.1",
26+
"mypy>=1.14.1",
27+
"pytest>=8.3.5",
28+
]
29+
30+
[tool.coverage.run]
31+
branch = true
32+
source_pkgs = ["simplefractions"]
33+
command_line = "-m pytest"
34+
2335
[tool.mypy]
36+
packages = ["simplefractions"]
2437
strict = true
2538

39+
[tool.pytest.ini_options]
40+
addopts = ["--pyargs", "--import-mode=importlib"]
41+
42+
[tool.ruff]
43+
target-version = "py310"
44+
2645
[tool.ruff.lint]
2746
extend-select = ["I", "UP", "W"] # isort, pyupgrade, pycodestyle warnings

requirements/test.txt

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

0 commit comments

Comments
 (0)