Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env

This file was deleted.

2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ updates:
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "pip"
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"
15 changes: 6 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,15 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: stable
- name: Install Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5
cache: false
- uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
cache: "pipenv"
- run: ${{steps.python.outputs.python-path}} -m pip install --upgrade pip pipenv
- name: Execute tests
run: make test PYTHON=${{ steps.python.outputs.python-path }}
run: make test
- name: Lint
run: make lint PYTHON=${{ steps.python.outputs.python-path }}
run: make lint
- name: Format
run: make format PYTHON=${{ steps.python.outputs.python-path }}
run: make format
- name: Check generated
run: make checkgenerate PYTHON=${{ steps.python.outputs.python-path }}
run: make checkgenerate
11 changes: 4 additions & 7 deletions .github/workflows/conformance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: stable
cache: false
- uses: astral-sh/setup-uv@v6
- name: Install Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pipenv"
- run: ${{steps.python.outputs.python-path}} -m pip install --upgrade pip pipenv
run: uv python install ${{ matrix.python-version }}
- name: Test conformance
run: make conformance PYTHON=${{ steps.python.outputs.python-path }}
run: make conformance
12 changes: 5 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,18 @@ jobs:
run: |
VERSION=${{github.head_ref}}
echo "VERSION=${VERSION##*/}" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install pypa/build
- uses: astral-sh/setup-uv@v6
- name: Build release
run: |
python -m pip install build
python -m build
uv build
- uses: actions/upload-artifact@v4
with:
name: package
path: dist/

publish:
# TODO: trusted publisher
# https://docs.astral.sh/uv/guides/publish/#publishing-your-package
name: Publish on PyPI
runs-on: ubuntu-latest
environment:
Expand Down
21 changes: 10 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ MAKEFLAGS += --no-print-directory
BIN := .tmp/bin
export PATH := $(BIN):$(PATH)
export GOBIN := $(abspath $(BIN))
# Set to use a different Python interpreter. For example, `PYTHON=python make test`.
PYTHON ?= python3
export PYTHONPATH ?= gen
CONFORMANCE_ARGS ?= --strict_message --expected_failures=tests/conformance/nonconforming.yaml --timeout 10s
ADD_LICENSE_HEADER := $(BIN)/license-header \
--license-type apache \
Expand Down Expand Up @@ -47,27 +46,27 @@ generate: $(BIN)/buf $(BIN)/license-header ## Regenerate code and license header
.PHONY: format
format: install $(BIN)/license-header ## Format code
$(ADD_LICENSE_HEADER)
pipenv run ruff format protovalidate tests
pipenv run ruff check --fix protovalidate tests
uv run -- ruff format protovalidate tests
uv run -- ruff check --fix protovalidate tests

.PHONY: test
test: generate install gettestdata ## Run unit tests
pipenv run pytest
uv run -- pytest

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

.PHONY: lint
lint: install ## Lint code
pipenv run ruff format --check --diff protovalidate tests
pipenv run mypy protovalidate
pipenv run ruff check protovalidate tests
pipenv verify
uv run -- ruff format --check --diff protovalidate tests
uv run -- mypy protovalidate
uv run -- ruff check protovalidate tests
uv sync --locked

.PHONY: install
install: ## Install dependencies
pipenv --python $(PYTHON) sync --dev
uv sync --dev

.PHONY: checkgenerate
checkgenerate: generate
Expand Down
20 changes: 0 additions & 20 deletions Pipfile

This file was deleted.

Loading