Skip to content

Commit

Permalink
feat: replace poetry with uv [#53]
Browse files Browse the repository at this point in the history
  • Loading branch information
nickatnight committed Dec 4, 2024
1 parent fee79f7 commit 042da9d
Show file tree
Hide file tree
Showing 6 changed files with 719 additions and 840 deletions.
42 changes: 17 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,20 @@ jobs:
- name: Checkout 🛎
uses: actions/checkout@v3

- name: Install poetry 📚
run: pipx install poetry

- name: Set up Python 3.9 🐍
uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
# Install a specific version of uv.
version: "0.4.26"

- name: Set Poetry environment
if: matrix.os == 'ubuntu-latest'
run: poetry env use ${{ env.PYTHON_VERSION }}
- name: Set up Python
run: uv python install ${{ env.PYTHON_VERSION }}

- name: Install dependencies 🤖
run: poetry install --no-root
run: uv sync

- name: Run tests 📉
run: poetry run pytest tests
run: uv run pytest tests

docker:
strategy:
Expand All @@ -57,23 +53,19 @@ jobs:
COMPOSE_DOCKER_CLI_BUILD: 1
steps:
- name: Checkout 🛎
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install poetry 📚
run: pipx install poetry

- name: Set up Python ${{ env.PYTHON_VERSION }} 🐍
uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
# Install a specific version of uv.
version: "0.4.26"

- name: Set Poetry environment
if: matrix.os == 'ubuntu-latest'
run: poetry env use ${{ env.PYTHON_VERSION }}
- name: Set up Python
run: uv python install ${{ env.PYTHON_VERSION }}

- name: Install dependencies 🤖
run: poetry install --no-root
- name: Install the project
run: uv sync

- name: Docker ${{ matrix.script.name }}
run: sh tests/test_docker_build.sh ${{ matrix.script.args }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ The input variables, with their default values (some auto generated) are:
After using this generator, your new project (the directory created) will contain an extensive `README.md` with instructions for development, deployment, etc. You can view it [here](/%7B%7B%20cookiecutter.project_slug%20%7D%7D/README.md)

## Development
This project uses [Poetry](https://python-poetry.org/docs/#osx--linux--bashonwindows-install-instructions) to manage dev environment. Once installed:
1. install packages with `poetry install`
2. run tests with `poetry run pytest tests`
This project uses [uv](https://docs.astral.sh/uv/getting-started/installation/) to manage dev environment. Once installed:
1. install packages with `uv sync`
2. run tests with `uv run pytest tests`

Pre-commit:
1. Install pre-commit hooks with `pre-commit install`
Expand Down
Loading

0 comments on commit 042da9d

Please sign in to comment.