Skip to content

Commit b46ffae

Browse files
committed
chore: Migrate to uv+hatchling
1 parent bad94ff commit b46ffae

File tree

10 files changed

+1069
-1219
lines changed

10 files changed

+1069
-1219
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,17 @@ jobs:
3838
- 27017:27017
3939
steps:
4040
- uses: actions/checkout@v3
41-
- name: Install poetry
42-
run: pipx install poetry
4341
- name: Set up Python ${{ matrix.python-version }}
44-
uses: actions/setup-python@v4
42+
uses: astral-sh/setup-uv@v5
4543
with:
44+
enable-cache: true
4645
python-version: ${{ matrix.python }}
47-
cache: 'poetry'
48-
- name: Cache virtualenv
49-
uses: actions/cache@v3
50-
with:
51-
key: venv-${{ runner.os }}-${{ steps.setup_python.outputs.python-version}}-${{ hashFiles('poetry.lock') }}
52-
path: .venv
5346
- name: Set up env
5447
run: |
55-
poetry install -q
56-
poetry run pip install -q "${{ matrix.django }}"
48+
uv sync
49+
uv pip install -q "${{ matrix.django }}"
5750
- name: Run tests
5851
run: |
59-
poetry run ruff .
60-
poetry run ruff format --check .
61-
poetry run python -m pytest
52+
uv run ruff .
53+
uv run ruff format --check .
54+
uv run python -m pytest

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ publish:
1212
git push --follow-tags
1313

1414
test:
15-
poetry run python -m pytest
15+
pytest
1616

1717
codegen:
1818
python codegen.py

README.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,13 @@ How to run example app
132132
----------------------
133133
.. code::
134134
135-
poetry install
136-
poetry run pip install -r example/tumblelog/requirements.txt
137-
poetry run python example/tumblelog/manage.py runserver
135+
uv sync --group dev
136+
uv pip install -r example/tumblelog/requirements.txt
137+
uv run python example/tumblelog/manage.py runserver
138138
139139
140140
How to run tests
141141
----------------
142142
.. code::
143143
144-
poetry install
145-
poetry run python -m pytest
144+
uv run python -m pytest

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

poetry.lock

Lines changed: 0 additions & 1131 deletions
This file was deleted.

poetry.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

pyproject.toml

Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,49 @@
1-
[tool.poetry]
1+
[project]
22
name = "django-mongoengine"
3-
version = "0.4.6"
43
description = "Django support for MongoDB via MongoEngine"
5-
authors = ["Ross Lawley <[email protected]>"]
6-
7-
[tool.poetry.dependencies]
8-
python = ">=3.9,<4.0"
9-
django = ">=4.2,<5"
10-
mongoengine = ">=0.14"
11-
12-
[tool.poetry.group.dev.dependencies]
13-
flake8 = "*"
14-
pdbpp = "*"
15-
pytest = "*"
16-
pytest-cov = "*"
17-
pytest-django = "*"
18-
pytest-sugar = "*"
19-
ruff = "^0.1.3"
20-
sphinx = "*"
21-
typing-extensions = "^4.8.0"
22-
mongo-types = { git = "https://github.com/sbdchd/mongo-types.git", branch = "main" }
23-
django-types = "^0.19.1"
4+
readme = {file = "README.rst", content-type = "text/x-rst"}
5+
authors = [
6+
{name = "Ross Lawley", email = "[email protected]"},
7+
]
8+
dynamic = ["version"]
9+
license = {text = "BSD"}
10+
requires-python = "<4.0,>=3.9"
11+
12+
classifiers = [
13+
"Development Status :: 4 - Beta",
14+
"Environment :: Web Environment",
15+
"Intended Audience :: Developers",
16+
"License :: OSI Approved :: BSD License",
17+
"Operating System :: OS Independent",
18+
"Programming Language :: Python",
19+
"Programming Language :: Python :: 3",
20+
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
21+
"Topic :: Software Development :: Libraries :: Python Modules",
22+
"Framework :: Django"
23+
]
24+
dependencies = [
25+
"django<5,>=4.2",
26+
"mongoengine>=0.14",
27+
]
28+
29+
[project.urls]
30+
"Homepage" = "https://github.com/mongoengine/django-mongoengine"
31+
"Download" = "https://github.com/mongoengine/django-mongoengine/tarball/master"
32+
33+
[dependency-groups]
34+
dev = [
35+
"flake8",
36+
"pdbpp",
37+
"pytest",
38+
"pytest-cov",
39+
"pytest-django",
40+
"pytest-sugar",
41+
"ruff",
42+
"sphinx",
43+
"typing-extensions",
44+
"mongo-types @ git+https://github.com/sbdchd/mongo-types.git@main",
45+
"django-types",
46+
]
2447

2548
[tool.ruff]
2649
line-length = 100
@@ -45,3 +68,17 @@ extend-generics = [
4568
[tool.ruff.format]
4669
# Use `\n` line endings for all files
4770
line-ending = "lf"
71+
72+
[build-system]
73+
requires = ["hatchling", "hatch-vcs"]
74+
build-backend = "hatchling.build"
75+
76+
[tool.hatch.build]
77+
include = ["django-mongoengine/**"]
78+
exclude = ["doc", "docs", "tests", "example"]
79+
80+
[tool.hatch.build.targets.wheel]
81+
packages = ["django-mongoengine"]
82+
83+
[tool.hatch.version]
84+
source = "vcs"

setup.cfg

Lines changed: 0 additions & 37 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)