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
6 changes: 3 additions & 3 deletions .github/actions/code-quality/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ runs:
- name: Run Ruff Formatting
if: inputs.check-type == 'format'
shell: bash
run: poetry run ruff format --config pyproject.toml ${{ inputs.source-dir }}
run: uv run ruff format --config pyproject.toml ${{ inputs.source-dir }}

- name: Run Ruff Linting
if: inputs.check-type == 'lint'
shell: bash
run: poetry run ruff check --config pyproject.toml ${{ inputs.source-dir }}
run: uv run ruff check --config pyproject.toml ${{ inputs.source-dir }}

- name: Run Mypy Type Checking
if: inputs.check-type == 'type-check'
shell: bash
run: poetry run mypy --config-file pyproject.toml ${{ inputs.source-dir }}
run: uv run mypy --config-file pyproject.toml ${{ inputs.source-dir }}
26 changes: 7 additions & 19 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,24 @@
name: "Setup Environment"
description: "Sets up Python, Poetry, and dependencies with caching"
description: "Sets up Python, uv, and dependencies with caching"

inputs:
python-version:
description: "Python version to use"
required: false
default: "3.14"
cache-key-suffix:
description: "Additional suffix for cache key"
required: false
default: ""

runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ inputs.python-version }}
enable-cache: true

- name: Install Poetry
- name: Set up Python
shell: bash
run: pip install poetry

- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.poetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}${{ inputs.cache-key-suffix }}
run: uv python install ${{ inputs.python-version }}

- name: Install dependencies
shell: bash
run: poetry install
run: uv sync
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
# Update dependencies for Python (Poetry)
- package-ecosystem: "pip"
# Update dependencies for Python (uv)
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "daily"
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ on:
python-version:
description: "Python version to use"
value: "3.14"
poetry-cache-path:
description: "Poetry cache paths"
value: |
~/.cache/pypoetry
~/.poetry
source-dir:
description: "Source directory to check"
value: "src/"
Expand All @@ -20,9 +15,6 @@ jobs:
runs-on: ubuntu-latest
outputs:
python-version: "3.14"
poetry-cache-path: |
~/.cache/pypoetry
~/.poetry
source-dir: "src/"
steps:
- run: echo "Shared configuration loaded"
- run: echo "Shared configuration loaded"
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
with:
python-version: ${{ needs.config.outputs.python-version }}
- name: Run Tests
run: poetry run pytest
run: uv run pytest

release:
needs: [ config, setup, format, lint, type-check, test ]
Expand All @@ -84,7 +84,7 @@ jobs:
- name: Read version from pyproject.toml
id: get_version
run: |
VERSION=$(poetry version --short)
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
echo "VERSION=${VERSION}" >> $GITHUB_ENV

- name: Check if release exists
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
run: |
chmod +x .github/generate_changelog.sh
source .github/generate_changelog.sh

echo "CHANGELOG<<EOF" >> $GITHUB_ENV
if [ -n "${{ env.PREV_TAG }}" ]; then
generate_categorized_changelog "${{ env.PREV_TAG }}" >> $GITHUB_ENV
Expand All @@ -135,10 +135,10 @@ jobs:
name: ${{ env.VERSION }}
body: |
${{ env.CHANGELOG }}

**Full Changelog**: ${{ env.URL }}
draft: false
prerelease: false
target_commitish: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,10 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# uv
# uv.lock should be committed to version control to ensure reproducible installs.
# https://docs.astral.sh/uv/concepts/projects/layout/#the-lockfile
#uv.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ repos:
hooks:
- id: ruff-format
name: Formatting
entry: poetry run ruff format
language: python
entry: uv run ruff format
language: system
types_or: [ python, pyi, jupyter ]
pass_filenames: true

- id: ruff-lint
name: Linting
entry: poetry run ruff check
language: python
entry: uv run ruff check
language: system
types_or: [ python, pyi, jupyter ]
pass_filenames: true
exclude: tests

- id: mypy-type-check
name: Type Checking
entry: poetry run mypy
language: python
entry: uv run mypy
language: system
types_or: [ python, pyi, jupyter ]
pass_filenames: true
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.14.2
3.14.3
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,17 @@ Follow these steps to get started with this template:

1. **Clone the repository or use the template directly via GitHub.**

2. **Install Poetry:**
2. **Install uv:**

Ensure you have [Poetry](https://python-poetry.org/) installed. If not, you can install it using:
Ensure you have [uv](https://docs.astral.sh/uv/) installed. If not, you can install it using:
```bash
pip install poetry
curl -LsSf https://astral.sh/uv/install.sh | sh
```
> **Note:** This template is set up using Poetry version 1.8.5.

3. **Install dependencies:**

```bash
poetry install
uv sync
```

4. **Ready to Implement:**
Expand All @@ -57,7 +56,7 @@ Follow these steps to get started with this template:
This project includes a continuous integration (CI) workflow that is triggered on every push and pull request, using
GitHub Actions to run the following jobs:

1. **Setup**: Checks out the code, sets up Python, and installs dependencies using Poetry.
1. **Setup**: Checks out the code, sets up Python, and installs dependencies using uv.
2. **Format**: Formats the code with Ruff.
3. **Lint**: Runs linting on the codebase with Ruff.
4. **Type Check**: Checks for type consistency using Mypy.
Expand All @@ -79,10 +78,10 @@ This project includes the following dependencies:
- `loguru`: ^0.7.3 (useful logging package)

- **Development Dependencies**:
- `ruff`: ^0.8.x (for code linting and formatting)
- `ruff`: ^0.14.x (for code linting and formatting)
- `mypy`: ^1.x.y (for type checking)
- `pre-commit`: ^4.x.y (for managing Git hooks)
- `pytest`: ^8.x.y (for unit testing)
- `pytest`: ^9.x.y (for unit testing)

### Optional: Pyenv

Expand Down Expand Up @@ -147,20 +146,20 @@ This repository employs several tools to ensure code quality:
To set up pre-commit hooks for automatic formatting and linting on commit, ensure `pre-commit` is installed:

```bash
poetry install
uv sync
```

Then, install the hooks:

```bash
poetry run pre-commit install
uv run pre-commit install
```

Once installed, the hooks will run automatically before each commit.

### Pre-commit Hooks Configuration

This repository uses pre-commit hooks to enforce code quality and standards before committing changes. Heres an
This repository uses pre-commit hooks to enforce code quality and standards before committing changes. Here's an
overview of the configured hooks:

#### 1. Commitlint Hook
Expand All @@ -179,13 +178,13 @@ overview of the configured hooks:
You can run specific hooks manually using:

```bash
poetry run pre-commit run <HOOK-ID>
uv run pre-commit run <HOOK-ID>
```

For example, to run the Ruff formatter:

```bash
poetry run pre-commit run ruff-format
uv run pre-commit run ruff-format
```

For more information on pre-commit, visit [pre-commit.com](https://pre-commit.com).
Expand Down
Loading