Skip to content

Commit 97e6a37

Browse files
committed
first pass on github action updates from poetry to uv
1 parent aed7709 commit 97e6a37

File tree

5 files changed

+65
-77
lines changed

5 files changed

+65
-77
lines changed

.github/workflows/build-ci-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
env:
1313
REGISTRY: ghcr.io
14-
IMAGE_NAME: opensecflow/netdriver/python-poetry
14+
IMAGE_NAME: opensecflow/netdriver/python-uv
1515

1616
jobs:
1717
build:

.github/workflows/build.yml

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- 'components/**'
1010
- 'projects/**'
1111
- 'pyproject.toml'
12-
- 'poetry.lock'
12+
- 'uv.lock'
1313
- 'tests/**'
1414
push:
1515
branches: [master, main]
@@ -18,15 +18,13 @@ on:
1818
- 'components/**'
1919
- 'projects/**'
2020
- 'pyproject.toml'
21-
- 'poetry.lock'
21+
- 'uv.lock'
2222
- 'tests/**'
2323

2424
jobs:
2525
test:
2626
name: Lint and Test
2727
runs-on: ubuntu-latest
28-
container:
29-
image: ghcr.io/opensecflow/netdriver/python-poetry
3028
permissions:
3129
contents: read
3230
packages: read
@@ -35,30 +33,31 @@ jobs:
3533
- name: Checkout code
3634
uses: actions/checkout@v4
3735

38-
- name: Verify Poetry installation
39-
run: |
40-
poetry --version
41-
poetry self show plugins
36+
- name: Install uv
37+
uses: astral-sh/setup-uv@v4
38+
39+
- name: Set up Python
40+
run: uv python install
4241

4342
- name: Install dependencies
44-
run: poetry install --no-interaction
43+
run: uv sync
4544

4645
- name: Run pylint
4746
run: |
4847
echo "Running pylint checks..."
49-
poetry run pylint bases/ components/ --exit-zero --output-format=colorized || true
48+
uv run pylint bases/ components/ --exit-zero --output-format=colorized || true
5049
continue-on-error: true
5150

5251
- name: Run unit test
5352
run: |
5453
echo "Running unit pytest..."
55-
poetry run pytest -v --tb=short -m unit
54+
uv run pytest -v --tb=short -m unit
5655
5756
5857
- name: Run integration test
5958
run: |
6059
echo "Running integration pytest..."
61-
poetry run pytest -v --tb=short --mock-dev -m integration
60+
uv run pytest -v --tb=short --mock-dev -m integration
6261
6362
- name: Generate test summary
6463
if: always()
@@ -75,8 +74,6 @@ jobs:
7574
name: Build packages
7675
needs: test
7776
runs-on: ubuntu-latest
78-
container:
79-
image: ghcr.io/opensecflow/netdriver/python-poetry
8077
permissions:
8178
contents: read
8279
packages: read
@@ -88,22 +85,23 @@ jobs:
8885
- name: Checkout code
8986
uses: actions/checkout@v4
9087

91-
- name: Verify Poetry installation
92-
run: |
93-
poetry --version
94-
poetry self show plugins
88+
- name: Install uv
89+
uses: astral-sh/setup-uv@v4
90+
91+
- name: Set up Python
92+
run: uv python install
9593

9694
- name: Install dependencies
97-
run: poetry install --no-interaction
95+
run: uv sync
9896

