Skip to content

Commit 8bf1a3f

Browse files
committed
uv 💜
1 parent a557d34 commit 8bf1a3f

File tree

5 files changed

+1001
-62
lines changed

5 files changed

+1001
-62
lines changed

.github/workflows/deploy.yml

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build & Upload Python Package to PYPI production
1+
name: Build & Upload Python Package to PyPI
22

33
on:
44
release:
@@ -10,28 +10,43 @@ jobs:
1010
deploy:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
- name: Set up Python
15-
uses: actions/setup-python@v2
13+
- name: Checkout 🛒
14+
uses: actions/checkout@v4
15+
16+
- name: Install uv 💜
17+
uses: astral-sh/setup-uv@v6
18+
19+
- name: Install and run ruff 🐶
20+
uses: astral-sh/ruff-action@v3
21+
continue-on-error: true
22+
23+
- name: Set up Python 🐍
24+
uses: actions/setup-python@v4
1625
with:
17-
python-version: '3.11'
18-
- name: Install dependencies
26+
python-version: "3.13"
27+
28+
- name: Install dependencies 📦
1929
run: |
20-
python -m pip install --upgrade pip
21-
pip install setuptools wheel twine
22-
pip install flake8 pytest
23-
pip install -r requirements.txt
24-
- name: Lint with flake8
30+
uv sync --all-groups --frozen
31+
32+
- name: Lint with flake8 ❄️
2533
run: |
26-
# stop the build if there are Python syntax errors or undefined names
27-
flake8 src/ --config=flake8.cfg
28-
- name: Test with pytest
34+
uv run flake8
35+
36+
- name: Test with pytest ✅
37+
run: |
38+
uv run pytest tests
39+
40+
- name: Version replacement based on tag ↔️
41+
if: github.ref_type == 'tag'
2942
run: |
30-
pytest tests
31-
- name: Build and publish
43+
TAG_VERSION=${GITHUB_REF#refs/tags/}
44+
echo "Tag version: $TAG_VERSION"
45+
uv version $TAG_VERSION
46+
47+
- name: Build and publish 🚀
3248
env:
33-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
34-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
49+
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
3550
run: |
36-
python setup.py sdist bdist_wheel
37-
twine upload dist/*
51+
uv build
52+
uv publish
Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,48 @@
1-
name: Deploy To Test PYPI
1+
name: Build & Upload Python Package To Test PyPI
22

33
on: workflow_dispatch
44

55
jobs:
66
deploy:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
- name: Set up Python
11-
uses: actions/setup-python@v2
9+
- name: Checkout 🛒
10+
uses: actions/checkout@v4
11+
12+
- name: Install uv 💜
13+
uses: astral-sh/setup-uv@v6
14+
15+
- name: Install and run ruff 🐶
16+
uses: astral-sh/ruff-action@v3
17+
continue-on-error: true
18+
19+
- name: Set up Python 🐍
20+
uses: actions/setup-python@v4
1221
with:
13-
python-version: '3.11'
14-
skip_existing: true
15-
- name: Install dependencies
22+
python-version: "3.13"
23+
24+
- name: Install dependencies 📦
1625
run: |
17-
python -m pip install --upgrade pip
18-
pip install setuptools wheel twine
19-
pip install flake8 pytest
20-
pip install -r requirements.txt
21-
- name: Lint with flake8
26+
uv sync --all-groups --frozen
27+
28+
- name: Lint with flake8 ❄️
2229
run: |
23-
# stop the build if there are Python syntax errors or undefined names
24-
flake8 src/ --config=flake8.cfg
25-
- name: Test with pytest
30+
uv run flake8
31+
32+
- name: Test with pytest ✅
33+
run: |
34+
uv run pytest tests
35+
36+
- name: Version replacement based on tag ↔️
37+
if: github.ref_type == 'tag'
2638
run: |
27-
pytest tests
28-
- name: Build and publish
39+
TAG_VERSION=${GITHUB_REF#refs/tags/}
40+
echo "Tag version: $TAG_VERSION"
41+
uv version $TAG_VERSION
42+
43+
- name: Build and publish 🚀
2944
env:
30-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME_TEST }}
31-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD_TEST }}
45+
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN_TEST_PYPI }}
3246
run: |
33-
python setup.py sdist bdist_wheel
34-
twine upload --repository testpypi dist/*
47+
uv build
48+
uv publish --index testpypi

.github/workflows/push_dev.yml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,39 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
14+
python-version: ["3.8", "3.14"]
1515

1616
steps:
17-
- uses: actions/checkout@v4
18-
- name: Set up Python ${{ matrix.python-version }}
17+
- name: Checkout 🛒
18+
uses: actions/checkout@v4
19+
20+
- name: Install uv 💜
21+
uses: astral-sh/setup-uv@v6
22+
23+
- name: Install and run ruff 🐶
24+
uses: astral-sh/ruff-action@v3
25+
continue-on-error: true
26+
27+
- name: Set up Python ${{ matrix.python-version }} 🐍
1928
uses: actions/setup-python@v4
2029
with:
2130
python-version: ${{ matrix.python-version }}
22-
- name: Install dependencies
31+
32+
- name: Install dependencies 📦
2333
run: |
24-
python -m pip install --upgrade pip
25-
pip install flake8 pytest
26-
pip install -r requirements.txt
27-
- name: Lint with flake8
34+
uv sync --all-groups --frozen
35+
36+
- name: Lint with flake8 ❄️
37+
run: |
38+
uv run flake8
39+
40+
- name: Test with pytest ✅
2841
run: |
29-
# stop the build if there are Python syntax errors or undefined names
30-
flake8 src/ --config=flake8.cfg
31-
- name: Test with pytest
42+
uv run pytest tests
43+
44+
- name: Version replacement based on tag ↔️
45+
if: github.ref_type == 'tag'
3246
run: |
33-
pytest tests
47+
TAG_VERSION=${GITHUB_REF#refs/tags/}
48+
echo "Tag version: $TAG_VERSION"
49+
uv version $TAG_VERSION

.github/workflows/push_main.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,25 @@ jobs:
99
docs:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
13-
- name: Set up Python
12+
- name: Checkout 🛒
13+
uses: actions/checkout@v4
14+
15+
- name: Install uv 💜
16+
uses: astral-sh/setup-uv@v6
17+
18+
- name: Set up Python 🐍
1419
uses: actions/setup-python@v4
1520
with:
1621
python-version: "3.13"
17-
- name: Create html documentation
22+
23+
- name: Create html documentation 📚
1824
run: |
19-
pip install --user pdoc3
20-
python setup.py install
21-
pdoc --html -f -o .\docs keboola.component
22-
mv .docs/keboola/component/* docs
23-
rm -r .docs/keboola
24-
- name: Commit docs
25+
uv sync --all-groups --frozen
26+
uv run pdoc --html -f -o ./docs keboola.component
27+
mv ./docs/keboola/component/* docs
28+
rm -r ./docs/keboola
29+
30+
- name: Commit docs 📝
2531
run: |
2632
git config --global user.name 'KCF'
2733
git config --global user.email 'kcf@users.noreply.github.com'

0 commit comments

Comments
 (0)