Skip to content

Commit

Permalink
chore: replace poetry with uv
Browse files Browse the repository at this point in the history
  • Loading branch information
b-fein committed Dec 27, 2024
1 parent 15bcd17 commit d790ee5
Show file tree
Hide file tree
Showing 17 changed files with 936 additions and 706 deletions.
14 changes: 14 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-FileCopyrightText: 2024 Benedikt Fein
#
# SPDX-License-Identifier: EUPL-1.2

if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi

watch_file flake.nix
watch_file flake.lock
if ! use flake . --no-pure-eval
then
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
fi
28 changes: 11 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,37 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
poetry-version: ["latest"]
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Setup Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}

- name: Setup Poetry
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}

- name: Install dependencies
run: poetry install
- name: Install the project
run: uv sync --all-extras --dev

- name: Check imports with isort
run: poetry run isort --check-only . --profile black
run: uv run isort --check-only . --profile black

- name: Check formatting
run: poetry run ruff format --diff --check .
run: uv run ruff format --diff --check .

- name: Check typing with mypy
run: poetry run mypy spring_yaml_to_env tests
run: uv run mypy src tests

- name: Linting with ruff
run: poetry run ruff check .
run: uv run ruff check .

- name: Check docstrings with darglint
run: poetry run darglint2 -s sphinx -v 2 spring_yaml_to_env/*.py
run: uv run darglint2 -s sphinx -v 2 src/**/*.py

- name: Run tests
run: poetry run pytest --cov=spring_yaml_to_env --cov=tests --cov-branch --cov-report=term-missing tests/
run: uv run pytest --cov=src --cov=tests --cov-branch --cov-report=term-missing tests/

- name: Check reuse
run: poetry run reuse lint
run: uv run reuse lint
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: CC0-1.0

.devenv/
.direnv/
.idea/
cov_html/
report.xml
Expand Down
10 changes: 0 additions & 10 deletions .reuse/dep5

This file was deleted.

16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
#
# SPDX-License-Identifier: EUPL-1.2

PROJECT=spring_yaml_to_env
PROJECT=src

.PHONY: test
test:
poetry run pytest --cov=$(PROJECT) --cov=tests --cov-branch --junitxml=report.xml --cov-report=term-missing --cov-report html:cov_html tests/
uv run pytest --cov=$(PROJECT) --cov=tests --cov-branch --junitxml=report.xml --cov-report=term-missing --cov-report html:cov_html tests/

.PHONY: format
format:
poetry run isort .
poetry run ruff format .
uv run isort $(PROJECT) tests
uv run ruff format $(PROJECT) tests

.PHONY: mypy
mypy:
poetry run mypy $(PROJECT) tests
uv run mypy $(PROJECT) tests

.PHONY: ruff
ruff:
poetry run ruff check $(PROJECT) tests
uv run ruff check $(PROJECT) tests

.PHONY: darglint
darglint:
poetry run darglint2 -s sphinx -v 2 $(PROJECT)/*.py
uv run darglint2 -s sphinx -v 2 $(PROJECT)/**/*.py

.PHONY: reuse
reuse:
poetry run reuse lint
uv run reuse lint

.PHONY: check
check: format mypy ruff darglint reuse
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Initially created for the {artemis}[Artemis] interactive learning system.

== Usage

Python 3.8 or newer is required.
Python 3.11 or newer is required.

`python ./spring_yaml_to_env/spring_yaml_to_env.py --help`
`python ./src/spring_yaml_to_env/spring_yaml_to_env.py --help`

[source]
----
Expand Down
5 changes: 5 additions & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version = 1
SPDX-PackageName = "spring-yaml-to-env"
SPDX-PackageSupplier = "Benedikt Fein <[email protected]>"
SPDX-PackageDownloadLocation = "https://github.com/b-fein/spring-yaml-to-env"
annotations = []
Loading

0 comments on commit d790ee5

Please sign in to comment.