Skip to content

Commit 0855459

Browse files
committed
Some more adjustments for uv
1 parent 68fca78 commit 0855459

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,22 @@ jobs:
3636
- name: check-java
3737
run: java --version
3838

39-
- name: Install Python
40-
uses: actions/setup-python@v5
41-
with:
42-
python-version: '3.12'
39+
- name: Install Uv
40+
uses: astral-sh/setup-uv@v4
4341

44-
- name: Install Poetry
45-
uses: snok/install-poetry@v1
42+
- name: "Set up Python"
43+
uses: actions/setup-python@v5
4644
with:
47-
version: 1.8.1
48-
plugins: poetry-plugin-export
45+
python-version-file: "rewrite/.python-version"
4946

5047
- name: build-java
5148
run: ./gradlew ${{ env.GRADLE_SWITCHES }} build
5249

5350
- name: build-python
5451
run: |
55-
for directory in rewrite/rewrite-*/; do
56-
if [ -f "$directory/pyproject.toml" ]; then
57-
echo "Building project in $directory"
58-
cd "$directory"
59-
poetry install --no-interaction --no-ansi
60-
poetry build
61-
poetry run pytest
62-
cd - > /dev/null
63-
fi
64-
done
52+
echo "Building project in rewrite"
53+
cd "rewrite"
54+
uv sync --all-extras --dev
6555
6656
- name: publish-snapshots
6757
if: github.event_name != 'pull_request'

rewrite-python/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dependencies {
3030
testImplementation("org.junit-pioneer:junit-pioneer:latest.release")
3131
}
3232

33-
val poetryProjectDir = file("../rewrite")
33+
val pythonProjectDir = file("../rewrite")
3434
val outputDir = layout.buildDirectory.dir("resources/main/META-INF")
3535
val requirementsFile = outputDir.map { it.file("python-requirements.txt") }
3636

@@ -42,8 +42,8 @@ tasks.register("prepareOutputDir") {
4242

4343
tasks.register<Exec>("exportPoetryRequirements") {
4444
dependsOn("prepareOutputDir")
45-
workingDir = poetryProjectDir
46-
commandLine("sh", "-c", "poetry export --without-hashes -o ${requirementsFile.get().asFile.absolutePath}")
45+
workingDir = pythonProjectDir
46+
commandLine("sh", "-c", "uv export --no-header --frozen --no-hashes --no-dev -o ${requirementsFile.get().asFile.absolutePath}")
4747
standardOutput = System.out
4848
errorOutput = System.err
4949
}

0 commit comments

Comments
 (0)