Skip to content

Commit eb448e5

Browse files
committed
ci: πŸ’š Migrate from Poetry to uv
1 parent 12de14c commit eb448e5

File tree

5 files changed

+78
-86
lines changed

5 files changed

+78
-86
lines changed
Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'code-style'
1+
name: code-style
22

33
on:
44
pull_request:
@@ -9,22 +9,17 @@ jobs:
99
code_style:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: 'Checkout sources'
12+
- name: Checkout sources
1313
uses: actions/checkout@v4
1414

15-
- name: 'Set up Python'
16-
uses: actions/setup-python@v4
17-
with:
18-
python-version: 3.12
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v5
1917

20-
- name: 'Set up Poetry'
21-
uses: snok/install-poetry@v1
18+
- name: Install dependencies
19+
run: uv sync --locked --dev
2220

23-
- name: 'Install dependencies'
24-
run: poetry install --no-interaction --no-root
21+
- name: Lint code with Ruff
22+
run: uv run ruff check .
2523

26-
- name: 'Lint code with Ruff'
27-
run: poetry run ruff check .
28-
29-
- name: 'Type cheking with MyPy'
30-
run: poetry run mypy codelimit/
24+
- name: Type cheking with MyPy
25+
run: uv run mypy codelimit/

β€Ž.github/workflows/main.ymlβ€Ž

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,35 @@ jobs:
1010
ci:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: 'Checkout sources'
14-
uses: actions/checkout@v3
13+
- name: Checkout sources
14+
uses: actions/checkout@v4
1515

16-
- name: 'Set up Python'
17-
uses: actions/setup-python@v4
18-
with:
19-
python-version: 3.12
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v5
2018

21-
- name: 'Set up Poetry'
22-
uses: snok/install-poetry@v1
19+
- name: Install dependencies
20+
run: uv sync --locked --dev
2321

24-
- name: 'Install dependencies'
25-
run: poetry install --no-interaction --no-root
22+
- name: Run unit-tests with coverage
23+
run: uv run pytest --cov --cov-report=xml
2624

27-
- name: 'Run unit-tests with coverage'
28-
run: poetry run pytest --cov --cov-report=xml
29-
30-
- name: 'Run codelimit'
25+
- name: Run codelimit
3126
run: |
3227
echo "Scan codebase"
33-
poetry run codelimit scan .
28+
uv run codelimit scan .
3429
echo "Generate report"
35-
poetry run codelimit report .
30+
uv run codelimit report .
3631
echo "Generate report in Markdown"
37-
poetry run codelimit report --format markdown .
32+
uv run codelimit report --format markdown .
3833
echo "Generate findings"
39-
poetry run codelimit findings .
34+
uv run codelimit findings .
4035
echo "Generate findings (Markdown)"
41-
poetry run codelimit findings --format markdown .
36+
uv run codelimit findings --format markdown .
4237
43-
- name: 'Build and run codelimit binary'
38+
- name: Build and run codelimit binary
4439
run: |
45-
poetry run pyinstaller -n codelimit -F codelimit/__main__.py
40+
uv run pyinstaller -n codelimit -F codelimit/__main__.py
4641
./dist/codelimit scan .
4742
48-
- name: 'Upload coverage reports to Codecov'
43+
- name: Upload coverage reports to Codecov
4944
uses: codecov/codecov-action@v3
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'regression'
1+
name: regression
22

33
on:
44
push:
@@ -12,19 +12,14 @@ jobs:
1212
analyze:
1313
runs-on: self-hosted
1414
steps:
15-
- name: 'Checkout sources'
16-
uses: actions/checkout@v3
15+
- name: Checkout sources
16+
uses: actions/checkout@v4
1717

18-
- name: 'Set up Python'
19-
uses: actions/setup-python@v4
20-
with:
21-
python-version: 3.12
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v5
2220

23-
- name: 'Set up Poetry'
24-
uses: snok/install-poetry@v1
21+
- name: Install dependencies
22+
run: uv sync --locked --dev
2523

26-
- name: 'Install dependencies'
27-
run: poetry install --no-interaction --no-root
28-
29-
- name: 'Run regression runner'
30-
run: poetry run poe regression run
24+
- name: Run regression runner
25+
run: uv run poe regression run

