Skip to content

Commit 213f4ab

Browse files
jens-kuertenJens Kürten
andauthored
chore: Switch to uv (#38)
* switch from poetry to uv * update actions to uv * docs: Add contributing guidelines for the project --------- Co-authored-by: Jens Kürten <jens.kuerten@contact-software.com>
1 parent a5f07ab commit 213f4ab

File tree

19 files changed

+1300
-1238
lines changed

19 files changed

+1300
-1238
lines changed

.github/workflows/Push.yaml

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v3
18-
- uses: actions/setup-python@v4
19-
- uses: pre-commit/action@v3.0.0
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-python@v4
19+
- uses: pre-commit/action@v3.0.0
2020

2121
unittest:
2222
runs-on: ubuntu-latest
@@ -26,29 +26,17 @@ jobs:
2626
python-version: ["3.10", "3.11"]
2727

2828
steps:
29-
- uses: actions/checkout@v3
30-
- name: Set up Python ${{ matrix.python-version }}
31-
uses: actions/setup-python@v3
32-
with:
33-
python-version: ${{ matrix.python-version }}
34-
- name: Install poetry
35-
run: |
36-
pip install --upgrade pip
37-
pip install poetry
38-
- name: Setup a local virtual environment (if no poetry.toml file)
39-
run: |
40-
poetry config virtualenvs.create true --local
41-
poetry config virtualenvs.in-project true --local
42-
- name: Define a cache for the virtual environment based on the dependencies lock file
43-
uses: actions/cache@v3
44-
with:
45-
path: ./.venv
46-
key: venv-${{ hashFiles('poetry.lock') }}
47-
- name: Set up Python environment
48-
run: |
49-
poetry install --with test
50-
- name: Run Tests
51-
run: poetry run pytest --junit-xml=testresults/test-client.xml
29+
- uses: actions/checkout@v3
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v3
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v3
36+
- name: Set up Python environment
37+
run: uv sync --group test
38+
- name: Run Tests
39+
run: uv run pytest --junit-xml=testresults/test-client.xml
5240

5341
test-build:
5442
# run a build, to make sure the build doesn't fail
@@ -62,11 +50,8 @@ jobs:
6250
with:
6351
python-version: 3.11
6452

65-
- name: Install dependencies
66-
run: |
67-
python -m pip install --upgrade pip
68-
pip install poetry
53+
- name: Install uv
54+
uses: astral-sh/setup-uv@v3
6955

7056
- name: Build Package
71-
run: |
72-
poetry build
57+
run: uv build

.github/workflows/Tag.yaml

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-python@v4
16-
- uses: pre-commit/action@v3.0.0
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-python@v4
16+
- uses: pre-commit/action@v3.0.0
1717

1818
unittest:
1919
runs-on: ubuntu-latest
@@ -23,29 +23,17 @@ jobs:
2323
python-version: ["3.10", "3.11"]
2424

2525
steps:
26-
- uses: actions/checkout@v3
27-
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v3
29-
with:
30-
python-version: ${{ matrix.python-version }}
31-
- name: Install poetry
32-
run: |
33-
pip install --upgrade pip
34-
pip install poetry
35-
- name: Setup a local virtual environment (if no poetry.toml file)
36-
run: |
37-
poetry config virtualenvs.create true --local
38-
poetry config virtualenvs.in-project true --local
39-
- name: Define a cache for the virtual environment based on the dependencies lock file
40-
uses: actions/cache@v3
41-
with:
42-
path: ./.venv
43-
key: venv-${{ hashFiles('poetry.lock') }}
44-
- name: Set up Python environment
45-
run: |
46-
poetry install --with test
47-
- name: Run Tests
48-
run: poetry run pytest --junit-xml=testresults/test-client.xml
26+
- uses: actions/checkout@v3
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v3
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v3
33+
- name: Set up Python environment
34+
run: uv sync --group test
35+
- name: Run Tests
36+
run: uv run pytest --junit-xml=testresults/test-client.xml
4937

5038
# ---- Publish ----
5139
build-and-publish:
@@ -61,17 +49,18 @@ jobs:
6149
with:
6250
python-version: 3.11
6351

64-
- name: Install dependencies
65-
run: |
66-
python -m pip install --upgrade pip
67-
pip install poetry
52+
- name: Install uv
53+
uses: astral-sh/setup-uv@v3
6854

69-
- name: Build Package
55+
- name: Set version and build
7056
run: |
71-
poetry config pypi-token.pypi ${{secrets.PYPI_LIB_TOKEN}}
72-
poetry version ${{ github.ref_name }}
73-
poetry build
74-
poetry publish
57+
uv version ${{ github.ref_name }}
58+
uv build
59+
60+
- name: Publish to PyPI
61+
env:
62+
UV_PUBLISH_TOKEN: ${{secrets.PYPI_LIB_TOKEN}}
63+
run: uv publish
7564

7665
publish-docs:
7766
runs-on: ubuntu-latest
@@ -85,10 +74,10 @@ jobs:
8574
- uses: actions/setup-python@v5
8675
with:
8776
python-version: 3.x
88-
- name: Install Poetry
89-
run: pip install poetry
77+
- name: Install uv
78+
uses: astral-sh/setup-uv@v3
9079
- name: Install dependencies for docs
91-
run: poetry install --with dev
80+
run: uv sync --group dev
9281
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
9382
- uses: actions/cache@v4
9483
with:
@@ -97,4 +86,4 @@ jobs:
9786
restore-keys: |
9887
mkdocs-material-
9988
- name: Deploy docs
100-
run: poetry run mkdocs gh-deploy --force
89+
run: uv run mkdocs gh-deploy --force

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ dist/
1010
.pytest_cache
1111
site/
1212
.ruff_cache
13+
*.egg-info/

0 commit comments

Comments
 (0)