Skip to content

Commit 11d8a0f

Browse files
chore: migrate chart_data_extractor and CI from Poetry to uv (#341)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: mish@e2b.dev <mish@e2b.dev>
1 parent f56a1ed commit 11d8a0f

10 files changed

Lines changed: 966 additions & 1099 deletions

File tree

‎.github/workflows/build_prod_template.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ jobs:
4040
uppercase: 'true'
4141
prefix: 'tool_version_'
4242

43-
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
43+
- name: Install uv
44+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
4445
with:
46+
version: '${{ env.TOOL_VERSION_UV }}'
4547
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
48+
activate-environment: true
4649

4750
- name: Install development dependencies
4851
working-directory: ./template
49-
run: pip install -r requirements-dev.txt
52+
run: uv pip install -r requirements-dev.txt
5053

5154
- name: Resolve target environment
5255
env:

‎.github/workflows/build_test_template.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,16 @@ jobs:
4141
echo "Version: $VERSION"
4242
sed -i "s/e2b_charts/e2b_charts==${VERSION}/g" requirements.txt
4343
44-
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
44+
- name: Install uv
45+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
4546
with:
47+
version: '${{ env.TOOL_VERSION_UV }}'
4648
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
49+
activate-environment: true
4750

4851
- name: Install development dependencies
4952
working-directory: ./template
50-
run: pip install -r requirements-dev.txt
53+
run: uv pip install -r requirements-dev.txt
5154

5255
- name: Generate Template Name
5356
id: generate-template-id

‎.github/workflows/charts_tests.yml‎

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,18 @@ jobs:
2424
uppercase: 'true'
2525
prefix: 'tool_version_'
2626

27-
- name: Set up Python
28-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
2929
with:
30+
version: '${{ env.TOOL_VERSION_UV }}'
3031
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
31-
32-
- name: Install and configure Poetry
33-
uses: snok/install-poetry@a783c322200f0519c7926aa6faa857c4e23e9263 # v1.4.2
34-
with:
35-
version: '${{ env.TOOL_VERSION_POETRY }}'
36-
virtualenvs-create: true
37-
virtualenvs-in-project: true
38-
installer-parallel: true
32+
enable-cache: true
3933

4034
- name: Install dependencies
41-
run: poetry install
35+
run: uv sync --locked
4236

4337
- name: Test build
44-
run: poetry build
38+
run: uv build
4539

4640
- name: Run tests
47-
run: poetry run pytest --verbose -x
41+
run: uv run pytest --verbose -x

‎.github/workflows/lint.yml‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,18 @@ jobs:
4040
- name: Install dependencies
4141
run: pnpm install --frozen-lockfile
4242

43-
- name: Set up Python
44-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
43+
- name: Install uv
44+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
4545
with:
46+
version: '${{ env.TOOL_VERSION_UV }}'
4647
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
47-
48-
- name: Install and configure Poetry
49-
uses: snok/install-poetry@a783c322200f0519c7926aa6faa857c4e23e9263 # v1.4.2
50-
with:
51-
version: '${{ env.TOOL_VERSION_POETRY }}'
52-
virtualenvs-create: true
53-
virtualenvs-in-project: true
54-
installer-parallel: true
48+
enable-cache: true
5549

5650
- name: Install Python dependencies
5751
working-directory: chart_data_extractor
5852
run: |
59-
poetry install --with dev
60-
pip install ruff=="0.11.12"
53+
uv sync --locked
54+
uv tool install ruff==0.11.12
6155
6256
- name: Run linting
6357
run: |

‎.github/workflows/release.yml‎

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,12 @@ jobs:
126126
with:
127127
version: ${{ env.TOOL_VERSION_PNPM }}
128128

129-
- name: Set up Python
130-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
129+
- name: Install uv
130+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
131131
with:
132+
version: '${{ env.TOOL_VERSION_UV }}'
132133
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
133-
134-
- name: Install and configure Poetry
135-
uses: snok/install-poetry@a783c322200f0519c7926aa6faa857c4e23e9263 # v1.4.2
136-
with:
137-
version: '${{ env.TOOL_VERSION_POETRY }}'
138-
virtualenvs-create: true
139-
virtualenvs-in-project: true
140-
installer-parallel: true
134+
enable-cache: true
141135

142136
- name: Configure pnpm
143137
run: |
@@ -154,13 +148,12 @@ jobs:
154148

155149
- name: Release new versions
156150
run: |
157-
poetry build
158-
poetry config pypi-token.pypi ${PYPI_TOKEN}
159-
poetry publish --skip-existing
151+
uv build
152+
uv publish --check-url https://pypi.org/simple/
160153
working-directory: ./chart_data_extractor
161154
env:
162155
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163-
PYPI_TOKEN: ${{ secrets.CHARTS_PYPI_TOKEN }}
156+
UV_PUBLISH_TOKEN: ${{ secrets.CHARTS_PYPI_TOKEN }}
164157

165158
- name: Output new version
166159
id: output_version
@@ -207,13 +200,16 @@ jobs:
207200
208201
sed -i "s/e2b_charts/e2b_charts==${VERSION}/g" requirements.txt
209202
210-
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
203+
- name: Install uv
204+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
211205
with:
206+
version: '${{ env.TOOL_VERSION_UV }}'
212207
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
208+
activate-environment: true
213209

214210
- name: Install development dependencies
215211
working-directory: ./template
216-
run: pip install -r requirements-dev.txt
212+
run: uv pip install -r requirements-dev.txt
217213

218214
- name: Build and push to DockerHub
219215
working-directory: ./template
@@ -241,13 +237,16 @@ jobs:
241237
uppercase: 'true'
242238
prefix: 'tool_version_'
243239

244-
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
240+
- name: Install uv
241+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
245242
with:
243+
version: '${{ env.TOOL_VERSION_UV }}'
246244
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
245+
activate-environment: true
247246

248247
- name: Install development dependencies
249248
working-directory: ./template
250-
run: pip install -r requirements-dev.txt
249+
run: uv pip install -r requirements-dev.txt
251250

252251
- name: Build E2B template
253252
id: build-template
@@ -287,18 +286,12 @@ jobs:
287286
uppercase: 'true'
288287
prefix: 'tool_version_'
289288

290-
- name: Set up Python
291-
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
289+
- name: Install uv
290+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
292291
with:
292+
version: '${{ env.TOOL_VERSION_UV }}'
293293
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
294-
295-
- name: Install and configure Poetry
296-
uses: snok/install-poetry@a783c322200f0519c7926aa6faa857c4e23e9263 # v1.4.2
297-
with:
298-
version: '${{ env.TOOL_VERSION_POETRY }}'
299-
virtualenvs-create: true
300-
virtualenvs-in-project: true
301-
installer-parallel: true
294+
enable-cache: true
302295

303296
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
304297
with:

‎.tool-versions‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python 3.10
2-
poetry 2.1.1
2+
uv 0.10.0
33
# Keep in sync with `packageManager` in package.json — pnpm self-switches to
44
# that version at runtime.
55
pnpm 10.34.5

‎chart_data_extractor/package.json‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"private": true,
44
"version": "1.0.0",
55
"scripts": {
6-
"test": "poetry run pytest -n 4 --verbose -x",
7-
"example": "poetry run python3 example.py",
8-
"postVersion": "poetry version $(pnpm pkg get version --workspaces=false | tr -d \\\")",
9-
"pretest": "poetry install",
10-
"lint": "poetry run ruff check .",
11-
"format": "poetry run ruff format ."
6+
"test": "uv run pytest -n 4 --verbose -x",
7+
"example": "uv run python3 example.py",
8+
"postVersion": "uv version $(pnpm pkg get version --workspaces=false | tr -d \\\")",
9+
"pretest": "uv sync",
10+
"lint": "uv run ruff check .",
11+
"format": "uv run ruff format ."
1212
},
1313
"devDependencies": {
1414
"@typescript-eslint/eslint-plugin": "^7.11.0",

0 commit comments

Comments
 (0)