Skip to content

Commit b5a44b8

Browse files
authored
Merge pull request #426 from palewire/uv
Upgrade from pipenv to uv
2 parents 8040cc4 + 5d41725 commit b5a44b8

24 files changed

Lines changed: 2117 additions & 1439 deletions

.github/workflows/continuous-deployment.yml

Lines changed: 53 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -15,89 +15,80 @@ jobs:
1515
steps:
1616
- id: checkout
1717
name: Checkout
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v5
1919

20-
- id: setup-python
21-
name: Setup Python
22-
uses: actions/setup-python@v4
20+
- id: check-ruff
21+
name: Check with Ruff
22+
uses: astral-sh/ruff-action@v3
2323
with:
24-
python-version: '3.10'
25-
cache: 'pipenv'
24+
args: 'check --exit-zero --verbose'
25+
src: './datawrapper'
2626

27-
- id: install-pipenv
28-
name: Install pipenv
29-
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
30-
shell: bash
31-
32-
- id: install-python-dependencies
33-
name: Install Python dependencies
34-
run: pipenv sync --dev
35-
shell: bash
36-
37-
- id: lint
38-
name: Lint Python code
39-
run: pipenv run flake8 ./datawrapper --verbose
40-
shell: bash
27+
- id: format-ruff
28+
name: Format with Ruff
29+
uses: astral-sh/ruff-action@v3
30+
with:
31+
args: 'format --check --verbose'
32+
src: './datawrapper'
4133

4234
mypy-python:
43-
name: Static-types check
35+
name: Check Python static typing
4436
runs-on: ubuntu-latest
4537
steps:
46-
- name: Checkout
47-
uses: actions/checkout@v4
38+
- id: checkout
39+
name: Checkout
40+
uses: actions/checkout@v5
4841

49-
- id: setup-python
50-
name: Setup Python
51-
uses: actions/setup-python@v4
42+
- id: install-uv
43+
name: Install uv
44+
uses: astral-sh/setup-uv@v6
5245
with:
53-
python-version: '3.10'
54-
cache: 'pipenv'
46+
version: "latest"
47+
enable-cache: true
48+
cache-dependency-glob: '**/pyproject.toml'
5549

56-
- id: install-pipenv
57-
name: Install pipenv
58-
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
59-
shell: bash
50+
- id: install-python
51+
name: Install Python
52+
run: uv python install 3.13
6053

6154
- id: install-python-dependencies
6255
name: Install Python dependencies
63-
run: pipenv sync --dev
64-
shell: bash
56+
run: uv sync --extra mypy
6557

6658
- id: mypy
6759
name: Run mypy
68-
run: pipenv run mypy ./datawrapper --ignore-missing-imports --verbose
69-
shell: bash
60+
run: uv run mypy ./ --ignore-missing-imports
7061

7162
test-python:
7263
name: Test Python code
7364
runs-on: ubuntu-latest
7465
strategy:
7566
matrix:
76-
python: ['3.8', '3.9', '3.10', '3.11']
67+
python: ['3.10', '3.11', '3.12', '3.13']
7768
steps:
7869
- name: Checkout
79-
uses: actions/checkout@v4
70+
uses: actions/checkout@v5
8071

81-
- id: setup-python
82-
name: Setup Python
83-
uses: actions/setup-python@v4
72+
- id: install-uv
73+
name: Install uv
74+
uses: astral-sh/setup-uv@v6
8475
with:
85-
python-version: '${{ matrix.python }}'
86-
cache: 'pipenv'
76+
version: "latest"
77+
enable-cache: true
78+
cache-dependency-glob: '**/pyproject.toml'
8779

88-
- id: install-pipenv
89-
name: Install pipenv
90-
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
91-
shell: bash
80+
- id: install-python
81+
name: Install Python
82+
run: uv python install ${{ matrix.python }}
9283

9384
- id: install-python-dependencies
9485
name: Install Python dependencies
95-
run: pipenv install --dev --python=${{ matrix.python }} --skip-lock
86+
run: uv sync --extra test --python ${{ matrix.python }}
9687
shell: bash
9788

9889
- id: tests
9990
name: Run tests
100-
run: pipenv run python -m pytest --cov -sv
91+
run: uv run pytest --cov -sv
10192
shell: bash
10293

