-
Notifications
You must be signed in to change notification settings - Fork 69
♻️ Migrate Pydantic Extra Types to use uv #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
26d3b72
:recycle: Migrate Pydantic Extra Types to use uv
yezz123 462b2b8
:recycle: Update CI workflow and Makefile to remove pyright and insta…
yezz123 40e62b9
:recycle: Update CI workflow to use uv for installing extra dependenc…
yezz123 28ef103
:sparkles: add new type: Epoch Unix Timestamp (#240)
commonism 65514ad
:sparkles: Fix formatting in epoch.py log entry comment
yezz123 45b4bea
Merge branch 'main' into uv
yezz123 43ff8cb
🎨 Add blank line for improved readability in epoch
yezz123 1bd2075
:recycle: Refactor dependency management in pyproject.toml and Makefi…
yezz123 52bef7d
:recycle: Refactor CI workflow and dependency management; unify optio…
yezz123 6ca3336
:sparkles: Add step to install all extra dependencies in CI workflow
yezz123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
rev: v4.3.0 | ||
hooks: | ||
- id: no-commit-to-branch # prevent direct commits to the `main` branch | ||
- id: check-yaml | ||
args: ['--unsafe'] | ||
- id: check-toml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: local | ||
hooks: | ||
- id: lint | ||
name: Lint | ||
entry: make lint | ||
types: [python] | ||
language: system | ||
pass_filenames: false | ||
- id: mypy | ||
name: Mypy | ||
entry: make mypy | ||
types: [python] | ||
language: system | ||
pass_filenames: false | ||
- id: format | ||
name: Format | ||
entry: make | ||
args: [format] | ||
language: system | ||
types: [python] | ||
pass_filenames: false | ||
- id: lint | ||
name: Lint | ||
entry: make | ||
args: [lint] | ||
types: [python] | ||
language: system | ||
pass_filenames: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,49 @@ | ||
.DEFAULT_GOAL := all | ||
sources = pydantic_extra_types tests | ||
|
||
.PHONY: install | ||
install: | ||
python -m pip install -U pip | ||
pip install -r requirements/all.txt | ||
pip install -e . | ||
.PHONY: .uv # Check that uv is installed | ||
.uv: | ||
@uv --version || echo 'Please install uv: https://docs.astral.sh/uv/getting-started/installation/' | ||
|
||
.PHONY: refresh-lockfiles | ||
refresh-lockfiles: | ||
@echo "Updating requirements/*.txt files using pip-compile" | ||
find requirements/ -name '*.txt' ! -name 'all.txt' -type f -delete | ||
pip-compile -q --no-emit-index-url --resolver backtracking -o requirements/linting.txt requirements/linting.in | ||
pip-compile -q --no-emit-index-url --resolver backtracking -o requirements/testing.txt requirements/testing.in | ||
pip-compile -q --no-emit-index-url --resolver backtracking --extra all -o requirements/pyproject.txt pyproject.toml | ||
pip install --dry-run -r requirements/all.txt | ||
.PHONY: install ## Install the package, dependencies, and pre-commit for local development | ||
install: .uv | ||
uv sync --frozen --group all --all-extras | ||
uv pip install pre-commit | ||
pre-commit install --install-hooks | ||
|
||
.PHONY: format | ||
.PHONY: rebuild-lockfiles ## Rebuild lockfiles from scratch, updating all dependencies | ||
rebuild-lockfiles: .uv | ||
uv lock --upgrade | ||
|
||
.PHONY: format # Format the code | ||
format: | ||
ruff check --fix $(sources) | ||
ruff format $(sources) | ||
uv run ruff format | ||
uv run ruff check --fix --fix-only | ||
|
||
.PHONY: lint | ||
.PHONY: lint # Lint the code | ||
lint: | ||
ruff check $(sources) | ||
ruff format --check $(sources) | ||
|
||
.PHONY: mypy | ||
mypy: | ||
mypy pydantic_extra_types | ||
uv run ruff format --check | ||
uv run ruff check | ||
|
||
.PHONY: test | ||
test: | ||
coverage run -m pytest --durations=10 | ||
|
||
.PHONY: testcov | ||
testcov: test | ||
@echo "building coverage html" | ||
@coverage html | ||
|
||
.PHONY: testcov-compile | ||
testcov-compile: build-trace test | ||
@echo "building coverage html" | ||
@coverage html | ||
uv run pytest | ||
|
||
.PHONY: test-all-python # Run tests on Python 3.9 to 3.13 | ||
test-all-python: | ||
UV_PROJECT_ENVIRONMENT=.venv39 uv run --python 3.9 coverage run -p -m pytest | ||
UV_PROJECT_ENVIRONMENT=.venv310 uv run --python 3.10 coverage run -p -m pytest | ||
UV_PROJECT_ENVIRONMENT=.venv311 uv run --python 3.11 coverage run -p -m pytest | ||
UV_PROJECT_ENVIRONMENT=.venv312 uv run --python 3.12 coverage run -p -m pytest | ||
UV_PROJECT_ENVIRONMENT=.venv313 uv run --python 3.13 coverage run -p -m pytest | ||
@uv run coverage combine | ||
@uv run coverage report | ||
|
||
.PHONY: testcov # Run tests and collect coverage data | ||
testcov: | ||
uv run coverage run -m pytest | ||
@uv run coverage report | ||
@uv run coverage html | ||
|
||
.PHONY: all | ||
all: lint mypy testcov | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf `find . -name __pycache__` | ||
rm -f `find . -type f -name '*.py[co]'` | ||
rm -f `find . -type f -name '*~'` | ||
rm -f `find . -type f -name '.*~'` | ||
rm -rf .cache | ||
rm -rf .pytest_cache | ||
rm -rf .mypy_cache | ||
rm -rf htmlcov | ||
rm -rf *.egg-info | ||
rm -f .coverage | ||
rm -f .coverage.* | ||
rm -rf build | ||
rm -rf dist | ||
rm -rf coverage.xml | ||
rm -rf .ruff_cache | ||
|
||
.PHONY: pre-commit | ||
pre-commit: | ||
pre-commit run --all-files --show-diff-on-failure | ||
all: format lint testcov |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.