Skip to content

Commit dec2bda

Browse files
committed
try fix CI
1 parent b7d012f commit dec2bda

File tree

5 files changed

+78
-31
lines changed

5 files changed

+78
-31
lines changed

.github/workflows/lint.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,15 @@ jobs:
4848
id: sp
4949
with:
5050
python-version: ${{ matrix.python-version }}
51-
51+
- name: Install uv
52+
uses: astral-sh/setup-uv@v5
53+
with:
54+
enable-cache: true
5255
- name: Install Just
5356
uses: extractions/setup-just@v2
5457
- name: Install Dependencies
5558
run: |
56-
just init ${{ steps.sp.outputs.python-path }}
59+
just setup ${{ steps.sp.outputs.python-path }}
5760
just test-lock Django~=${{ matrix.django-version }}.0
5861
just install-docs
5962
- name: Install Emacs

.github/workflows/test.yml

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,15 @@ jobs:
101101
uses: actions/setup-python@v5
102102
with:
103103
python-version: ${{ matrix.python-version }}
104-
104+
- name: Install uv
105+
uses: astral-sh/setup-uv@v5
106+
with:
107+
enable-cache: true
105108
- name: Setup Just
106109
uses: extractions/setup-just@v2
107110
- name: Install Release Dependencies
108111
run: |
109-
just init ${{ steps.sp.outputs.python-path }}
112+
just setup ${{ steps.sp.outputs.python-path }}
110113
just install-${{ matrix.psycopg-version }}
111114
just test-lock Django~=${{ matrix.django-version }}.0
112115
- name: Install Emacs
@@ -161,12 +164,15 @@ jobs:
161164
id: sp
162165
with:
163166
python-version: ${{ matrix.python-version }}
164-
167+
- name: Install uv
168+
uses: astral-sh/setup-uv@v5
169+
with:
170+
enable-cache: true
165171
- name: Setup Just
166172
uses: extractions/setup-just@v2
167173
- name: Install Release Dependencies
168174
run: |
169-
just init ${{ steps.sp.outputs.python-path }}
175+
just setup ${{ steps.sp.outputs.python-path }}
170176
just install
171177
just test-lock Django~=${{ matrix.django-version }}.0
172178
- name: Install Emacs
@@ -183,7 +189,7 @@ jobs:
183189
run: |
184190
just manage makemigrations
185191
just test ./tests/verify_environment.py
186-
just test-all dev
192+
just test-all
187193
- name: Store coverage files
188194
uses: actions/upload-artifact@v4
189195
with:
@@ -266,11 +272,15 @@ jobs:
266272
with:
267273
detached: true
268274
timeout-minutes: 60
275+
- name: Install uv
276+
uses: astral-sh/setup-uv@v5
277+
with:
278+
enable-cache: true
269279
- name: Setup Just
270280
uses: extractions/setup-just@v2
271281
- name: Install Release Dependencies
272282
run: |
273-
just init ${{ steps.sp.outputs.python-path }}
283+
just setup ${{ steps.sp.outputs.python-path }}
274284
just install-mysql
275285
just test-lock Django~=${{ matrix.django-version }}.0
276286
@@ -368,11 +378,15 @@ jobs:
368378
with:
369379
detached: true
370380
timeout-minutes: 60
381+
- name: Install uv
382+
uses: astral-sh/setup-uv@v5
383+
with:
384+
enable-cache: true
371385
- name: Setup Just
372386
uses: extractions/setup-just@v2
373387
- name: Install Release Dependencies
374388
run: |
375-
just init ${{ steps.sp.outputs.python-path }}
389+
just setup ${{ steps.sp.outputs.python-path }}
376390
just install-mysql
377391
just test-lock Django~=${{ matrix.django-version }}.0
378392
@@ -466,6 +480,10 @@ jobs:
466480
with:
467481
detached: true
468482
timeout-minutes: 60
483+
- name: Install uv
484+
uses: astral-sh/setup-uv@v5
485+
with:
486+
enable-cache: true
469487
- name: Setup Just
470488
uses: extractions/setup-just@v2
471489
- name: Install Oracle Client
@@ -479,7 +497,7 @@ jobs:
479497
sudo ldconfig
480498
- name: Install Release Dependencies
481499
run: |
482-
just init ${{ steps.sp.outputs.python-path }}
500+
just setup ${{ steps.sp.outputs.python-path }}
483501
just test-lock Django~=${{ matrix.django-version }}.0
484502
- name: Run Full Unit Tests
485503
run: |
@@ -523,12 +541,15 @@ jobs:
523541
id: sp
524542
with:
525543
python-version: ${{ matrix.python-version }}
526-
544+
- name: Install uv
545+
uses: astral-sh/setup-uv@v5
546+
with:
547+
enable-cache: true
527548
- name: Setup Just
528549
uses: extractions/setup-just@v2
529550
- name: Install Release Dependencies
530551
run: |
531-
just init ${{ steps.sp.outputs.python-path }}
552+
just setup ${{ steps.sp.outputs.python-path }}
532553
just install
533554
just test-lock Django~=${{ matrix.django-version }}.0
534555
- name: install-vim-windows
@@ -544,7 +565,7 @@ jobs:
544565
run: |
545566
just manage makemigrations
546567
just test ./tests/verify_environment.py
547-
just test-all dev
568+
just test-all
548569
- name: Store coverage files
549570
uses: actions/upload-artifact@v4
550571
with:
@@ -581,12 +602,15 @@ jobs:
581602
id: sp
582603
with:
583604
python-version: ${{ matrix.python-version }}
584-
605+
- name: Install uv
606+
uses: astral-sh/setup-uv@v5
607+
with:
608+
enable-cache: true
585609
- name: Setup Just
586610
uses: extractions/setup-just@v2
587611
- name: Install Release Dependencies
588612
run: |
589-
just init ${{ steps.sp.outputs.python-path }}
613+
just setup ${{ steps.sp.outputs.python-path }}
590614
just install
591615
just test-lock Django~=${{ matrix.django-version }}.0
592616
- name: install-emacs-macos
@@ -621,12 +645,15 @@ jobs:
621645
id: sp
622646
with:
623647
python-version: '3.12'
624-
648+
- name: Install uv
649+
uses: astral-sh/setup-uv@v5
650+
with:
651+
enable-cache: true
625652
- name: Setup Just
626653
uses: extractions/setup-just@v2
627654
- name: Install Release Dependencies
628655
run: |
629-
just init ${{ steps.sp.outputs.python-path }}
656+
just setup ${{ steps.sp.outputs.python-path }}
630657
just install
631658
632659
- name: Get coverage files

