Skip to content
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
15 changes: 3 additions & 12 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,18 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
# TODO: Remove explicit Python version once bug with .python-version file is solved
# https://github.com/actions/setup-python/issues/734
python-version: '3.12'
cache: 'poetry'
- uses: astral-sh/setup-uv@v7
- name: Install package
run: |
poetry install
make install
- name: Run tests
env:
NO_COLORS: true # Disable colors in ruff output
run: |
echo "::add-matcher::.github/matchers/mypy.json"
echo "::add-matcher::.github/matchers/ruff.json"
echo "::add-matcher::.github/matchers/unbehead.json"
poetry run -- make lint --keep-going
uv run -- make lint --keep-going
echo "::remove-matcher owner=unbehead::"
echo "::remove-matcher owner=ruff::"
echo "::remove-matcher owner=mypy::"
6 changes: 2 additions & 4 deletions .github/workflows/releasing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: |
pipx install poetry
- uses: astral-sh/setup-uv@v1
- name: Build package
run: |
poetry build
uv build
- name: Extract changelog
run: |
.github/bin/extract-changelog.py ${{ github.ref_name }} /tmp/changelog.md
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,14 @@ jobs:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
env:
UV_PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- uses: astral-sh/setup-uv@v7
- name: Install package
run: |
poetry install
make install
- name: Run tests
run: |
poetry run -- make test
uv run -- make test
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## v1.5.0 (unreleased)

- *Nothing for now.*
- Switched project packaging and workflows from Poetry to uv.

## v1.4.0

Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# -- dependencies --------------------------------------------------------------

.PHONY: install
install:
uv sync --locked

# -- linting -------------------------------------------------------------------

.PHONY: mypy
Expand Down
28 changes: 11 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ In order to develop Unbeheader, you will need to install the project and its dep

- [`git`](https://git-scm.com/) (available in most systems)
- [`make`](https://www.gnu.org/software/make/) (available in most systems)
- [`poetry`](https://python-poetry.org/) ([installation guide](https://python-poetry.org/docs/#installation))
- [`pyenv`](https://github.com/pyenv/pyenv) ([installation guide](https://github.com/pyenv/pyenv#installation))
- [`uv`](https://docs.astral.sh/uv/) ([installation guide](https://docs.astral.sh/uv/getting-started/installation/))

First, clone [the repository](https://github.com/unconventionaldotdev/unbeheader) locally with:

Expand All @@ -131,29 +130,24 @@ git clone https://github.com/unconventionaldotdev/unbeheader
cd unbeheader
```

Before creating the virtualenv, you probably want to be using the same version of Python that the development of the project is targeting. This is the first version specified in the `.python-version` file and you can install it with `pyenv`:
Make sure to have the right versions of `python`:

```sh
pyenv install
uv python install # reads from .python-version
```

You may now create the virtualenv and install the project with its dependencies in it with `poetry`:
Install the project with its dependencies:

```sh
poetry install
uv sync --extra dev
```

Once installed, you can invoke the `unbehead` command with:
The `dev` extra contains the tooling needed for linting, typing, and tests; omit `--extra dev` if you only need the runtime CLI.

```sh
poetry run -- unbehead
```

For convenience, you may want to spawn a shell within the virtualenv with:
Once installed, you can invoke the `unbehead` command with:

```sh
poetry shell
unbehead
uv run unbehead
```

### Contributing
Expand All @@ -163,17 +157,17 @@ This project uses GitHub Actions to run the tests and linter on every pull reque
Linter checks can be run with:

```sh
poetry run -- make lint
uv run make lint
```

Tests can be run with:

```sh
poetry run -- make test
uv run make test
```

Tests can be run against all supported Python versions with:

```sh
tox
uv run tox
```
Loading