Skip to content

Commit dfbc857

Browse files
authored
Merge pull request #296 from bjester/uv-migration
Migrate morango to uv for package management
2 parents d27cbc4 + 80a3f26 commit dfbc857

21 files changed

Lines changed: 4605 additions & 289 deletions

.github/dependabot.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
# Automatically update versions for pip
1+
# Keeps dependencies up to date
22

33
version: 2
44
updates:
5-
65
# Maintain dependencies for Python
7-
- package-ecosystem: "pip"
6+
- package-ecosystem: "uv"
87
directory: "/"
98
schedule:
109
interval: "weekly"
1110
day: "friday"
1211
time: "00:00"
13-
1412
# Maintain dependencies for Github Actions
1513
- package-ecosystem: "github-actions"
1614
directory: "/"

.github/workflows/check-docs.yml

Lines changed: 35 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,38 @@
11
name: Docs
2-
32
on: [push, pull_request]
4-
53
jobs:
6-
pre_job:
7-
name: Path match check
8-
runs-on: ubuntu-latest
9-
# Map a step output to a job output
10-
outputs:
11-
should_skip: ${{ steps.skip_check.outputs.should_skip }}
12-
steps:
13-
- id: skip_check
14-
uses: fkirc/skip-duplicate-actions@master
15-
with:
16-
github_token: ${{ github.token }}
17-
paths: '["docs/**", "requirements/docs.txt"]'
18-
docs:
19-
name: Checking docs build
20-
needs: pre_job
21-
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
22-
runs-on: ubuntu-latest
23-
steps:
24-
- uses: actions/checkout@v6
25-
- uses: actions/setup-python@v6
26-
with:
27-
python-version: 3.9
28-
- name: pip cache
29-
uses: actions/cache@v5
30-
with:
31-
path: ~/.cache/pip
32-
key: ${{ runner.os }}-pip-docs-${{ hashFiles('requirements/docs.txt') }}
33-
restore-keys: |
34-
${{ runner.os }}-pip-docs
35-
- name: Install system dependencies
36-
run: |
37-
sudo apt-get -y -qq update
38-
sudo apt-get install -y swig openssl libssl-dev
39-
- name: Install dependencies
40-
run: |
41-
python -m pip install --upgrade pip
42-
pip install -r requirements/docs.txt
43-
pip install -e .
44-
- name: Check Docs build
45-
run: make docs
4+
pre_job:
5+
name: Path match check
6+
runs-on: ubuntu-latest
7+
# Map a step output to a job output
8+
outputs:
9+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
10+
steps:
11+
- id: skip_check
12+
uses: fkirc/skip-duplicate-actions@master
13+
with:
14+
github_token: ${{ github.token }}
15+
paths: '["docs/**", "pyproject.toml"]'
16+
docs:
17+
name: Checking docs build
18+
needs: pre_job
19+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v6
23+
with:
24+
fetch-depth: 0
25+
- name: Install system dependencies
26+
run: |
27+
sudo apt-get -y -qq update
28+
sudo apt-get install -y swig openssl libssl-dev
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v7
31+
with:
32+
python-version: 3.9
33+
activate-environment: "true"
34+
enable-cache: "true"
35+
- name: Install dependencies
36+
run: uv sync --extra docs
37+
- name: Check Docs build
38+
run: make docs

.github/workflows/check_migrations_sqlite.yml

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,34 @@ jobs:
1212
uses: fkirc/skip-duplicate-actions@master
1313
with:
1414
github_token: ${{ github.token }}
15-
paths: '["morango/migrations/*.py", ".github/workflows/check_migrations_sqlite.yml", "setup.py", "requirements/*.txt"]'
15+
paths: '["morango/migrations/*.py", ".github/workflows/check_migrations_sqlite.yml", "pyproject.toml"]'
16+
build:
17+
name: Build wheel
18+
needs: pre_job
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v6
22+
with:
23+
fetch-depth: 0
24+
- name: Install uv
25+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
26+
uses: astral-sh/setup-uv@v7
27+
with:
28+
python-version: 3.9
29+
enable-cache: "true"
30+
- name: Build wheel
31+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
32+
run: uv build --wheel
33+
- name: Upload wheel artifact
34+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: wheel
38+
path: dist/*.whl
39+
retention-days: 1
1640
migration_test:
1741
name: SQLite migration tests
18-
needs: pre_job
42+
needs: [pre_job, build]
1943
runs-on: ubuntu-latest
2044
container:
2145
image: python:3.7-buster
@@ -32,6 +56,13 @@ jobs:
3256
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
3357
with:
3458
lfs: true
59+
fetch-depth: 0
60+
- name: Download wheel artifact
61+
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: wheel
65+
path: dist/
3566
- name: Build SQLite 3.25.3
3667
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
3768
run: |
@@ -54,7 +85,7 @@ jobs:
5485
${{ runner.os }}-pip-
5586
- name: Install dependencies
5687
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
57-
run: pip install .
88+
run: pip install $(ls dist/*.whl | head -n 1)[test]
5889
- name: Run migrations
5990
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
6091
run: python tests/testapp/manage.py migrate
Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,26 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
4-
# This workflow uses actions that are not certified by GitHub.
5-
# They are provided by a third-party and are governed by
6-
# separate terms of service, privacy policy, and support
7-
# documentation.
1+
# This workflow will upload a Python Package using uv when a release is created
2+
# uv provides fast, modern Python package building and publishing
83

94
name: Upload Python Package
10-
115
on:
126
release:
137
types: [published]
14-
158
jobs:
169
deploy:
1710
runs-on: ubuntu-22.04
1811
steps:
19-
- uses: actions/checkout@v6
20-
- name: Set up Python
21-
uses: actions/setup-python@v6
22-
with:
23-
python-version: 3.9
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install setuptools wheel twine
28-
- name: Build and publish
29-
env:
30-
TWINE_USERNAME: __token__
31-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
32-
run: |
33-
python setup.py sdist bdist_wheel
34-
twine upload dist/*
12+
- uses: actions/checkout@v6
13+
with:
14+
fetch-depth: 0
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v7
17+
with:
18+
python-version: 3.9
19+
activate-environment: "true"
20+
enable-cache: "true"
21+
- name: Build package
22+
run: uv build
23+
- name: Publish package
24+
env:
25+
UV_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
26+
run: uv publish

0 commit comments

Comments
 (0)