Skip to content

Commit 9b2fdf6

Browse files
nl0sir-sigurd
andauthored
Migrate quilt3 package to UV for dependency management (#4507)
Co-authored-by: Sergey Fedoseev <[email protected]>
1 parent 7ea391a commit 9b2fdf6

34 files changed

+6541
-1740
lines changed

.flake8

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

.github/workflows/py-ci.yml

Lines changed: 47 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -6,82 +6,66 @@ on:
66
- "*"
77
pull_request:
88
merge_group:
9+
env:
10+
UV_LOCKED: 1
911
jobs:
10-
linter:
12+
# Lint the entire Python codebase (except catalog/ and api/python/)
13+
lint-root:
1114
runs-on: ubuntu-latest
1215
steps:
1316
- uses: actions/checkout@v5
14-
- uses: actions/setup-python@v5
15-
with:
16-
python-version: '3.11'
17-
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip setuptools
20-
python -m pip install 'pylint==3.2.7' 'pycodestyle>=2.6.1'
21-
- name: Run pylint
22-
run: |
23-
pylint .
24-
- name: Run pycodestyle
25-
run: |
26-
pycodestyle $(find -name '*.py' -not -path './venv/*')
17+
- uses: astral-sh/setup-uv@v6
18+
- name: Run Ruff linter on entire codebase
19+
run: uvx [email protected] check . --exclude catalog/ --exclude api/python/
2720

28-
isort:
21+
lint:
2922
runs-on: ubuntu-latest
23+
defaults:
24+
run:
25+
working-directory: api/python
3026
steps:
3127
- uses: actions/checkout@v5
32-
- uses: actions/setup-python@v5
33-
with:
34-
python-version: '3.11'
35-
- name: Install dependencies
36-
run: |
37-
python -m pip install --upgrade pip setuptools
38-
python -m pip install isort
39-
- name: Run isort
40-
run: |
41-
isort --check --diff .
28+
- uses: astral-sh/setup-uv@v6
29+
- name: Lint
30+
run: uv run poe lint
31+
32+
# Formatting check disabled until codebase is reformatted
33+
# format:
34+
# runs-on: ubuntu-latest
35+
# defaults:
36+
# run:
37+
# working-directory: api/python
38+
# steps:
39+
# - uses: actions/checkout@v5
40+
# - uses: astral-sh/setup-uv@v6
41+
# - name: Check formatting
42+
# run: uv run poe fmt --check
4243

4344
test-gendocs:
4445
runs-on: ubuntu-latest
46+
defaults:
47+
run:
48+
working-directory: api/python
4549
env:
4650
QUILT_DISABLE_USAGE_METRICS: true
4751
steps:
4852
- uses: actions/checkout@v5
49-
- uses: actions/setup-python@v5
50-
with:
51-
# on newer versions it crashes with
52-
# TypeError: <classmethod(<function Package.install at 0x105219f30>)> is not a callable object
53-
python-version: '3.9'
54-
- name: install deps
55-
run: |
56-
python -m pip install --upgrade pip setuptools
57-
python -m pip install api/python nbconvert git+https://github.com/quiltdata/[email protected]+quilt3.2
58-
- name: generate docs
59-
run: cd gendocs && python build.py
60-
- name: show invisible changes via cat
61-
run: git diff | cat -A
62-
- name: check there are no changes
63-
run: git diff --exit-code
53+
- uses: astral-sh/setup-uv@v6
54+
- name: Check generated docs are up-to-date
55+
run: uv run poe gendocs-check
6456

6557
test-testdocs:
6658
runs-on: ubuntu-latest
6759
env:
6860
QUILT_DISABLE_USAGE_METRICS: true
6961
defaults:
7062
run:
71-
working-directory: testdocs
63+
working-directory: api/python
7264
steps:
7365
- uses: actions/checkout@v5
74-
- uses: actions/setup-python@v5
75-
with:
76-
python-version: '3.11'
77-
- name: install poetry
78-
run: python -m pip install poetry
79-
- name: install deps
80-
run: poetry install
81-
- name: install current version of quilt
82-
run: poetry run pip install ../api/python
83-
- name: test codeblocks
84-
run: poetry run pytest --codeblocks ../docs
66+
- uses: astral-sh/setup-uv@v6
67+
- name: Test codeblocks
68+
run: uv run poe testdocs
8569

8670
test-client:
8771
strategy:
@@ -91,18 +75,14 @@ jobs:
9175
runs-on: ${{ matrix.os }}
9276
env:
9377
QUILT_DISABLE_USAGE_METRICS: true
78+
defaults:
79+
run:
80+
working-directory: api/python
9481
steps:
9582
- uses: actions/checkout@v5
96-
- uses: actions/setup-python@v5
97-
with:
98-
python-version: ${{ matrix.python-version }}
99-
- name: Install dependencies
100-
run: |
101-
python -m pip install --upgrade pip setuptools
102-
python -m pip install -e api/python[tests]
83+
- uses: astral-sh/setup-uv@v6
10384
- name: Run Pytest
104-
run: |
105-
pytest --cov=api/python api/python
85+
run: uv run --python ${{ matrix.python-version }} poe test-cov --cov-report xml
10686
- uses: codecov/codecov-action@v5
10787
env:
10888
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -136,24 +116,16 @@ jobs:
136116
working-directory: api/python
137117
steps:
138118
- uses: actions/checkout@v5
139-
- uses: actions/setup-python@v5
140-
with:
141-
python-version: '3.12'
142-
- name: Install dependencies
143-
run: |
144-
python -m pip install --upgrade pip setuptools
145-
python -m pip install build==1.3.0 twine==6.1.0
119+
- uses: astral-sh/setup-uv@v6
146120
- name: verify git tag vs. version
147-
env:
148-
CIRCLE_TAG: ${{ github.ref_name }}
149-
run: python setup.py verify
121+
run: uv run poe verify-release-tag "${{ github.ref_name }}"
150122
- name: build
151-
run: python -m build
123+
run: uv build
152124
- name: upload to PyPI
153125
env:
154-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
155-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
156-
run: twine upload dist/*
126+
UV_PUBLISH_USERNAME: ${{ secrets.PYPI_USERNAME }}
127+
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
128+
run: uv publish
157129

158130
test-lambda:
159131
strategy:

.github/workflows/test-quilt3-admin-codegen.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,9 @@ jobs:
2121
runs-on: ubuntu-latest
2222
defaults:
2323
run:
24-
working-directory: ./api/python/quilt3-admin
24+
working-directory: ./api/python
2525
steps:
2626
- uses: actions/checkout@v5
27-
- uses: actions/setup-python@v5
28-
with:
29-
python-version-file: 'api/python/quilt3-admin/.python-version'
30-
cache: 'pip'
31-
cache-dependency-path: 'api/python/quilt3-admin/requirements.txt'
32-
- run: pip install -r requirements.txt
33-
- run: rm -r ../quilt3/admin/_graphql_client
34-
- run: ariadne-codegen
35-
- name: Check for changes
36-
run: git diff --exit-code
27+
- uses: astral-sh/setup-uv@v6
28+
- name: Check GraphQL client is up-to-date
29+
run: uv run poe gql-check

.gitignore

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ metastore_db
1414
derby.log
1515

1616
# let users have their own local ignores
17-
**/*.gitignore
1817

1918
# Visual Studio Code
2019
.vscode
2120
.imdone
2221

2322
# Test coverage
24-
.coverage
23+
.coverage*
24+
coverage.xml
2525
cov_html/*
2626

2727
# Pytest cache
@@ -40,13 +40,7 @@ registry/dpmd
4040

4141
# Doc Build
4242
_build
43-
testdocs/*.json*
44-
testdocs/test_workflow
45-
testdocs/references
46-
testdocs/notebooks
47-
testdocs/scripts
4843

4944
.env
5045

51-
.venv
5246
.aider*

api/python/.pylintrc

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

api/python/MANIFEST.in

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

api/python/Makefile

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

api/python/README.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Quilt manages data like code (with packages, repositories, browsing and
2+
revision history) so that teams can experiment faster in machine learning,
3+
biotech, and other data-driven domains.
4+
5+
The `quilt3` PyPI package allows you to build, push, and install data packages.
6+
Visit the `documentation quickstart <https://docs.quilt.bio/quickstart>`_
7+
to learn more.

0 commit comments

Comments
 (0)