Skip to content

Commit c45c0a9

Browse files
committed
[#46] Feat: switch to uv projects
1 parent d35ae02 commit c45c0a9

File tree

6 files changed

+234
-55
lines changed

6 files changed

+234
-55
lines changed

Diff for: .pre-commit-config.yaml

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ci:
22
skip:
3-
- pip-compile
3+
- uv-lock
44
default_language_version:
55
python: python3.12
66
repos:
@@ -9,8 +9,6 @@ repos:
99
rev: v5.0.0
1010
hooks:
1111
- id: end-of-file-fixer
12-
- id: file-contents-sorter
13-
files: ^requirements\.in$
1412
# Specific checks and fixes for different file types
1513
- repo: https://github.com/markdownlint/markdownlint
1614
rev: v0.12.0
@@ -43,7 +41,7 @@ repos:
4341
hooks:
4442
- id: pyupgrade
4543
- repo: https://github.com/astral-sh/ruff-pre-commit
46-
rev: v0.7.0
44+
rev: v0.8.2
4745
hooks:
4846
- id: ruff
4947
args:
@@ -68,10 +66,6 @@ repos:
6866
- main
6967
# Dependency management
7068
- repo: https://github.com/astral-sh/uv-pre-commit
71-
rev: 0.5.4
69+
rev: 0.5.6
7270
hooks:
73-
- id: pip-compile
74-
args:
75-
- requirements.in
76-
- -o
77-
- requirements.txt
71+
- id: uv-lock

Diff for: README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
Handle multiple serializers for the same view in Django Rest Framework.
44

5+
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/).
6+
57
## Installation
68

79
```bash
8-
pip install drf-multi-serializers
10+
uv add drf-multi-serializers
911
```
1012

1113
## Usage
@@ -40,7 +42,7 @@ class MyViewSet(MultiSerializerMixin, ModelViewSet):
4042
...
4143
```
4244

43-
drf-multi-serializers also supports Django Rest Framework's versioning system!
45+
`drf-multi-serializers` also supports Django Rest Framework's versioning system!
4446

4547
```python
4648
from rest_framework.generics import ListCreateAPIView
@@ -73,9 +75,9 @@ class MyViewSet(MultiSerializerMixin, ModelViewSet):
7375
## Development
7476

7577
```bash
76-
pip install -r requirements.txt
77-
pre-commit install --install-hooks
78-
pre-commit install --hook-type commit-msg
78+
uv sync
79+
uv run pre-commit install --install-hooks
80+
uv run pre-commit install --hook-type=commit-msg
7981
```
8082

8183
## Contributing

Diff for: pyproject.toml

+16-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
1-
[build-system]
2-
requires = ["setuptools >= 61.0"]
3-
build-backend = "setuptools.build_meta"
4-
51
[project]
62
name = "drf-multi-serializers"
7-
version = "1.2.0"
8-
authors = [{ "name" = "Stefano Fusai", "email" = "[email protected]" }]
3+
version = "1.3.0"
94
description = "Handle multiple serializers for the same view in Django Rest Framework."
105
readme = "README.md"
6+
authors = [
7+
{ name = "Stefano Fusai", email = "[email protected]" }
8+
]
9+
maintainers = [
10+
{ name = "Stefano Fusai", email = "[email protected]" }
11+
]
1112
requires-python = ">=3.12"
12-
dependencies = ["djangorestframework"]
13+
dependencies = [
14+
"djangorestframework==3.15.2",
15+
"pre-commit==4.0.1",
16+
"ruff==0.8.2",
17+
]
1318

1419
[project.urls]
1520
Homepage = "https://github.com/stefanofusai/drf-multi-serializers"
1621
Repository = "https://github.com/stefanofusai/drf-multi-serializers"
1722

23+
[build-system]
24+
requires = ["hatchling"]
25+
build-backend = "hatchling.build"
26+
1827
[tool.mypy]
1928
python_version = "3.12"
2029
strict = true

Diff for: requirements.in

-3
This file was deleted.

Diff for: requirements.txt

-30
This file was deleted.

0 commit comments

Comments
 (0)