Skip to content

Commit 4e948a9

Browse files
Merge branch 'main' into jrinehart/dvrl-518-update-links-in-all-protovalidate-github-repos-to-use
2 parents 53b8215 + 0925b76 commit 4e948a9

40 files changed

+1061
-1699
lines changed

.env

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

.github/CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cd protovalidate-python
2222
Next, install dependencies. You will need:
2323

2424
* Python >=v3.9
25-
* [Pipenv](https://pipenv.pypa.io/en/latest/index.html)
25+
* [uv](https://docs.astral.sh/uv/)
2626

2727
We use a Makefile to test and lint our code, so you'll also need a few non-Python tools:
2828

@@ -35,7 +35,7 @@ We use a Makefile to test and lint our code, so you'll also need a few non-Pytho
3535

3636
With Go and GNU Make installed, you can verify that your changes pass tests and
3737
lint checks by running `make`. If your Python 3 interpreter isn't available as
38-
`python3`, try `PYTHON=python make`. For a list of other useful commands, run
38+
`python3`, try `UV_PYTHON=python make`. For a list of other useful commands, run
3939
`make help`.
4040

4141
### Reporting Bugs
@@ -67,7 +67,7 @@ better!
6767

6868
We welcome ideas for enhancements and new features to improve `protovalidate-python`.
6969
If you have an idea you'd like to share, if you want to expand language
70-
support,
70+
support,
7171
please read [the section below](#language-support-requirements) first.
7272

7373
1. __Check if the enhancement is already suggested__: Before creating a new

.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 & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,15 @@ jobs:
2727
uses: actions/setup-go@v5
2828
with:
2929
go-version: stable
30-
- name: Install Python ${{ matrix.python-version }}
31-
id: python
32-
uses: actions/setup-python@v5
30+
cache: false
31+
- uses: astral-sh/setup-uv@v6
3332
with:
3433
python-version: ${{ matrix.python-version }}
35-
cache: "pipenv"
36-
- run: ${{steps.python.outputs.python-path}} -m pip install --upgrade pip pipenv
3734
- name: Execute tests
38-
run: make test PYTHON=${{ steps.python.outputs.python-path }}
35+
run: make test
3936
- name: Lint
40-
run: make lint PYTHON=${{ steps.python.outputs.python-path }}
37+
run: make lint
4138
- name: Format
42-
run: make format PYTHON=${{ steps.python.outputs.python-path }}
39+
run: make format
4340
- name: Check generated
44-
run: make checkgenerate PYTHON=${{ steps.python.outputs.python-path }}
41+
run: make checkgenerate

.github/workflows/conformance.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,9 @@ jobs:
2727
uses: actions/setup-go@v5
2828
with:
2929
go-version: stable
30+
cache: false
31+
- uses: astral-sh/setup-uv@v6
3032
- 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
33+
run: uv python install ${{ matrix.python-version }}
3734
- name: Test conformance
38-
run: make conformance PYTHON=${{ steps.python.outputs.python-path }}
35+
run: make conformance

.github/workflows/release.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,10 @@ 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
@@ -37,6 +33,9 @@ jobs:
3733
runs-on: ubuntu-latest
3834
environment:
3935
name: release
36+
permissions:
37+
# IMPORTANT: this permission is mandatory for Trusted Publishing
38+
id-token: write
4039
needs: build
4140
steps:
4241
- name: Checkout source
@@ -52,5 +51,3 @@ jobs:
5251

5352
- name: Publish on PyPI
5453
uses: pypa/gh-action-pypi-publish@release/v1
55-
with:
56-
password: ${{ secrets.PYPI_API_TOKEN }}

Makefile

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,18 @@ MAKEFLAGS += --no-print-directory
99
BIN := .tmp/bin
1010
export PATH := $(BIN):$(PATH)
1111
export GOBIN := $(abspath $(BIN))
12-
# Set to use a different Python interpreter. For example, `PYTHON=python make test`.
13-
PYTHON ?= python3
14-
CONFORMANCE_ARGS ?= --strict_message --expected_failures=tests/conformance/nonconforming.yaml --timeout 10s
12+
export PYTHONPATH ?= gen
13+
CONFORMANCE_ARGS ?= --strict_message --expected_failures=test/conformance/nonconforming.yaml --timeout 10s
1514
ADD_LICENSE_HEADER := $(BIN)/license-header \
1615
--license-type apache \
1716
--copyright-holder "Buf Technologies, Inc." \
1817
--year-range "2023-2025"
1918
# This version should be kept in sync with the version in buf.yaml
20-
PROTOVALIDATE_VERSION ?= v0.13.3
19+
PROTOVALIDATE_VERSION ?= v0.14.0
2120
# Version of the cel-spec that this implementation is conformant with
2221
# This should be kept in sync with the version in format_test.py
2322
CEL_SPEC_VERSION ?= v0.24.0
24-
TESTDATA_FILE := tests/testdata/string_ext_$(CEL_SPEC_VERSION).textproto
23+
TESTDATA_FILE := test/testdata/string_ext_$(CEL_SPEC_VERSION).textproto
2524

2625
.PHONY: help
2726
help: ## Describe useful make targets
@@ -47,27 +46,33 @@ generate: $(BIN)/buf $(BIN)/license-header ## Regenerate code and license header
4746
.PHONY: format
4847
format: install $(BIN)/license-header ## Format code
4948
$(ADD_LICENSE_HEADER)
50-
pipenv run ruff format protovalidate tests
51-
pipenv run ruff check --fix protovalidate tests
49+
uv run -- ruff format protovalidate test
50+
uv run -- ruff check --fix protovalidate test
5251

5352
.PHONY: test
5453
test: generate install gettestdata ## Run unit tests
55-
pipenv run pytest
54+
uv run -- python -m unittest
55+
$(MAKE) testextra
56+
57+
.PHONY: testextra
58+
testextra:
59+
uv sync --extra re2
60+
uv run -- python -m unittest
5661

5762
.PHONY: conformance
5863
conformance: $(BIN)/protovalidate-conformance generate install ## Run conformance tests
59-
protovalidate-conformance $(CONFORMANCE_ARGS) pipenv -- --python $(PYTHON) run python3 -m tests.conformance.runner
64+
protovalidate-conformance $(CONFORMANCE_ARGS) uv -- run python3 -m test.conformance.runner
6065

6166
.PHONY: lint
6267
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
68+
uv run -- ruff format --check --diff protovalidate test
69+
uv run -- mypy protovalidate
70+
uv run -- ruff check protovalidate test
71+
uv sync --locked
6772

6873
.PHONY: install
6974
install: ## Install dependencies
70-
pipenv --python $(PYTHON) sync --dev
75+
uv sync --dev
7176

7277
.PHONY: checkgenerate
7378
checkgenerate: generate

Pipfile

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

0 commit comments

Comments
 (0)