β€Ž.github/workflows/release.ymlβ€Ž

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: release
2+
23
on: [workflow_dispatch]
4+
35
jobs:
46
release:
57
runs-on: ubuntu-latest
@@ -13,53 +15,59 @@ jobs:
1315
outputs:
1416
version: ${{ steps.release.outputs.version }}
1517
steps:
16-
- name: 'Checkout sources'
17-
uses: actions/checkout@v3
18+
- name: Checkout sources
19+
uses: actions/checkout@v4
1820
with:
1921
fetch-depth: 0
20-
- name: 'Set up Python'
21-
uses: actions/setup-python@v2
22-
with:
23-
python-version: '3.10'
24-
- name: 'Set up Poetry'
25-
uses: snok/install-poetry@v1
26-
- name: 'Install dependencies'
27-
run: poetry install --no-interaction --no-root
28-
- name: 'Python Semantic Release'
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v5
25+
26+
- name: Install dependencies
27+
run: uv sync --locked --dev
28+
29+
- name: Python Semantic Release
2930
id: release
3031
uses: relekang/python-semantic-release@master
3132
with:
3233
github_token: ${{ secrets.GITHUB_TOKEN }}
33-
- name: 'Update checkout'
34+
35+
- name: Update checkout
3436
run: |
3537
git pull
3638
if: steps.release.outputs.released == 'true'
37-
- name: 'Build distribution'
38-
run: poetry build
39-
- name: 'Publish to PyPI'
39+
40+
- name: Build distribution
41+
run: uv build
42+
43+
- name: Publish to PyPI
4044
uses: pypa/gh-action-pypi-publish@release/v1
4145
if: steps.release.outputs.released == 'true'
42-
- name: 'Update files'
46+
47+
- name: Update files
4348
uses: MathieuSoysal/file-updater-for-release@v1.0.1
4449
with:
4550
files: README.md
4651
prefix: 'rev: '
4752
with-checkout: false
4853
version: ${{ steps.release.outputs.version }}
49-
- name: 'Commit GitHub Action distribution'
54+
55+
- name: Commit GitHub Action distribution
5056
run: |
5157
git config --local user.email "action@github.com"
5258
git config --local user.name "GitHub Action"
5359
git add README.md
5460
git commit -m 'Update files' || true
55-
- name: 'Push changes'
61+
62+
- name: Push changes
5663
uses: ad-m/github-push-action@master
5764
with:
5865
github_token: ${{ secrets.GITHUB_TOKEN }}
5966
branch: ${{ github.ref }}
6067
force: true
68+
6169
release_binaries:
62-
name: 'Release binaries'
70+
name: Release binaries
6371
needs: release
6472
defaults:
6573
run:
@@ -71,40 +79,40 @@ jobs:
7179
- os: macos-latest
7280
TARGET: macos
7381
CMD_BUILD: |
74-
poetry run pyinstaller \
82+
uv run pyinstaller \
7583
-n codelimit -F codelimit/__main__.py
7684
mv dist/codelimit dist/codelimit-macos
7785
OUT_FILE_NAME: dist/codelimit-macos
7886
- os: windows-latest
7987
TARGET: windows
8088
CMD_BUILD: |
81-
poetry run pyinstaller \
89+
uv run pyinstaller \
8290
-n codelimit --onefile -c codelimit/__main__.py
8391
OUT_FILE_NAME: dist/codelimit.exe
8492
- os: ubuntu-22.04
8593
TARGET: linux
8694
CMD_BUILD: |
87-
poetry run pyinstaller \
95+
uv run pyinstaller \
8896
-n codelimit -F codelimit/__main__.py
8997
mv dist/codelimit dist/codelimit-linux
9098
OUT_FILE_NAME: dist/codelimit-linux
9199
steps:
92-
- name: 'Checkout sources'
93-
uses: actions/checkout@v3
100+
- name: Checkout sources
101+
uses: actions/checkout@v4
94102
with:
95103
fetch-depth: 0
96104
ref: main
97-
- name: 'Set up Python'
98-
uses: actions/setup-python@v4
99-
with:
100-
python-version: '3.10'
101-
- name: 'Install Poetry'
102-
uses: snok/install-poetry@v1
103-
- name: 'Install dependencies'
104-
run: poetry install --no-interaction --no-root
105-
- name: 'Build codelimit with pyinstaller for ${{matrix.TARGET}}'
105+
106+
- name: Install uv
107+
uses: astral-sh/setup-uv@v5
108+
109+
- name: Install dependencies
110+
run: uv sync --locked --dev
111+
112+
- name: Build codelimit with pyinstaller for ${{matrix.TARGET}}
106113
run: ${{matrix.CMD_BUILD}}
107-
- name: 'Release'
114+
115+
- name: Release
108116
uses: softprops/action-gh-release@v1
109117
with:
110118
tag_name: ${{ format('v{0}', needs.release.outputs.version) }}

β€Žpyproject.tomlβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ ignore_missing_imports = true
5353

5454
[tool.semantic_release]
5555
branch = "main"
56-
version_toml = [ "pyproject.toml:tool.poetry.version" ]
5756
version_variables = [ "codelimit/version.py:version" ]
5857
upload_to_repository = false
5958
upload_to_release = false

0 commit comments

Comments
Β (0)