Skip to content

Add UV support for faster development workflows #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions .github/workflows/python-publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow will upload a Python Package using Twine when a release is created
# This workflow will upload a Python Package using uv
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
@@ -10,30 +10,29 @@ name: Upload Python Package To Actual PyPI

on:
workflow_dispatch:

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Add uv to PATH
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Build package
run: uv build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
38 changes: 18 additions & 20 deletions .github/workflows/python-publish-testpypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow will upload a Python Package using Twine when a release is created
# This workflow will upload a Python Package using uv
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
@@ -10,30 +10,28 @@ name: Upload Python Package To Test PyPI

on:
workflow_dispatch:

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Build package
run: uv build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
20 changes: 12 additions & 8 deletions .github/workflows/test-dev.yml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ jobs:
# python-version: 3.11
- os: ubuntu-latest
python-version: 3.12

runs-on: ${{ matrix.os }}

steps:
@@ -35,19 +35,23 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install dependencies
run: pip install -r tests/requirements.txt
run: |
uv venv .venv
source .venv/bin/activate
uv pip sync tests/uv.lock
uv pip install coverage

- name: Run unit tests and generate coverage report
run: |
pip install coverage
coverage run -m unittest discover -s tests -p 'test_*.py'
coverage report -m
source .venv/bin/activate
uv run coverage run -m unittest discover -s tests -p 'test_*.py'
uv run coverage report -m

- name: Upload coverage report to codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}



25 changes: 13 additions & 12 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
@@ -6,10 +6,8 @@ on:
branches:
- release


jobs:
test:

strategy:
matrix:
include:
@@ -22,7 +20,7 @@ jobs:
# python-version: 3.11
- os: ubuntu-latest
python-version: 3.12

runs-on: ${{ matrix.os }}

steps:
@@ -34,15 +32,18 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install dependencies
run: |
pip install -r tests/requirements.txt
pip install jsonschema
pip install -i https://test.pypi.org/simple/ hololinked

run: |
uv venv .venv
source .venv/bin/activate
uv pip sync tests/uv.lock
uv pip install jsonschema
uv pip install --index-url https://test.pypi.org/simple/ hololinked

- name: Run unit tests to verify if the release to TestPyPI is working
run: |
python -m unittest discover -s tests -p 'test_*.py'



source .venv/bin/activate
uv run python -m unittest discover -s tests -p 'test_*.py'
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -172,4 +172,8 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
#.idea/

# UV related files
.uv/
venv/
Loading