Skip to content

Commit 2a99a8f

Browse files
Convert from pipenv to uv
[uv][1] is a better, faster version of pipenv for managing python projects. [1]: https://docs.astral.sh/uv/
1 parent 0f63813 commit 2a99a8f

File tree

11 files changed

+454
-450
lines changed

11 files changed

+454
-450
lines changed

.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7-
- package-ecosystem: "pip"
7+
- package-ecosystem: "uv"
88
directory: "/"
99
schedule:
1010
interval: "weekly"

.github/workflows/ci.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,14 @@ jobs:
2727
uses: actions/setup-go@v5
2828
with:
2929
go-version: stable
30+
- uses: astral-sh/setup-uv@v6
3031
- name: Install Python ${{ matrix.python-version }}
31-
id: python
32-
uses: actions/setup-python@v5
33-
with:
34-
python-version: ${{ matrix.python-version }}
35-
cache: "pipenv"
36-
- run: ${{steps.python.outputs.python-path}} -m pip install --upgrade pip pipenv
32+
run: uv python install ${{ matrix.python-version }}
3733
- name: Execute tests
38-
run: make test PYTHON=${{ steps.python.outputs.python-path }}
34+
run: make test
3935
- name: Lint
40-
run: make lint PYTHON=${{ steps.python.outputs.python-path }}
36+
run: make lint
4137
- name: Format
42-
run: make format PYTHON=${{ steps.python.outputs.python-path }}
38+
run: make format
4339
- name: Check generated
44-
run: make checkgenerate PYTHON=${{ steps.python.outputs.python-path }}
40+
run: make checkgenerate

.github/workflows/conformance.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,8 @@ jobs:
2727
uses: actions/setup-go@v5
2828
with:
2929
go-version: stable
30+
- uses: astral-sh/setup-uv@v6
3031
- name: Install Python ${{ matrix.python-version }}
31-
id: python
32-
uses: actions/setup-python@v5
33-
with:
34-
python-version: ${{ matrix.python-version }}
35-
cache: "pipenv"
36-
- run: ${{steps.python.outputs.python-path}} -m pip install --upgrade pip pipenv
32+
run: uv python install ${{ matrix.python-version }}
3733
- name: Test conformance
38-
run: make conformance PYTHON=${{ steps.python.outputs.python-path }}
34+
run: make conformance

.github/workflows/release.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,18 @@ jobs:
1919
run: |
2020
VERSION=${{github.head_ref}}
2121
echo "VERSION=${VERSION##*/}" >> $GITHUB_ENV
22-
- name: Set up Python
23-
uses: actions/setup-python@v5
24-
with:
25-
python-version: "3.13"
26-
- name: Install pypa/build
22+
- uses: astral-sh/setup-uv@v6
23+
- name: Build release
2724
run: |
28-
python -m pip install build
29-
python -m build
25+
uv build
3026
- uses: actions/upload-artifact@v4
3127
with:
3228
name: package
3329
path: dist/
3430

3531
publish:
32+
# TODO: trusted publisher
33+
# https://docs.astral.sh/uv/guides/publish/#publishing-your-package
3634
name: Publish on PyPI
3735
runs-on: ubuntu-latest
3836
environment:

Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export PATH := $(BIN):$(PATH)
1111
export GOBIN := $(abspath $(BIN))
1212
# Set to use a different Python interpreter. For example, `PYTHON=python make test`.
1313
PYTHON ?= python3
14+
export PYTHONPATH ?= gen
1415
CONFORMANCE_ARGS ?= --strict_message --expected_failures=tests/conformance/nonconforming.yaml --timeout 10s
1516
ADD_LICENSE_HEADER := $(BIN)/license-header \
1617
--license-type apache \
@@ -47,27 +48,27 @@ generate: $(BIN)/buf $(BIN)/license-header ## Regenerate code and license header
4748
.PHONY: format
4849
format: install $(BIN)/license-header ## Format code
4950
$(ADD_LICENSE_HEADER)
50-
pipenv run ruff format protovalidate tests
51-
pipenv run ruff check --fix protovalidate tests
51+
uv run -- ruff format protovalidate tests
52+
uv run -- ruff check --fix protovalidate tests
5253

5354
.PHONY: test
5455
test: generate install gettestdata ## Run unit tests
55-
pipenv run pytest
56+
uv run -- pytest
5657

5758
.PHONY: conformance
5859
conformance: $(BIN)/protovalidate-conformance generate install ## Run conformance tests
59-
protovalidate-conformance $(CONFORMANCE_ARGS) pipenv -- --python $(PYTHON) run python3 -m tests.conformance.runner
60+
protovalidate-conformance $(CONFORMANCE_ARGS) uv -- run --python $(PYTHON) python3 -m tests.conformance.runner
6061

6162
.PHONY: lint
6263
lint: install ## Lint code
63-
pipenv run ruff format --check --diff protovalidate tests
64-
pipenv run mypy protovalidate
65-
pipenv run ruff check protovalidate tests
66-
pipenv verify
64+
uv run -- ruff format --check --diff protovalidate tests
65+
uv run -- mypy protovalidate
66+
uv run -- ruff check protovalidate tests
67+
uv sync --locked
6768

6869
.PHONY: install
6970
install: ## Install dependencies
70-
pipenv --python $(PYTHON) sync --dev
71+
uv sync --python $(PYTHON) --dev
7172

7273
.PHONY: checkgenerate
7374
checkgenerate: generate

Pipfile

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

0 commit comments

Comments
 (0)