10394
build:
@@ -106,38 +97,23 @@ jobs:
10697
needs: [test-python]
10798
steps:
10899
- name: Checkout
109-
uses: actions/checkout@v4
100+
uses: actions/checkout@v5
110101

111-
- id: setup-python
112-
name: Setup Python
113-
uses: actions/setup-python@v4
102+
- id: install-uv
103+
name: Install uv
104+
uses: astral-sh/setup-uv@v6
114105
with:
115-
python-version: '3.10'
116-
cache: 'pipenv'
117-
118-
- id: install-pipenv
119-
name: Install pipenv
120-
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python
121-
shell: bash
122-
123-
- id: install-python-dependencies
124-
name: Install Python dependencies
125-
run: pipenv install --dev --deploy
126-
shell: bash
106+
version: "latest"
107+
enable-cache: true
108+
cache-dependency-glob: '**/pyproject.toml'
127109

128-
- id: build-source
129-
name: Build source release
130-
run: pipenv run python setup.py sdist
131-
shell: bash
132-
133-
- id: build-binary
134-
name: Build binary release
135-
run: pipenv run python setup.py bdist_wheel
136-
shell: bash
110+
- id: install-python
111+
name: Install Python
112+
run: uv python install 3.13
137113

138-
- id: check
139-
name: Check release
140-
run: pipenv run twine check dist/*
114+
- id: build
115+
name: Build releases
116+
run: uv build --sdist --wheel
141117
shell: bash
142118

143119
- id: save

.pre-commit-config.yaml

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,48 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
13
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
4+
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
5+
rev: v6.0.0
46
hooks:
5-
- id: trailing-whitespace
6-
- id: end-of-file-fixer
7-
- id: check-yaml
8-
- id: check-added-large-files
9-
- id: check-byte-order-marker
10-
- id: check-case-conflict
11-
- id: check-json
12-
- id: mixed-line-ending
13-
- id: check-ast
14-
- id: check-merge-conflict
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
args:
12+
- '--maxkb=100000'
13+
- id: fix-byte-order-marker
14+
- id: check-case-conflict
15+
- id: check-json
16+
- id: mixed-line-ending
17+
- id: check-ast
18+
- id: check-merge-conflict
1519

16-
- repo: https://github.com/psf/black
17-
rev: 23.9.1
20+
- repo: 'https://github.com/astral-sh/ruff-pre-commit'
21+
rev: v0.13.3
1822
hooks:
19-
- id: black
23+
- id: ruff
24+
args:
25+
- '--fix'
26+
- id: ruff-format
2027

21-
- repo: https://github.com/asottile/blacken-docs
22-
rev: 1.16.0
28+
- repo: 'https://github.com/asottile/blacken-docs'
29+
rev: 1.20.0
2330
hooks:
24-
- id: blacken-docs
25-
additional_dependencies: [black]
26-
27-
- repo: https://github.com/timothycrosley/isort
28-
rev: 5.12.0
29-
hooks:
30-
- id: isort
31-
args: ["--profile", "black", "--filter-files"]
32-
33-
- repo: https://github.com/pycqa/flake8
34-
rev: 6.1.0
35-
hooks:
36-
- id: flake8
37-
additional_dependencies:
38-
- flake8-bugbear
39-
- flake8-docstrings
31+
- id: blacken-docs
32+
additional_dependencies:
33+
- black
4034

41-
- repo: https://github.com/asottile/pyupgrade
42-
rev: v3.15.0
35+
- repo: 'https://github.com/asottile/pyupgrade'
36+
rev: v3.20.0
4337
hooks:
44-
- id: pyupgrade
45-
args: [--py37-plus]
38+
- id: pyupgrade
39+
args:
40+
- '--py37-plus'
4641

47-
- repo: https://github.com/pre-commit/mirrors-mypy
48-
rev: v1.6.0
42+
- repo: 'https://github.com/pre-commit/mirrors-mypy'
43+
rev: v1.18.2
4944
hooks:
50-
- id: mypy
45+
- id: mypy
5146
additional_dependencies:
47+
- pydantic-settings
5248
- types-requests

Pipfile

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

0 commit comments

Comments
 (0)