Skip to content

Commit 3be638e

Browse files
committed
Migrate old setup to use UV for package management
1 parent 96791e6 commit 3be638e

13 files changed

Lines changed: 1814 additions & 995 deletions

.devcontainer/devcontainer.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "SSHKey Tools Devcontainer",
33
"image": "mcr.microsoft.com/devcontainers/python:3-3",
44
"features": {
5-
"ghcr.io/devcontainers-contrib/features/coverage-py:2": {}
5+
"ghcr.io/devcontainers-contrib/features/coverage-py:2": {},
6+
"ghcr.io/devcontainer-community/devcontainer-features/astral.sh-uv:1": {}
67
},
78
"customizations": {
89
"vscode": {
@@ -12,6 +13,8 @@
1213
]
1314
}
1415
},
15-
"onCreateCommand": "curl https://pyenv.run | bash",
16-
"postStartCommand": "pyenv init"
17-
}
16+
"containerEnv": {
17+
"UV_LINK_MODE": "copy"
18+
},
19+
"postCreateCommand": "uv sync --extra dev"
20+
}

.github/workflows/deploy_testing.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,19 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v3
2525

26-
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v2
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v5
2828
with:
2929
python-version: ${{ matrix.python-version }}
3030

3131
- name: Install dependencies
32-
run: |
33-
python -m pip install --upgrade pip
34-
pip install -r requirements-test.txt
32+
run: uv sync --extra dev
3533

3634
- name: Run tests
3735
run: |
38-
coverage run -m unittest discover tests/
39-
coverage report --omit="tests/*.py"
40-
coverage html
36+
uv run coverage run -m unittest discover tests/
37+
uv run coverage report --omit="tests/*.py"
38+
uv run coverage html
4139
4240
- name: Upload report
4341
uses: actions/upload-artifact@v4

.github/workflows/dev_testing.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,19 @@ jobs:
2424
steps:
2525
- uses: actions/checkout@v3
2626

27-
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v2
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v5
2929
with:
3030
python-version: ${{ matrix.python-version }}
3131

3232
- name: Install dependencies
33-
run: |
34-
python -m pip install --upgrade pip
35-
pip install -r requirements-test.txt
33+
run: uv sync --extra dev
3634

3735
- name: Run tests
3836
run: |
39-
coverage run -m unittest discover tests/
40-
coverage report --omit="tests/*.py"
41-
coverage html
37+
uv run coverage run -m unittest discover tests/
38+
uv run coverage report --omit="tests/*.py"
39+
uv run coverage html
4240
4341
- name: Upload report
4442
uses: actions/upload-artifact@v4

.github/workflows/linting.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,13 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v3
1919

20-
- name: Set up Python
21-
uses: actions/setup-python@v2
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
2222
with:
2323
python-version: "3.11"
2424

2525
- name: Install dependencies
26-
run: |
27-
python -m pip install --upgrade pip
28-
pip install -r requirements-test.txt
26+
run: uv sync --extra dev
2927

3028
- name: Run tests
31-
run: |
32-
python3 -m pylint src/sshkey_tools
29+
run: uv run pylint src/sshkey_tools

.github/workflows/publish.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,29 @@ on:
66
jobs:
77
deploy:
88
runs-on: ubuntu-latest
9+
permissions:
10+
id-token: write
911

1012
steps:
1113
- uses: actions/checkout@v2
1214

13-
- name: Set up Python
14-
uses: actions/setup-python@v2
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v5
1517
with:
1618
python-version: '3.11'
1719

1820
- name: Install dependencies
19-
run: |
20-
python -m pip install --upgrade pip
21-
pip install -r requirements.txt
22-
pip install setuptools wheel twine pdoc3
21+
run: uv tool install pdoc3
2322

2423
- name: Build and publish
2524
env:
26-
RELEASE_NAME: ${{ github.event.release.tag_name }}
27-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
25+
RELEASE_NAME: ${{ github.event.release.tag_name }}
2926
run: |
30-
python setup.py sdist bdist_wheel
31-
twine upload dist/*
27+
uv build
28+
uv publish
3229
3330
- name: Rebuild documentation
3431
run: |
35-
pip3 install pdoc3
36-
pdoc --html src/sshkey_tools/ --force --output-dir docs
32+
uvx pdoc --html src/sshkey_tools/ --force --output-dir docs
3733
mv docs/sshkey_tools/* docs/
3834
rm -r docs/sshkey_tools

.gitpod.yml

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

Pipfile

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

0 commit comments

Comments
 (0)