Skip to content

Commit 8a83e0d

Browse files
authored
uv in workflows (#107)
1 parent 64c4589 commit 8a83e0d

File tree

5 files changed

+30
-249
lines changed

5 files changed

+30
-249
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,25 @@ jobs:
4444
with:
4545
python-version-file: "rewrite/.python-version"
4646

47+
- name: Install uv
48+
uses: astral-sh/setup-uv@v4
49+
4750
- name: build-java
4851
run: ./gradlew ${{ env.GRADLE_SWITCHES }} build
4952

50-
- name: build-python
53+
- name: Install dependencies
54+
run: |
55+
cd rewrite
56+
uv python install
57+
uv sync --all-extras
58+
59+
- name: Run tests
60+
run: |
61+
poe test
62+
63+
- name: Run build
5164
run: |
52-
echo "Building project in rewrite"
53-
cd "rewrite"
54-
uv sync --all-extras --dev
65+
uv build
5566
5667
- name: publish-snapshots
5768
if: github.event_name != 'pull_request'

.github/workflows/publish.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ jobs:
4040
- name: Install Python
4141
uses: actions/setup-python@v5
4242
with:
43-
python-version: '3.12'
43+
python-version: "3.12"
4444

45-
- name: Install Poetry
46-
uses: snok/install-poetry@v1
45+
- name: Install uv
46+
uses: astral-sh/setup-uv@v4
4747

4848
- name: publish-candidate
4949
if: contains(github.ref, '-rc.')
@@ -78,15 +78,18 @@ jobs:
7878
echo "Extracted version: $version"
7979
echo "::set-output name=VERSION::$version"
8080
81-
- name: Set project version with Poetry
81+
- name: Set project version
8282
working-directory: rewrite
83-
run: poetry version ${{ steps.extract_version.outputs.VERSION }}
83+
run: |
84+
uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version ${{ steps.extract_version.outputs.VERSION }}
8485
8586
- name: publish-python
8687
working-directory: rewrite
8788
if: (!contains(github.ref, '-rc.'))
8889
run: |
89-
poetry install --no-interaction --no-ansi
90-
poetry build
91-
poetry publish --username __token__ --password ${{ secrets.PYPI_TOKEN }}
90+
rm -rf .venv
91+
uv python install
92+
uv sync --all-extras
93+
uv build
94+
uv publish --token ${{ secrets.PYPI_TOKEN }}
9295
git restore --staged --worktree . && git clean -fd

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ build/
33
out/
44
bin/
55
example-data/
6-
.idea/
6+
.idea/
7+
8+
.DS_Store

rewrite/pyproject.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@ description = "OpenRewrite is a mass automated refactoring engine."
88
version = "0.0.0" # Updated dynamically during release
99
authors = [{ name = "Moderne Inc.", email = "support@moderne.io" }]
1010
license = { text = "Moderne, Inc. Commercial License" }
11-
dependencies = [
12-
"pytest>=8.3.4",
13-
"more-itertools>=10.4.0",
14-
"openrewrite-remote",
15-
"pip>=24.3.1",
16-
"pypi-simple>=1.6.1",
17-
]
11+
dependencies = ["pytest>=8.3.4", "more-itertools>=10.4.0", "openrewrite-remote"]
1812
requires-python = ">=3.12, <4"
1913

2014
[tool.setuptools.packages.find]
@@ -24,7 +18,6 @@ exclude = []
2418
[dependency-groups]
2519
dev = [
2620
"pytest==8.3.4",
27-
"pytest-asyncio==0.24.0",
2821
"mypy==1.13.0",
2922
"poethepoet==0.31.1",
3023
"black==24.10.0",

0 commit comments

Comments
 (0)