Skip to content

Commit c6f7564

Browse files
committed
uv 💜
1 parent a557d34 commit c6f7564

File tree

5 files changed

+998
-62
lines changed

5 files changed

+998
-62
lines changed

.github/workflows/deploy.yml

Lines changed: 34 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,42 @@ 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+
22+
- name: Set up Python 🐍
23+
uses: actions/setup-python@v4
1624
with:
17-
python-version: '3.11'
18-
- name: Install dependencies
25+
python-version: "3.13"
26+
27+
- name: Install dependencies 📦
1928
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
29+
uv sync --all-groups --frozen
30+
31+
- name: Lint with flake8 ❄️
2532
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
33+
uv run flake8
34+
35+
- name: Test with pytest ✅
36+
run: |
37+
uv run pytest tests
38+
39+
- name: Version replacement based on tag ↔️
40+
if: github.ref_type == 'tag'
2941
run: |
30-
pytest tests
31-
- name: Build and publish
42+
TAG_VERSION=${GITHUB_REF#refs/tags/}
43+
echo "Tag version: $TAG_VERSION"
44+
uv version $TAG_VERSION
45+
46+
- name: Build and publish 🚀
3247
env:
33-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
34-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
48+
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
3549
run: |
36-
python setup.py sdist bdist_wheel
37-
twine upload dist/*
50+
uv build
51+
uv publish
Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,47 @@
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+
18+
- name: Set up Python 🐍
19+
uses: actions/setup-python@v4
1220
with:
13-
python-version: '3.11'
14-
skip_existing: true
15-
- name: Install dependencies
21+
python-version: "3.13"
22+
23+
- name: Install dependencies 📦
1624
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
25+
uv sync --all-groups --frozen
26+
27+
- name: Lint with flake8 ❄️
2228
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
29+
uv run flake8
30+
31+
- name: Test with pytest ✅
32+
run: |
33+
uv run pytest tests
34+
35+
- name: Version replacement based on tag ↔️
36+
if: github.ref_type == 'tag'
2637
run: |
27-
pytest tests
28-
- name: Build and publish
38+
TAG_VERSION=${GITHUB_REF#refs/tags/}
39+
echo "Tag version: $TAG_VERSION"
40+
uv version $TAG_VERSION
41+
42+
- name: Build and publish 🚀
2943
env:
30-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME_TEST }}
31-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD_TEST }}
44+
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN_TEST_PYPI }}
3245
run: |
33-
python setup.py sdist bdist_wheel
34-
twine upload --repository testpypi dist/*
46+
uv build
47+
uv publish --index testpypi

.github/workflows/push_dev.yml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,38 @@ 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+
26+
- name: Set up Python ${{ matrix.python-version }} 🐍
1927
uses: actions/setup-python@v4
2028
with:
2129
python-version: ${{ matrix.python-version }}
22-
- name: Install dependencies
30+
31+
- name: Install dependencies 📦
2332
run: |
24-
python -m pip install --upgrade pip
25-
pip install flake8 pytest
26-
pip install -r requirements.txt
27-
- name: Lint with flake8
33+
uv sync --all-groups --frozen
34+
35+
- name: Lint with flake8 ❄️
36+
run: |
37+
uv run flake8
38+
39+
- name: Test with pytest ✅
2840
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
41+
uv run pytest tests
42+
43+
- name: Version replacement based on tag ↔️
44+
if: github.ref_type == 'tag'
3245
run: |
33-
pytest tests
46+
TAG_VERSION=${GITHUB_REF#refs/tags/}
47+
echo "Tag version: $TAG_VERSION"
48+
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)