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
48 changes: 14 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
- name: Install UV
uses: astral-sh/setup-uv@v1
with:
python-version: "3.12"
version: latest

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install dependencies
- name: Sync dependencies
run: make init

- name: Run Ruff
Expand All @@ -54,19 +47,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
- name: Install UV
uses: astral-sh/setup-uv@v1
with:
python-version: "3.12"
version: latest

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install dependencies
- name: Sync dependencies
run: make init

- name: Run Mypy
Expand All @@ -89,21 +75,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
id: py
uses: actions/setup-python@v5
- name: Install UV
uses: astral-sh/setup-uv@v1
with:
python-version: ${{ matrix.python-version }}
version: latest

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Set Python version
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies (with dev)
if: steps.cache.outputs.cache-hit != 'true'
- name: Sync dependencies
run: make init

- name: Run Pytest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ htmlcov/
../.coverage
.coveragerc
.coverage
coverage.xml
.cache
nosetests.xml
*.cover
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
31 changes: 16 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
SHELL := /bin/bash

init:
python3 -m venv .venv
poetry install --with dev
poetry run pre-commit install
poetry env info
@echo "Created virtual environment"
init: # ENV SETUP
uv sync --all-groups
uv run pre-commit install
@echo "Environment initialized with uv."

test:
poetry run pytest --cov=src/ --cov-report=term-missing --no-cov-on-fail --cov-report=xml --cov-fail-under=10
uv run pytest --cov=src --cov-report=term-missing --no-cov-on-fail --cov-report=xml --cov-fail-under=10
rm .coverage

lint:
poetry run ruff format
poetry run ruff check --fix
uv run ruff format
uv run ruff check --fix

typecheck:
poetry run mypy src/ tests/ --ignore-missing-imports
uv run mypy src/ tests/ --ignore-missing-imports

format:
make lint
Expand All @@ -28,18 +26,21 @@ clean:
rm -rf .pytest_cache
rm -rf build/
rm -rf dist/
rm -rf juninit-pytest.xml
rm -rf junit-pytest.xml
rm -rf logs/*
find . -name ".coverage*" -delete
find . -name __pycache__ -exec rm -r {} +
find . -name "__pycache__" -exec rm -r {} +

update:
poetry cache clear pypi --all
poetry update
uv update --all-groups

deep-update:
uv cache clear pypi --all
uv update --all-groups

docker:
docker build --no-cache -f Dockerfile -t change_me-smoke .
docker run --rm change_me-smoke

app:
poetry run python -m change_me
uv run python -m change_me
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ Do ***NOT*** clone this repository. Please use it as a template instead. This re
To install the library run:

```bash
pip install <your-package-name>
uv install <your-package-name>
```

OR

```bash
pip install git+https://github.com/TUM-Aries-Lab/<your-package-name>.git@<specific-tag>
uv install git+https://github.com/TUM-Aries-Lab/<your-package-name>.git@<specific-tag>
```

## Development
0. Install [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer)
0. Install [uv](https://docs.astral.sh/uv/getting-started/installation/)
1. Install [pyenv](https://github.com/pyenv/pyenv?tab=readme-ov-file#installation)
2. ```pyenv install <desired-python-version> # install the required python version```
3. ```pyenv global <desired-python-version> # set the required python version```
Expand All @@ -34,8 +34,8 @@ pip install git+https://github.com/TUM-Aries-Lab/<your-package-name>.git@<specif
It's super easy to publish your own packages on PyPI. To build and publish this package run:

```bash
poetry build
poetry publish # make sure your version in pyproject.toml is updated
uv build
uv publish # make sure your version in pyproject.toml is updated
```
The package can then be found at: https://pypi.org/project/change-me

Expand All @@ -45,7 +45,7 @@ The package can then be found at: https://pypi.org/project/change-me

from loguru import logger

from change_me import definitions
from change_me.config import definitions

def main() -> None:
"""Run a simple demonstration."""
Expand All @@ -57,5 +57,5 @@ if __name__ == "__main__":

## Program Usage
```bash
poetry run python -m change_me
uv run python -m change_me
```
93 changes: 0 additions & 93 deletions coverage.xml

This file was deleted.

Loading
Loading