Skip to content
Open
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
78 changes: 23 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
# This way, we can make sure code doesn't break via external dependencies
push:
pull_request:
env:
POETRY_VERSION: 1.6.0
jobs:
test:
strategy:
Expand All @@ -27,74 +25,44 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
path: |
.venv
.pytest_cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install Poetry and Poe (UNIX)
if: runner.os != 'Windows'
run: python3 -m pip install poetry==$POETRY_VERSION poethepoet
- name: Install Poetry and Poe (Windows)
if: runner.os == 'Windows'
run: python -m pip install poetry==$env:POETRY_VERSION poethepoet

enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
run: echo "${{ matrix.python-version }}" > .python-version
- name: Install dependencies
run: |
poetry config virtualenvs.in-project true
poetry install
poetry install # Second time to install the project
run: uv sync
- name: Run test suite
run: poe ci
run: uv run pytest -vvv --cov=idae --cov-report=xml
- name: Upload to CodeCov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: 3
- name: Install Poetry $POETRY_VERSION
run: python3 -m pip install --upgrade pip poetry==$POETRY_VERSION
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Build project
run: poetry build
run: uv build
lints:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3
- uses: actions/cache@v3
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
path: .venv
key: ${{ runner.os }}-pip-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-pip-

enable-cache: true
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip poetry==$POETRY_VERSION poethepoet
poetry config virtualenvs.in-project true
poetry install
poetry install # Second time to install the project

run: uv sync
- name: Run style lints
run: poe style
run: |
uv run black idae --check
uv run ruff check idae --select I
- name: Run ruff lints
run: poe ruff
run: uv run ruff check idae
- name: Run mypy lints
run: poe mypy
run: uv run mypy idae --strict
13 changes: 5 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Build artifacts
run: poetry build
run: uv build
- name: Upload artifacts to release
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/*
- name: Store the distribution packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand All @@ -34,7 +31,7 @@ jobs:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand Down
23 changes: 7 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,16 @@ There are many ways you can contribute :smile:

Remember to follow the [code of conduct](./CODE_OF_CONDUCT.md)

We use [Poetry](https://python-poetry.org) to manage the project so [make sure you have it](https://python-poetry.org/docs/#installation). Once you do, set up the virtual environment after you cloned repo
We use [uv](https://docs.astral.sh/uv) to manage the project so [make sure you have it](https://docs.astral.sh/uv/getting-started/installation/). Once you do, set up the virtual environment after you cloned repo

```
$ poetry install
$ uv sync
```

You can test locally with

```
$ poe test
```

Or (if you don't have [Poe the poet](https://github.com/nat-n/poethepoet))

```
$ poetry run pytest
$ uv run pytest
```

<h2 id="pr">Pull Request contributing guide</h2>
Expand Down Expand Up @@ -101,18 +95,15 @@ We use the linters Black, Pylint, and MyPy. We use the formatters Black and Isor
You can easily fix your code's style with

```
$ poe format
```

or
```
$ shed {{ cookiecutter.module_name }}/**.py
$ uv run shed
```

You can run the linters via

```
$ poe lint
$ uv run black idae --check
$ uv run ruff check idae
$ uv run mypy idae --strict
```

Try to follow [my recommended code style](https://github.com/ThatXliner/Significant-files/blob/main/PYTHON_STYLE.md) or [Google's Style Guide](https://google.github.io/styleguide/pyguide.html)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Idae

[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
Expand Down
Loading