justfile

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
22
set unstable := true
33
set script-interpreter := ['uv', 'run', '--script']
44

5+
export PYTHONPATH := source_directory()
6+
57
[private]
68
default:
79
@just --list --list-submodules
810

11+
# run the django admin
912
[script]
1013
manage *COMMAND:
1114
import os
@@ -15,11 +18,17 @@ manage *COMMAND:
1518
os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings"
1619
management.execute_from_command_line(sys.argv + "{{ COMMAND }}".split(" "))
1720

18-
# install build tooling
19-
init python="python":
20-
pip install pipx
21-
pipx ensurepath
22-
pipx install uv
21+
# install the uv package manager
22+
install_uv:
23+
curl -LsSf https://astral.sh/uv/install.sh | sh
24+
25+
# install the uv package manager
26+
[windows]
27+
install_uv:
28+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
29+
30+
# setup the venv and pre-commit hooks
31+
setup python="python":
2332
uv venv -p {{ python }}
2433
@just run pre-commit install
2534

@@ -29,13 +38,12 @@ install-precommit:
2938

3039
# update and install development dependencies
3140
install *OPTS:
32-
poetry lock
33-
poetry install {{ OPTS }}
41+
uv sync {{ OPTS }}
3442
@just run pre-commit install
3543

3644
# install documentation dependencies
3745
install-docs:
38-
uv sync --group docs
46+
uv sync --group docs --all-extras
3947

4048
[script]
4149
_lock-python:
@@ -140,7 +148,7 @@ check-format:
140148

141149
# check that the readme renders
142150
check-readme:
143-
@just run python -m readme_renderer ./README.md -o /tmp/README.html
151+
@just run -m readme_renderer ./README.md -o /tmp/README.html
144152

145153
# sort the python imports
146154
sort-imports:
@@ -162,7 +170,7 @@ fix: lint format
162170
check: check-lint check-format check-types check-package check-docs check-docs-links check-readme
163171

164172
# run all tests
165-
test-all DB_CLIENT:
173+
test-all DB_CLIENT="dev":
166174
# No Optional Dependency Unit Tests
167175
# todo clean this up, rerunning a lot of tests
168176
uv sync --group {{ DB_CLIENT }}
@@ -174,7 +182,7 @@ test-all DB_CLIENT:
174182
uv sync --extra rest --group {{ DB_CLIENT }}
175183
@just manage makemigrations
176184
@just run pytest --cov-append
177-
uv sync --extra filters --group {{ DB_CLIENT }}
185+
uv sync --all-extras --group {{ DB_CLIENT }}
178186
@just manage makemigrations
179187
@just run pytest --cov-append
180188

poetry.toml

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

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ classifiers = [
4747
requires = ["hatchling"]
4848
build-backend = "hatchling.build"
4949

50+
[tool.uv]
51+
package = true
52+
53+
54+
[tool.hatch.build.targets.sdist]
55+
# todo - these artifacts should be moved into tests
56+
exclude = ["benchmarks.json", "plot_benchmarks.py"]
57+
58+
[tool.hatch.build.targets.wheel]
59+
packages = ["src/django_enum"]
60+
61+
5062
[project.optional-dependencies]
5163
properties = ["enum-properties>=2.0.0"]
5264
filters = ["django-filter>=21"]

0 commit comments

Comments
 (0)