Skip to content
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

Migrate to uv from poetry #289

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
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
27 changes: 7 additions & 20 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
- name: Enable caching
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ env.python_version }}
enable-cache: true

- name: Set up poetry
uses: abatilo/actions-poetry@v4

- name: Cache
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-build-${{ env.python_version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.python_version }}-${{ hashFiles('**/poetry.lock') }}
${{ runner.os }}-build-${{ env.python_version }}-
${{ runner.os }}-

- run: poetry install
- run: |
uv python pin ${{ env.python_version }}
uv sync

- name: Build
# I use poetry just as a package manager, so this is not `poetry build`
run: poetry run poe build
run: uv build

- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
30 changes: 8 additions & 22 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,31 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
- name: Enable caching
uses: astral-sh/setup-uv@v5
with:
python-version: "${{ matrix.python }}"

- name: Set up poetry
uses: abatilo/actions-poetry@v4

- name: Cache
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-build-${{ matrix.python }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ matrix.python }}-${{ hashFiles('**/poetry.lock') }}
${{ runner.os }}-build-${{ matrix.python }}-
${{ runner.os }}-
enable-cache: true

- name: Install dependencies
run: poetry install
run: uv sync

- name: Lint
run: poetry run poe check
run: uv run poe check

- name: Check Python version
run: |
actual_version=$(poetry run python --version)
actual_version=$(uv run python --version)
expected_version="Python ${{ matrix.python }}"
if [ "$actual_version" == *"$expected_version"* ]; then
echo "Expected $expected_version, but got $actual_version"
exit 1
fi

- name: Test
run: poetry run poe test
run: uv run poe test

- name: Coverage
run: poetry run poe coverage-xml
run: uv run poe coverage-xml

- name: Upload coverage report to Codecov
if: matrix.python == '3.13'
Expand Down
12 changes: 5 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# -----------------------------------------------------------------------------
# gibo dump Linux
### Generated by gibo (https://github.com/simonwhitaker/gibo)
### https://raw.github.com/github/gitignore/33243d9491911332228307c915ff95707791a91f/Global/Linux.gitignore
### https://raw.github.com/github/gitignore/4488915eec0b3a45b5c63ead28f286819c0917de/Global/Linux.gitignore

*~

Expand All @@ -25,7 +25,7 @@
# -----------------------------------------------------------------------------
# gibo dump Windows
### Generated by gibo (https://github.com/simonwhitaker/gibo)
### https://raw.github.com/github/gitignore/33243d9491911332228307c915ff95707791a91f/Global/Windows.gitignore
### https://raw.github.com/github/gitignore/4488915eec0b3a45b5c63ead28f286819c0917de/Global/Windows.gitignore

# Windows thumbnail cache files
Thumbs.db
Expand Down Expand Up @@ -54,7 +54,7 @@ $RECYCLE.BIN/
# -----------------------------------------------------------------------------
# gibo dump macOS
### Generated by gibo (https://github.com/simonwhitaker/gibo)
### https://raw.github.com/github/gitignore/33243d9491911332228307c915ff95707791a91f/Global/macOS.gitignore
### https://raw.github.com/github/gitignore/4488915eec0b3a45b5c63ead28f286819c0917de/Global/macOS.gitignore

# General
.DS_Store
Expand Down Expand Up @@ -85,7 +85,7 @@ Temporary Items
# -----------------------------------------------------------------------------
# gibo dump Python
### Generated by gibo (https://github.com/simonwhitaker/gibo)
### https://raw.github.com/github/gitignore/33243d9491911332228307c915ff95707791a91f/Python.gitignore
### https://raw.github.com/github/gitignore/4488915eec0b3a45b5c63ead28f286819c0917de/Python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -195,10 +195,8 @@ ipython_config.py
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
Expand Down
Loading
Loading