Skip to content

Commit 1880b16

Browse files
committed
refactor: replace poetry with uv
1 parent 6b6a8f2 commit 1880b16

8 files changed

Lines changed: 979 additions & 988 deletions

File tree

.github/workflows/ci.yml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,63 +10,67 @@ jobs:
1010
build:
1111
name: Build
1212
runs-on: ubuntu-24.04
13+
env:
14+
PYTHON_VERSION: 3.9
15+
UV_VERSION: 0.9.25
1316

1417
steps:
1518
- name: Checkout repository
16-
uses: actions/checkout@v6
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1720

18-
- name: Setup Python
19-
uses: actions/setup-python@v6
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
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@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
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
53-
uses: actions/checkout@v6
56+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5457

55-
- name: Setup python
56-
uses: actions/setup-python@v6
58+
- name: Install uv
59+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
5760
with:
58-
python-version: "${{ matrix.python-version }}"
61+
enable-cache: true
62+
version: ${{ env.UV_VERSION }}
5963

60-
- name: Install Poetry
61-
uses: snok/install-poetry@v1
64+
- name: Setup python
65+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
6266
with:
63-
version: "${{ matrix.poetry-version }}"
67+
python-version: "${{ matrix.python-version }}"
6468

6569
- name: Install dependencies
66-
run: poetry install
70+
run: uv sync --locked --all-extras --dev
6771

6872
- name: Build
69-
run: poetry build
73+
run: uv build
7074

7175
- name: Test
72-
run: poetry run tox
76+
run: uv run pytest

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525

2626
steps:
2727
- name: Checkout repository
28-
uses: actions/checkout@v6
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2929

3030
# Initializes the CodeQL tools for scanning.
3131
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@v4
32+
uses: github/codeql-action/init@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
3333
with:
3434
languages: ${{ matrix.language }}
3535

3636
- name: Autobuild
37-
uses: github/codeql-action/autobuild@v4
37+
uses: github/codeql-action/autobuild@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10
3838

3939
- name: Perform CodeQL Analysis
40-
uses: github/codeql-action/analyze@v4
40+
uses: github/codeql-action/analyze@cdefb33c0f6224e58673d9004f47f7cb3e328b89 # v4.31.10

.github/workflows/fortify.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,48 @@ 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.9.25
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
1818

1919
steps:
2020
- name: Checkout repository
21-
uses: actions/checkout@v6
21+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
25+
with:
26+
version: ${{ env.UV_VERSION }}
2227

2328
- name: Setup Python
24-
uses: actions/setup-python@v6
29+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
2530
with:
2631
python-version: ${{ env.PYTHON_VERSION }}
2732

2833
- name: Setup Conda
29-
uses: conda-incubator/setup-miniconda@v3
34+
uses: conda-incubator/setup-miniconda@835234971496cad1653abb28a638a281cf32541f # v3.2.0
3035
with:
3136
miniconda-version: "latest"
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)