Skip to content

Commit

Permalink
Merge pull request #34 from stefanofusai/32-switch-to-uv-projects
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanofusai authored Dec 5, 2024
2 parents ecfb489 + a5a2b7f commit d70b045
Show file tree
Hide file tree
Showing 10 changed files with 426 additions and 132 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,12 @@ jobs:
- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
version: 0.5.4
version: 0.5.6
enable-cache: true
cache-dependency-glob: .requirements/testing.txt
- name: Install requirements
run: uv pip install -r .requirements/testing.txt
env:
UV_SYSTEM_PYTHON: 1
- name: Install the project
run: uv sync --group=testing
- name: Run tests
run: pytest
run: uv run pytest
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
Expand Down
27 changes: 3 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ci:
skip:
- pip-compile
- uv-lock
default_language_version:
python: python3.12
repos:
Expand All @@ -9,12 +9,6 @@ repos:
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: file-contents-sorter
files: ^\.requirements/base\.in$
- id: file-contents-sorter
files: ^\.requirements/development\.in$
- id: file-contents-sorter
files: ^\.requirements/testing\.in$
- id: name-tests-test
exclude: ^tests/conftest\.py$
# Specific checks and fixes for different file types
Expand Down Expand Up @@ -74,21 +68,6 @@ repos:
- main
# Dependency management
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.5.4
rev: 0.5.6
hooks:
- id: pip-compile
files: ^\.requirements\/(base|development)\.(in|txt)$
args:
- .requirements/base.in
- .requirements/development.in
- -o
- .requirements/development.txt
- id: pip-compile
files: ^\.requirements\/(base|testing)\.(in|txt)$
args:
- .requirements/base.in
- .requirements/testing.in
- -c
- .requirements/development.txt
- -o
- .requirements/testing.txt
- id: uv-lock
2 changes: 0 additions & 2 deletions .requirements/base.in

This file was deleted.

2 changes: 0 additions & 2 deletions .requirements/development.in

This file was deleted.

34 changes: 0 additions & 34 deletions .requirements/development.txt

This file was deleted.

4 changes: 0 additions & 4 deletions .requirements/testing.in

This file was deleted.

45 changes: 0 additions & 45 deletions .requirements/testing.txt

This file was deleted.

14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

Validate and serialize YAML config files with Pydantic, with support for environment variables.

This package uses [uv](https://docs.astral.sh/uv/) for project management. To get started, ensure that **uv** is installed on your machine and updated to the `0.5.6` version. Detailed installation instructions for **uv** can be found [here](https://docs.astral.sh/uv/getting-started/installation/).

## Installation

```bash
pip install pyamldantic
uv add pyamldantic
```

## Usage
Expand Down Expand Up @@ -60,16 +62,16 @@ if __name__ == "__main__":
## Development

```bash
pip install -r .requirements/development.txt
pre-commit install --install-hooks
pre-commit install --hook-type commit-msg
uv sync --group=development
uv run pre-commit install --install-hooks
uv run pre-commit install --hook-type=commit-msg
```

## Testing

```bash
pip install -r .requirements/testing.txt
pytest
uv sync --group=testing
uv run pytest
```

## Acknowledgments
Expand Down
36 changes: 28 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "pyamldantic"
version = "1.0.0"
authors = [{ "name" = "Stefano Fusai", "email" = "[email protected]" }]
version = "1.1.0"
description = "Validate and serialize YAML config files with Pydantic, with support for environment variables."
readme = "README.md"
authors = [
{ name = "Stefano Fusai", email = "[email protected]" }
]
maintainers = [
{ name = "Stefano Fusai", email = "[email protected]" }
]
requires-python = ">=3.12"
dependencies = [
"pydantic",
"pyyaml",
"pydantic==2.10.3",
"pyyaml==6.0.2",
]

[project.urls]
Homepage = "https://github.com/stefanofusai/pyamldantic"
Repository = "https://github.com/stefanofusai/pyamldantic"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[dependency-groups]
development = [
"pre-commit==4.0.1",
"ruff==0.8.2",
]
testing = [
"pytest==8.3.4",
"pytest-cov==6.0.0",
"pytest-mock==3.14.0",
"pytest-xdist==3.6.1",
]

[tool.mypy]
python_version = "3.12"
strict = true
Expand Down Expand Up @@ -56,3 +73,6 @@ split-on-trailing-comma = false

[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["D103"]

[tool.uv]
default-groups = []
Loading

0 comments on commit d70b045

Please sign in to comment.