Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

Commit 55b00a7

Browse files
authored
pipenv to uv (#37)
1 parent 3a0312b commit 55b00a7

10 files changed

Lines changed: 1382 additions & 805 deletions

File tree

.github/workflows/publish-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ jobs:
1414
version: '${{ github.run_number }}.0.0'
1515
repository: testpypi
1616
secrets:
17-
twine_username: __token__
18-
twine_password: ${{ secrets.TESTPYPI_TOKEN }}
17+
twine_token: ${{ secrets.TESTPYPI_TOKEN }}
18+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/publish-main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ jobs:
1212
# so easy to forget bumping the version to match the tag, just override it!
1313
version: ${{ github.ref_name }}
1414
secrets:
15-
twine_username: __token__
16-
twine_password: ${{ secrets.PYPI_TOKEN }}
15+
twine_token: ${{ secrets.PYPI_TOKEN }}
16+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/publish.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,31 @@ on:
1010
default: pypi
1111
type: string
1212
secrets:
13-
twine_username:
13+
twine_token:
1414
required: true
15-
twine_password:
15+
CODECOV_TOKEN:
16+
required: false
17+
workflow_dispatch:
18+
inputs:
19+
version:
20+
description: 'Version to publish (for example: 1.2.3)'
21+
type: string
1622
required: true
23+
repository:
24+
description: 'Package index repository'
25+
type: choice
26+
options:
27+
- pypi
28+
- testpypi
29+
default: pypi
1730

1831
run-name: publish to ${{ inputs.repository }}
1932

2033
jobs:
2134
test:
2235
uses: ./.github/workflows/test.yml
36+
secrets:
37+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2338

2439
publish:
2540
name: publish to ${{ inputs.repository }}
@@ -36,21 +51,18 @@ jobs:
3651

3752
- name: Install dependencies
3853
run: |
39-
pip install pipenv
40-
pipenv requirements --dev > reqs.txt
41-
pip install -r reqs.txt
54+
pip install uv
55+
uv sync --dev
4256
- name: force right version
4357
run: |
4458
.github/change_version.py --set '${{ inputs.version }}'
4559
- name: Build
46-
run: pyproject-build
60+
run: uv run pyproject-build
4761
- name: Publish
4862
env:
49-
TWINE_USERNAME: ${{ secrets.twine_username }}
50-
TWINE_PASSWORD: ${{ secrets.twine_password }}
51-
run: |
52-
pyproject-build
53-
twine upload --repository ${{ inputs.repository }} dist/*
63+
TWINE_USERNAME: __token__
64+
TWINE_PASSWORD: ${{ secrets.twine_token }}
65+
run: uv run twine upload --verbose --repository ${{ inputs.repository }} dist/*
5466
- name: highlight
5567
run: |
5668
INDEX=""

.github/workflows/test.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: 🧪 tests
22

33
on:
44
workflow_call:
5+
secrets:
6+
CODECOV_TOKEN:
7+
required: false
58
push:
69
branches-ignore:
710
# these are already tested by publish-dev
@@ -23,9 +26,8 @@ jobs:
2326

2427
- name: Install dependencies
2528
run: |
26-
pip install pipenv
27-
pipenv requirements --dev > reqs.txt
28-
pip install -r reqs.txt
29+
pip install uv
30+
uv sync --dev
2931
3032
- name: Lint check
3133
run: |
@@ -47,20 +49,18 @@ jobs:
4749

4850
- name: Install dependencies
4951
run: |
50-
pip install pipenv
51-
pipenv requirements --dev > reqs.txt
52-
pip install -r reqs.txt
52+
pip install uv
53+
uv sync --dev
5354
5455
- name: Run unit tests
5556
run: |
5657
make test
5758
5859
- name: Upload results to Codecov
59-
uses: codecov/codecov-action@v4
60-
61-
- name: Upload test results to Codecov
62-
if: ${{ !cancelled() }}
63-
uses: codecov/test-results-action@v1
60+
uses: codecov/codecov-action@v5
61+
with:
62+
token: ${{ secrets.CODECOV_TOKEN }}
63+
report_type: test_results
6464

6565
integration-test:
6666
runs-on: ubuntu-latest
@@ -75,9 +75,8 @@ jobs:
7575

7676
- name: Install dependencies
7777
run: |
78-
pip install pipenv
79-
pipenv requirements --dev > reqs.txt
80-
pip install -r reqs.txt
78+
pip install uv
79+
uv sync --dev
8180
8281
- name: Run e2e tests
8382
run: |

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
## Build
22

3-
This project uses a `Pipfile`, so set up the virtualenv by running
3+
This project uses `uv`, so set up the virtualenv by running
44

55
```
6-
pipenv install --dev
6+
uv sync --dev
77
```
88

99
Use `make test` to make sure all tests pass before pushing.
@@ -12,4 +12,4 @@ Use `make lint` to make sure lint check passes before pushing.
1212

1313
## Guidelines
1414

15-
...
15+
...

Makefile

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
lint:
2-
ruff format
3-
ruff check --fix
4-
pyproject-pipenv --fix
2+
uv run ruff format
3+
uv run ruff check --fix
54

65
lint-check:
7-
ruff format --diff
8-
ruff check
9-
pyproject-pipenv
6+
uv run ruff format --diff
7+
uv run ruff check
108

119
test:
1210
if [ -n "$(GITHUB_RUN_ID)" ]; then \
13-
python -m pytest --cov --cov-report=xml --junitxml=junit.xml -o junit_family=legacy; \
11+
uv run pytest --cov --cov-report=xml --junitxml=junit.xml -o junit_family=legacy; \
1412
else \
15-
python -m pytest --cov; \
13+
uv run pytest --cov; \
1614
fi
1715

1816
test-e2e: export DD_INTEGRATION_TESTS=1
1917
test-e2e:
20-
python -m pytest tests/integration
18+
uv run pytest tests/integration
2119

2220
testpub:
2321
rm -fr dist
24-
pyproject-build
25-
twine upload --repository testpypi dist/*
22+
uv run pyproject-build
23+
uv run twine upload --repository testpypi dist/*
2624

2725
schema:
2826
./support/openapi/fetch_openapi.py

Pipfile

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

0 commit comments

Comments
 (0)