9997
- name: Build ${{ matrix.project }}
10098
run: |
10199
echo "Building netdriver-${{ matrix.project }}..."
102-
poetry build-project -C projects/${{ matrix.project }} --format wheel
100+
uv build --directory projects/${{ matrix.project }}
103101
104102
- name: Check package metadata
105103
run: |
106-
pip install twine
104+
uv pip install twine
107105
twine check projects/${{ matrix.project }}/dist/*.whl
108106
109107
- name: Verify package contents

.github/workflows/publish-pypi.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ jobs:
2121
publish:
2222
name: Publish Python packages
2323
runs-on: ubuntu-latest
24-
# Use pre-built container with Python and Poetry installed
25-
container:
26-
image: ghcr.io/opensecflow/netdriver/python-poetry
2724
environment: ${{ github.event.inputs.environment || 'pypi' }}
2825
permissions:
2926
contents: read
@@ -34,13 +31,14 @@ jobs:
3431
- name: Checkout code
3532
uses: actions/checkout@v4
3633

37-
- name: Verify Poetry installation
38-
run: |
39-
poetry --version
40-
poetry self show plugins
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v4
36+
37+
- name: Set up Python
38+
run: uv python install
4139

4240
- name: Install dependencies
43-
run: poetry install --no-interaction
41+
run: uv sync
4442

4543
- name: Determine projects to publish
4644
id: projects
@@ -73,17 +71,15 @@ jobs:
7371
echo "Building $project..."
7472
7573
# Clean and build
76-
poetry build-project -C "projects/$project" --format wheel
74+
uv build --directory "projects/$project"
7775
7876
# Publish
7977
if [ "$TARGET" = "testpypi" ]; then
8078
echo "Publishing $project to TestPyPI..."
81-
poetry config pypi-token.testpypi "$TESTPYPI_TOKEN"
82-
poetry publish -C "projects/$project" -r testpypi --skip-existing
79+
uv publish --directory "projects/$project" --token "$TESTPYPI_TOKEN" --publish-url https://test.pypi.org/legacy/
8380
else
8481
echo "Publishing $project to PyPI..."
85-
poetry config pypi-token.pypi "$PYPI_TOKEN"
86-
poetry publish -C "projects/$project" --skip-existing
82+
uv publish --directory "projects/$project" --token "$PYPI_TOKEN"
8783
fi
8884
8985
echo "✓ Successfully published $project to $TARGET"

.github/workflows/release-agent.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ jobs:
8484
test:
8585
name: Run tests
8686
runs-on: ubuntu-latest
87-
container:
88-
image: ghcr.io/opensecflow/netdriver/python-poetry
8987
permissions:
9088
contents: read
9189
packages: read
@@ -94,31 +92,30 @@ jobs:
9492
- name: Checkout code
9593
uses: actions/checkout@v4
9694

97-
- name: Verify Poetry installation
98-
run: |
99-
poetry --version
100-
poetry self show plugins
95+
- name: Install uv
96+
uses: astral-sh/setup-uv@v4
97+
98+
- name: Set up Python
99+
run: uv python install
101100

102101
- name: Install dependencies
103-
run: poetry install --no-interaction
102+
run: uv sync
104103

105104
- name: Run pylint
106105
run: |
107106
echo "Running pylint checks..."
108-
poetry run pylint bases/netdriver/agent components/ --exit-zero --output-format=colorized || true
107+
uv run pylint bases/netdriver/agent components/ --exit-zero --output-format=colorized || true
109108
continue-on-error: true
110109

111110
- name: Run pytest for agent
112111
run: |
113112
echo "Running pytest for agent..."
114-
poetry run pytest -v --tb=short --mock-dev
113+
uv run pytest -v --tb=short --mock-dev
115114
116115
build-and-publish:
117116
name: Build and Publish Agent to PyPI
118117
needs: [create-release, test]
119118
runs-on: ubuntu-latest
120-
container:
121-
image: ghcr.io/opensecflow/netdriver/python-poetry
122119
permissions:
123120
contents: write
124121
packages: read
@@ -128,37 +125,37 @@ jobs:
128125
- name: Checkout code
129126
uses: actions/checkout@v4
130127

131-
- name: Verify Poetry installation
132-
run: |
133-
poetry --version
134-
poetry self show plugins
128+
- name: Install uv
129+
uses: astral-sh/setup-uv@v4
130+
131+
- name: Set up Python
132+
run: uv python install
135133

136134
- name: Install dependencies
137-
run: poetry install --no-interaction
135+
run: uv sync
138136

139137
- name: Update agent version
140138
run: |
141139
VERSION=${{ needs.create-release.outputs.version }}
142140
echo "Updating netdriver-agent version to $VERSION"
143-
poetry version $VERSION -C projects/agent
141+
sed -i 's/^version = ".*"/version = "'$VERSION'"/' projects/agent/pyproject.toml
144142
145143
- name: Build agent
146144
run: |
147145
echo "Building netdriver-agent..."
148-
poetry build-project -C projects/agent --format wheel
146+
uv build --directory projects/agent
149147
150148
- name: Check package metadata
151149
run: |
152-
pip install twine
150+
uv pip install twine
153151
twine check projects/agent/dist/*.whl
154152
155153
- name: Publish to PyPI
156154
env:
157155
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
158156
run: |
159-
poetry config pypi-token.pypi "$PYPI_TOKEN"
160157
echo "Publishing netdriver-agent to PyPI..."
161-
poetry publish -C projects/agent --skip-existing
158+
uv publish --directory projects/agent --token "$PYPI_TOKEN"
162159
163160
- name: Upload wheel to release
164161
uses: softprops/action-gh-release@v1

.github/workflows/release-simunet.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ jobs:
8484
test:
8585
name: Run tests
8686
runs-on: ubuntu-latest
87-
container:
88-
image: ghcr.io/opensecflow/netdriver/python-poetry
8987
permissions:
9088
contents: read
9189
packages: read
@@ -94,31 +92,30 @@ jobs:
9492
- name: Checkout code
9593
uses: actions/checkout@v4
9694

97-
- name: Verify Poetry installation
98-
run: |
99-
poetry --version
100-
poetry self show plugins
95+
- name: Install uv
96+
uses: astral-sh/setup-uv@v4
97+
98+
- name: Set up Python
99+
run: uv python install
101100

102101
- name: Install dependencies
103-
run: poetry install --no-interaction
102+
run: uv sync
104103

105104
- name: Run pylint
106105
run: |
107106
echo "Running pylint checks..."
108-
poetry run pylint bases/netdriver/simunet components/ --exit-zero --output-format=colorized || true
107+
uv run pylint bases/netdriver/simunet components/ --exit-zero --output-format=colorized || true
109108
continue-on-error: true
110109

111110
- name: Run pytest for simunet
112111
run: |
113112
echo "Running pytest for simunet..."
114-
poetry run pytest -v --tb=short --mock-dev
113+
uv run pytest -v --tb=short --mock-dev
115114
116115
build-and-publish:
117116
name: Build and Publish Simunet to PyPI
118117
needs: [create-release, test]
119118
runs-on: ubuntu-latest
120-
container:
121-
image: ghcr.io/opensecflow/netdriver/python-poetry
122119
permissions:
123120
contents: write
124121
packages: read
@@ -128,37 +125,37 @@ jobs:
128125
- name: Checkout code
129126
uses: actions/checkout@v4
130127

131-
- name: Verify Poetry installation
132-
run: |
133-
poetry --version
134-
poetry self show plugins
128+
- name: Install uv
129+
uses: astral-sh/setup-uv@v4
130+
131+
- name: Set up Python
132+
run: uv python install
135133

136134
- name: Install dependencies
137-
run: poetry install --no-interaction
135+
run: uv sync
138136

139137
- name: Update simunet version
140138
run: |
141139
VERSION=${{ needs.create-release.outputs.version }}
142140
echo "Updating netdriver-simunet version to $VERSION"
143-
poetry version $VERSION -C projects/simunet
141+
sed -i 's/^version = ".*"/version = "'$VERSION'"/' projects/simunet/pyproject.toml
144142
145143
- name: Build simunet
146144
run: |
147145
echo "Building netdriver-simunet..."
148-
poetry build-project -C projects/simunet --format wheel
146+
uv build --directory projects/simunet
149147
150148
- name: Check package metadata
151149
run: |
152-
pip install twine
150+
uv pip install twine
153151
twine check projects/simunet/dist/*.whl
154152
155153
- name: Publish to PyPI
156154
env:
157155
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
158156
run: |
159-
poetry config pypi-token.pypi "$PYPI_TOKEN"
160157
echo "Publishing netdriver-simunet to PyPI..."
161-
poetry publish -C projects/simunet --skip-existing
158+
uv publish --directory projects/simunet --token "$PYPI_TOKEN"
162159
163160
- name: Upload wheel to release
164161
uses: softprops/action-gh-release@v1

0 commit comments

Comments
 (0)