Skip to content

Commit 792e579

Browse files
committed
chore: migrate poetry to uv for dep management
1 parent 61fa940 commit 792e579

7 files changed

Lines changed: 3245 additions & 1186 deletions

File tree

.github/workflows/build.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,22 @@ jobs:
1616
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
1717

1818
steps:
19-
- uses: actions/checkout@v4
20-
- name: Setup Python # Set Python version
21-
uses: actions/setup-python@v5
19+
- uses: actions/checkout@v6
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v8.0.0
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424
- name: Install dependencies
2525
run: |
26-
python -m pip install --upgrade pip
27-
python -m pip install poetry
28-
poetry config virtualenvs.create false
29-
poetry install -E all -v
30-
python -m pip install flake8
31-
python -m pip install mypy
26+
uv sync --all-extras
3227
- name: Run mypy check
33-
run: mypy -p varname
28+
run: uv run mypy -p varname
3429
- name: Run flake8
35-
run: flake8 varname
30+
run: uv run flake8 varname
3631
- name: Test with pytest
37-
run: pytest tests/ --junitxml=junit/test-results-${{ matrix.python-version }}.xml
32+
run: uv run pytest tests/ --junitxml=junit/test-results-${{ matrix.python-version }}.xml
3833
- name: Upload pytest test results
39-
uses: actions/upload-artifact@v4
34+
uses: actions/upload-artifact@v7
4035
with:
4136
name: pytest-results-${{ matrix.python-version }}
4237
path: junit/test-results-${{ matrix.python-version }}.xml
@@ -56,13 +51,13 @@ jobs:
5651
matrix:
5752
python-version: ["3.12"]
5853
steps:
59-
- uses: actions/checkout@v4
60-
- name: Setup Python # Set Python version
61-
uses: actions/setup-python@v5
62-
- name: Install dependencies
54+
- uses: actions/checkout@v6
55+
- name: Install uv
56+
uses: astral-sh/setup-uv@v8.0.0
57+
with:
58+
python-version: ${{ matrix.python-version }}
59+
- name: Build and publish to PyPI
6360
run: |
64-
python -m pip install --upgrade pip
65-
python -m pip install poetry
66-
- name: Publish to PyPI
67-
run: poetry publish --build -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }}
61+
uv build
62+
uv publish --username ${{ secrets.PYPI_USER }} --password ${{ secrets.PYPI_PASSWORD }}
6863
if: success()

.github/workflows/docs.yml

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,61 +7,24 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: ["3.10"]
10+
python-version: ["3.12"]
1111
steps:
12-
- uses: actions/checkout@v4
13-
- name: Setup Python # Set Python version
14-
uses: actions/setup-python@v5
12+
- uses: actions/checkout@v6
13+
- name: Install uv
14+
uses: astral-sh/setup-uv@v8.0.0
1515
with:
1616
python-version: ${{ matrix.python-version }}
1717
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip
20-
python -m pip install poetry
21-
poetry install -v
18+
run: uv sync --group docs
2219
- name: Update docs
2320
run: |
24-
poetry run python -m pip install mkdocs
25-
poetry run python -m pip install -r docs/requirements.txt
2621
cd docs
2722
cp ../README.md index.md
2823
cp ../logo.png ./
2924
cd ..
30-
poetry run mkdocs build --clean
25+
uv run mkdocs build --clean
3126
if: success()
3227
- name: Deploy docs
3328
run: |
34-
poetry run mkdocs gh-deploy --clean --force
29+
uv run mkdocs gh-deploy --clean --force
3530
if: success() && github.ref == 'refs/heads/master'
36-
37-
fix-index:
38-
needs: docs
39-
runs-on: ubuntu-latest
40-
if: github.ref == 'refs/heads/master'
41-
strategy:
42-
matrix:
43-
python-version: ["3.10"]
44-
steps:
45-
- uses: actions/checkout@v4
46-
with:
47-
ref: gh-pages
48-
- name: Fix index.html
49-
run: |
50-
echo ':: head of index.html - before ::'
51-
head index.html
52-
sed -i '1,5{/^$/d}' index.html
53-
echo ':: head of index.html - after ::'
54-
head index.html
55-
if: success()
56-
- name: Commit changes
57-
run: |
58-
git config --local user.email "action@github.com"
59-
git config --local user.name "GitHub Action"
60-
git commit -m "Add changes" -a
61-
if: success()
62-
- name: Push changes
63-
uses: ad-m/github-push-action@master
64-
with:
65-
github_token: ${{ secrets.GITHUB_TOKEN }}
66-
branch: gh-pages
67-
if: success()

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ export/
101101
*.queue.txt
102102
site/
103103

104-
# poetry
105-
# poetry.lock
104+
# uv
105+
# uv.lock
106106

107107
# backup files
108108
*.bak

0 commit comments

Comments
 (0)