Skip to content

Commit 5c164dc

Browse files
committed
Switch to uv
1 parent a0378ba commit 5c164dc

File tree

8 files changed

+1244
-56
lines changed

8 files changed

+1244
-56
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,20 @@ jobs:
1616
uses: actions/setup-python@v5
1717
with:
1818
python-version: "3.10"
19-
- name: Install dependencies
20-
run: |
21-
python -m pip install --upgrade "build>=1.3.0" "twine>=6.1.0"
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v6
21+
with:
22+
enable-cache: true
23+
cache-dependency-glob: "uv.lock"
24+
version-file: "pyproject.toml"
2225
- name: Build package
2326
run: |
24-
python -m build .
27+
uv build
2528
- name: Check long description
26-
run: python -m twine check dist/*
29+
run: uv run --only-group publish twine check dist/*
2730
- name: Publish package on PyPI
2831
env:
2932
TWINE_USERNAME: __token__
3033
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
3134
run: |
32-
twine upload dist/*
35+
uv run --only-group publish twine upload dist/*

.github/workflows/tests.yml

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,20 @@ jobs:
2626
uses: actions/setup-python@v5
2727
with:
2828
python-version: ${{ matrix.python-version }}
29-
- name: Install dependencies
30-
run: |
31-
python -m pip install --upgrade pip wheel setuptools
32-
python -m pip install coveralls
33-
python -m pip install -r requirements/dev.txt
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v6
31+
with:
32+
enable-cache: true
33+
cache-dependency-glob: "uv.lock"
34+
version-file: "pyproject.toml"
3435
- name: Run tests
3536
run: |
36-
python -m pytest --cov-report term-missing --cov=rohrpost tests
37+
uv run pytest --cov-report term-missing --cov=rohrpost tests
3738
- name: Publish coverage
3839
env:
3940
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4041
run: |
41-
coveralls --service=github
42+
uv run coveralls --service=github
4243
4344
lint:
4445
runs-on: ubuntu-latest
@@ -48,28 +49,30 @@ jobs:
4849
uses: actions/setup-python@v5
4950
with:
5051
python-version: "3.10"
51-
- name: Install dependencies
52-
run: |
53-
python -m pip install --upgrade pip wheel setuptools
54-
python -m pip install -r requirements/dev.txt
52+
- name: Install uv
53+
uses: astral-sh/setup-uv@v6
54+
with:
55+
enable-cache: true
56+
cache-dependency-glob: "uv.lock"
57+
version-file: "pyproject.toml"
5558
- name: Check code format
5659
run: |
57-
python -m black --check --verbose --diff src/rohrpost tests
60+
uv run black --check --verbose --diff src/rohrpost tests
5861
- name: Check imports
5962
run: |
60-
python -m isort --check --diff .
63+
uv run isort --check --diff .
6164
- name: Check types
6265
run: |
63-
python -m mypy src/rohrpost
66+
uv run mypy src/rohrpost
6467
- name: Check code with flake8
6568
run: |
66-
python -m flake8
69+
uv run flake8
6770
- name: Check code with pylint
6871
run: |
69-
python -m pylint --recursive=y --reports=y --verbose ./
72+
uv run pylint --recursive=y --reports=y --verbose ./
7073
- name: Check manifest
7174
run: |
72-
python -m check_manifest
75+
uv run check-manifest
7376
7477
docs:
7578
runs-on: ubuntu-latest
@@ -79,10 +82,12 @@ jobs:
7982
uses: actions/setup-python@v5
8083
with:
8184
python-version: "3.10"
82-
- name: Install dependencies
83-
run: |
84-
python -m pip install --upgrade pip wheel setuptools
85-
python -m pip install -r doc/requirements.txt
85+
- name: Install uv
86+
uses: astral-sh/setup-uv@v6
87+
with:
88+
enable-cache: true
89+
cache-dependency-glob: "uv.lock"
90+
version-file: "pyproject.toml"
8691
- name: Build documentation
8792
run: cd doc && make html
8893

@@ -94,10 +99,13 @@ jobs:
9499
uses: actions/setup-python@v5
95100
with:
96101
python-version: "3.10"
97-
- name: Install dependencies
98-
run: |
99-
python -m pip install --upgrade pip "build>=1.2.1" "twine>=5.1.1"
102+
- name: Install uv
103+
uses: astral-sh/setup-uv@v6
104+
with:
105+
enable-cache: true
106+
cache-dependency-glob: "uv.lock"
107+
version-file: "pyproject.toml"
100108
- name: Build package
101-
run: python -m build .
109+
run: uv build
102110
- name: Check long description
103-
run: python -m twine check dist/*
111+
run: uv run --only-group publish twine check dist/*

doc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# You can set these variables from the command line.
55
SPHINXOPTS =
6-
SPHINXBUILD = python -msphinx
6+
SPHINXBUILD = uv run --only-group doc sphinx-build
77
SPHINXPROJ = rohrpost
88
SOURCEDIR = .
99
BUILDDIR = _build
@@ -17,4 +17,4 @@ help:
1717
# Catch-all target: route all unknown targets to Sphinx using the new
1818
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919
%: Makefile
20-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

doc/conf.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
# import os
2222
# import sys
2323
# sys.path.insert(0, os.path.abspath('.'))
24-
from typing import Dict
2524

2625
# -- General configuration ------------------------------------------------
2726

@@ -48,8 +47,8 @@
4847

4948
# General information about the project.
5049
project = 'rohrpost'
51-
copyright = '2017, AX semantics' # noqa: A001 # pylint: disable=redefined-builtin
52-
author = 'AX semantics'
50+
copyright = '2017–2015, AX Semantics GmbH' # noqa: A001 # pylint: disable=redefined-builtin
51+
author = 'AX Semantics GmbH'
5352

5453
# The version info for the project you're documenting, acts as replacement for
5554
# |version| and |release|, also used in various other places throughout the
@@ -65,7 +64,7 @@
6564
#
6665
# This is also used if you do content translation via gettext catalogs.
6766
# Usually you set "language" from the command line for these cases.
68-
language = None
67+
language = "en"
6968

7069
# List of patterns, relative to source directory, that match files and
7170
# directories to ignore when looking for source files.
@@ -95,7 +94,7 @@
9594
# Add any paths that contain custom static files (such as style sheets) here,
9695
# relative to this directory. They are copied after the builtin static files,
9796
# so a file named "default.css" will overwrite the builtin "default.css".
98-
html_static_path = ['_static']
97+
# html_static_path = ['_static']
9998

10099
# Custom sidebar templates, must be a dictionary that maps document names
101100
# to template names.
@@ -121,7 +120,7 @@
121120

122121
# -- Options for LaTeX output ---------------------------------------------
123122

124-
latex_elements: Dict[str, str] = {
123+
latex_elements: dict[str, str] = {
125124
# The paper size ('letterpaper' or 'a4paper').
126125
#
127126
# 'papersize': 'letterpaper',

doc/requirements.txt

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

pyproject.toml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,35 @@ Changelog = "https://github.com/axsemantics/rohrpost/blob/main/CHANGELOG.rst"
3737
Source = "https://github.com/axsemantics/rohrpost"
3838
Tracker = "https://github.com/axsemantics/rohrpost/issues"
3939

40+
[dependency-groups]
41+
cicd = [
42+
"uv>=0.8.13",
43+
]
44+
dev = [
45+
"black>=25.1.0",
46+
"channels>=4.3.1",
47+
"check-manifest>=0.50",
48+
"flake8>=7.3.0",
49+
"flake8-annotations-complexity>=0.1.0",
50+
"flake8-builtins>=3.0.0",
51+
"flake8-comprehensions>=3.16.0",
52+
"isort>=6.0.1",
53+
"mypy>=1.17.1",
54+
"Pygments>=2.19.2",
55+
"pylint>=3.3.8",
56+
"pytest>=8.4.1",
57+
"pytest-cov>=6.2.1",
58+
"types-setuptools>=80.9.0.20250822",
59+
]
60+
doc = [
61+
"sphinx>=8.1.3",
62+
"sphinx_rtd_theme>=3.0.2",
63+
]
64+
publish = [
65+
"twine>=6.1.0",
66+
]
67+
68+
4069
[tool.setuptools]
4170
include-package-data = true
4271

@@ -56,6 +85,7 @@ ignore = [
5685
"doc/*",
5786
"requirements/*",
5887
"tests/*",
88+
"uv.lock",
5989
]
6090

6191

@@ -64,6 +94,14 @@ balanced_wrapping = true
6494
profile = "black"
6595

6696

97+
[tool.pylint.main]
98+
ignore = [
99+
".mypy_cache",
100+
".pytest_cache",
101+
".venv",
102+
"dist",
103+
]
104+
67105
[tool.pylint."messages control"]
68106
disable = [
69107
"duplicate-code",
@@ -73,3 +111,14 @@ disable = [
73111

74112
[tool.pytest.ini_options]
75113
pythonpath = ["src"]
114+
115+
116+
[tool.uv]
117+
environments = [
118+
"platform_machine == 'x86_64' and sys_platform == 'linux'",
119+
]
120+
121+
[[tool.uv.index]]
122+
name = "PyPI"
123+
url = "https://pypi.org/simple"
124+
default = true

requirements/dev.txt

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

0 commit comments

Comments
 (0)