Skip to content

Commit 6226a92

Browse files
authored
Merge pull request #21 from amirreza8002/uv
migrate project management to uv
2 parents 2255b84 + 52708d0 commit 6226a92

File tree

3 files changed

+83
-72
lines changed

3 files changed

+83
-72
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
uses: actions/setup-python@v5
4949
with:
5050
python-version: ${{ matrix.python-version }}
51+
5152
- name: Cache docker images
5253
id: custom-cache
5354
uses: actions/cache@v4
@@ -58,51 +59,40 @@ jobs:
5859
- name: Use Cache
5960
run: docker image load -i ./custom-cache/all.tar
6061

61-
# - name: Cache
62-
# id: cached-poetry
63-
# uses: actions/cache@v4
64-
# with:
65-
# path: ./.venv
66-
# key: venv-${{ hashFiles('poetry.lock') }}
67-
68-
- name: Install poetry
69-
if: steps.cached-poetry.outputs.cache-hit != 'true'
70-
uses: abatilo/actions-poetry@v3
62+
- name: Install uv
63+
uses: astral-sh/setup-uv@v5
64+
with:
65+
enable-cache: true
7166

7267
- name: install dependencies
73-
run: poetry install --no-interaction --no-root --all-extras --with dev
74-
75-
- name: config poetry
7668
run: |
77-
poetry config virtualenvs.create true --local
78-
poetry config virtualenvs.in-project true --local
69+
uv sync --all-extras --dev
7970
8071
- name: Install project
8172
run: |
82-
poetry add django==${{ matrix.django-version }}
83-
poetry install --no-interaction --all-extras
73+
uv pip install django==${{ matrix.django-version }}
8474
8575
- name: tests
8676
run: |
87-
poetry run invoke devenv
77+
uv run invoke devenv
8878
chmod +x ./util/wait-for-it.sh
8979
./util/wait-for-it.sh localhost:6379
9080
91-
poetry run pytest tests/*.py --ds=tests.settings.sqlite -x
92-
poetry run pytest tests/*.py --ds=tests.settings.sqlite_herd -x
93-
poetry run pytest tests/*.py --ds=tests.settings.sqlite_json -x
94-
poetry run pytest tests/*.py --ds=tests.settings.sqlite_lz4 -x
95-
poetry run pytest tests/*.py --ds=tests.settings.sqlite_msgpack -x
96-
poetry run pytest tests/*.py --ds=tests.settings.sqlite_sentinel -x
97-
poetry run pytest tests/*.py --ds=tests.settings.sqlite_sentinel_opts -x
98-
poetry run pytest tests/*.py --ds=tests.settings.sqlite_sharding -x
99-
poetry run pytest tests/*.py --ds=tests.settings.sqlite_zlib -x
100-
poetry run pytest tests/*.py --ds=tests.settings.sqlite_zstd -x
101-
poetry run pytest tests/*.py --ds=tests.settings.sqlite_gzip -x
102-
poetry run pytest tests/*.py --ds=tests.settings.sqlite_bz2 -x
103-
poetry run pytest tests/tests_async/*.py --ds=tests.settings.sqlite_async -x
104-
poetry run pytest tests/tests_async/*.py --ds=tests.settings.sqlite_async_herd -x
105-
# poetry run pytest tests/*.py --ds=tests.settings.sqlite_usock -x
81+
uv run pytest tests/*.py --ds=tests.settings.sqlite -x
82+
uv run pytest tests/*.py --ds=tests.settings.sqlite_herd -x
83+
uv run pytest tests/*.py --ds=tests.settings.sqlite_json -x
84+
uv run pytest tests/*.py --ds=tests.settings.sqlite_lz4 -x
85+
uv run pytest tests/*.py --ds=tests.settings.sqlite_msgpack -x
86+
uv run pytest tests/*.py --ds=tests.settings.sqlite_sentinel -x
87+
uv run pytest tests/*.py --ds=tests.settings.sqlite_sentinel_opts -x
88+
uv run pytest tests/*.py --ds=tests.settings.sqlite_sharding -x
89+
uv run pytest tests/*.py --ds=tests.settings.sqlite_zlib -x
90+
uv run pytest tests/*.py --ds=tests.settings.sqlite_zstd -x
91+
uv run pytest tests/*.py --ds=tests.settings.sqlite_gzip -x
92+
uv run pytest tests/*.py --ds=tests.settings.sqlite_bz2 -x
93+
uv run pytest tests/tests_async/*.py --ds=tests.settings.sqlite_async -x
94+
uv run pytest tests/tests_async/*.py --ds=tests.settings.sqlite_async_herd -x
95+
# uv run pytest tests/*.py --ds=tests.settings.sqlite_usock -x
10696

10797
env:
10898
DJANGO: ${{ matrix.django-version }}

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ dump.rdb
2828
coverage.xml
2929
cobertura.xml
3030

31-
poetry.lock
31+
uv.lock
3232
dist
3333
htmlcov
3434
test.sh
3535
test_*.sh
3636

3737
docs/build
3838

39-
.cluster
39+
.cluster
40+
41+
.python-version

pyproject.toml

Lines changed: 56 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
15
[project]
26
name = "django-valkey"
37
version = "0.2.1"
48
description = "a valkey backend for django"
5-
authors = [
6-
{name = "amirreza",email = "[email protected]"}
7-
]
8-
license = {text = "BSD-3-Caluse"}
99
readme = "README.rst"
10+
requires-python = ">=3.10"
11+
license = "BSD-3-Clause"
12+
maintainers = [
13+
{name = "amirreza",email = "[email protected]"},
14+
]
1015
classifiers = [
1116
"Programming Language :: Python",
1217
"Environment :: Web Environment",
@@ -21,53 +26,67 @@ classifiers = [
2126
"Programming Language :: Python :: 3.10",
2227
"Programming Language :: Python :: 3.11",
2328
"Programming Language :: Python :: 3.12",
29+
"Programming Language :: Python :: 3.13",
2430
"Framework :: Django :: 5.0",
2531
"Framework :: Django :: 5.1",
32+
"Framework :: Django :: 5.2",
2633
]
27-
include = ["AUTHORS.rst"]
28-
requires-python = ">=3.10"
2934

3035
dependencies = [
31-
"django (>=4.2.20)",
32-
"valkey (>=6.0.2)",
36+
"django>=4.2",
37+
"valkey>=6.0.2",
3338
]
3439

40+
3541
[project.optional-dependencies]
36-
libvalkey = ["libvalkey (>=4.0.1,<5.0.0)"]
37-
lz4 = ["lz4 (>=4.3.3,<5.0.0)"]
38-
pyzstd = ["pyzstd (>=0.16.2,<0.17.0)"]
39-
msgpack = ["msgpack (>=1.1.0,<2.0.0)"]
40-
brotli = ["brotli (>=1.1.0,<2.0.0)"]
42+
libvalkey = [
43+
"libvalkey>=4.0.1",
44+
]
45+
lz4 = [
46+
"lz4>=4.3.3",
47+
]
48+
pyzstd = [
49+
"pyzstd>=0.16.2",
50+
]
51+
msgpack = [
52+
"msgpack>=1.1.0",
53+
]
54+
brotli = [
55+
"brotli>=1.1.0",
56+
]
4157

42-
[tool.poetry.urls]
58+
[dependency-groups]
59+
dev = [
60+
"black>=25.1.0",
61+
"coverage>=7.8.0",
62+
"django-cmd>=2.6",
63+
"django-coverage-plugin>=3.1.0",
64+
"django-stubs>=5.1.3",
65+
"invoke>=2.2.0",
66+
"mypy>=1.15.0",
67+
"pre-commit>=4.2.0",
68+
"pytest>=8.3.5",
69+
"pytest-asyncio>=0.26.0",
70+
"pytest-django>=4.11.1",
71+
"pytest-mock>=3.14.0",
72+
"ruff>=0.11.6",
73+
]
74+
docs = [
75+
"mkdocs>=1.6.1",
76+
"mkdocs-awesome-nav>=3.1.1",
77+
"mkdocs-material>=9.6.12",
78+
]
79+
ipython = [
80+
"ipython>=8.35.0",
81+
]
82+
83+
[project.urls]
4384
Homepage = "https://github.com/django-utils/django-valkey"
4485
Source = "https://github.com/django-utils/django-valkey"
4586
Issues = "https://github.com/django-utils/django-valkey/issues"
4687
Documentation = "https://django-valkey.readthedocs.io/en/latest/"
4788

48-
[tool.poetry.group.dev.dependencies]
49-
black = "^25.1.0"
50-
coverage = "^7.7.0"
51-
django-coverage-plugin = "^3.1.0"
52-
django-cmd = "^2.6"
53-
django-stubs = "^5.1.3"
54-
invoke = "^2.2.0"
55-
mypy = "^1.15.0"
56-
pre-commit = "^4.1.0"
57-
pytest = "^8.3.5"
58-
pytest-asyncio = "^0.25.3"
59-
pytest-django = "^4.10.0"
60-
pytest-mock = "^3.14.0"
61-
ruff = "^0.11.0"
6289

63-
[tool.poetry.group.docs.dependencies]
64-
mkdocs = "^1.6.1"
65-
mkdocs-material = "^9.6.9"
66-
mkdocs-awesome-nav = "^3.0.0"
67-
68-
[build-system]
69-
requires = ["poetry-core>=2.0.0,<3.0.0"]
70-
build-backend = "poetry.core.masonry.api"
7190

7291
[tool.mypy]
7392
plugins = ["mypy_django_plugin.main"]
@@ -93,4 +112,4 @@ parallel = true
93112

94113

95114
[tool.ruff.lint.per-file-ignores]
96-
"__init__.py" = ["E402", "F401", "F403"]
115+
"__init__.py" = ["E402", "F401", "F403"]

0 commit comments

Comments
 (0)