Skip to content

Commit 368a1ab

Browse files
committed
refactor: replace poetry with uv
1 parent 28d5c87 commit 368a1ab

File tree

10 files changed

+971
-945
lines changed

10 files changed

+971
-945
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,76 @@ name: CI
22

33
on:
44
pull_request:
5-
branches: [main]
5+
branches: [ main ]
66
push:
7-
branches: [main]
7+
branches: [ main ]
88

99
jobs:
1010
build:
1111
name: Build
1212
runs-on: ubuntu-24.04
13+
env:
14+
PYTHON_VERSION: 3.9
15+
UV_VERSION: 0.7.9
1316

1417
steps:
1518
- name: Checkout repository
1619
uses: actions/checkout@v4
1720

18-
- name: Setup Python
19-
uses: actions/setup-python@v5
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v5
2023
with:
21-
python-version: "3.11"
24+
enable-cache: true
25+
version: ${{ env.UV_VERSION }}
2226

23-
- name: Install Poetry
24-
uses: snok/install-poetry@v1
27+
- name: "Set up Python"
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ env.PYTHON_VERSION }}
2531

2632
- name: Install dependencies
27-
run: poetry install
33+
run: uv sync --locked --all-extras --dev
2834

2935
- name: Lint
30-
run: poetry run black --check .
36+
run: uv run black --check .
3137

3238
- name: Build
33-
run: poetry build
39+
run: uv build
3440

35-
# the `coverage xml -i` command is needed to re-write the
36-
# coverage report with relative paths
3741
- name: Test
38-
run: |
39-
poetry run pytest --cov src --cov-report xml tests
40-
poetry run coverage xml -i
42+
run: uv run pytest
4143

4244
test:
4345
name: Test
4446
runs-on: ubuntu-24.04
4547
strategy:
4648
fail-fast: false
4749
matrix:
48-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
49-
poetry-version: ["1.8.2"]
50+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
51+
env:
52+
UV_PYTHON: ${{ matrix.python-version }}
5053

5154
steps:
5255
- name: Checkout repository
5356
uses: actions/checkout@v4
5457

58+
- name: Install uv
59+
uses: astral-sh/setup-uv@v5
60+
with:
61+
enable-cache: true
62+
version: ${{ env.UV_VERSION }}
63+
5564
- name: Setup python
5665
uses: actions/setup-python@v5
5766
with:
5867
python-version: "${{ matrix.python-version }}"
5968

60-
- name: Install Poetry
61-
uses: snok/install-poetry@v1
62-
with:
63-
version: "${{ matrix.poetry-version }}"
6469

6570
- name: Install dependencies
66-
run: poetry install
71+
run: uv sync --locked --all-extras --dev
6772

6873
- name: Build
69-
run: poetry build
74+
run: uv build
7075

7176
- name: Test
72-
run: poetry run tox
77+
run: uv run pytest

.github/workflows/publish.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ name: Publish
22

33
on:
44
release:
5-
types: [published]
5+
types: [ published ]
66

77
jobs:
88
deploy:
99
name: Deploy to package index
1010
runs-on: ubuntu-24.04
1111
env:
1212
PYTHON_VERSION: 3.9
13-
REPOSITORY_USERNAME: ${{ secrets.PYPI_USERNAME }}
14-
REPOSITORY_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
13+
UV_VERSION: 0.7.9
14+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_PASSWORD }}
1515
REPOSITORY_URL: ${{ secrets.PYPI_PUBLISH_URL }}
1616
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
1717
CONDA_ENV_NAME: conda-env
@@ -20,6 +20,11 @@ jobs:
2020
- name: Checkout repository
2121
uses: actions/checkout@v4
2222

23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v5
25+
with:
26+
version: ${{ env.UV_VERSION }}
27+
2328
- name: Setup Python
2429
uses: actions/setup-python@v5
2530
with:
@@ -32,21 +37,13 @@ jobs:
3237
activate-environment: ${{ env.CONDA_ENV_NAME }}
3338
python-version: ${{ env.PYTHON_VERSION }}
3439

35-
- name: Install Poetry
36-
uses: snok/install-poetry@v1
37-
38-
- name: Configure Poetry
39-
run: |
40-
poetry config repositories.publish $REPOSITORY_URL
41-
poetry config http-basic.publish $REPOSITORY_USERNAME $REPOSITORY_PASSWORD
42-
4340
- name: Build
4441
run: |
45-
poetry build
42+
uv build
4643
4744
- name: Publish
4845
run: |
49-
poetry publish -r publish
46+
uv publish
5047
5148
- name: Publish to Anaconda
5249
shell: bash -el {0}
@@ -64,7 +61,7 @@ jobs:
6461
while [ $count -lt $max_retries ]; do
6562
# Create meta.yaml recipe for the package pulled from PyPi
6663
grayskull pypi fds.sdk.utils==${version}
67-
64+
6865
if [ -f ./fds.sdk.utils/meta.yaml ]; then
6966
echo "Version ${version} of fds.sdk.utils is available on PyPI."
7067
@@ -85,7 +82,7 @@ jobs:
8582
conda config --set anaconda_upload no
8683
package_file=$(conda build fds.sdk.utils --output)
8784
conda build -c conda-forge fds.sdk.utils
88-
85+
8986
anaconda -t $ANACONDA_TOKEN upload -u factset -l main ${package_file}
9087
break
9188
else

0 commit comments

Comments
 (0)