Skip to content

Commit

Permalink
feat: migrate from poetry to uv (#397)
Browse files Browse the repository at this point in the history
* feat: migrate from poetry to uv
---------

Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
  • Loading branch information
M0NsTeRRR authored Oct 18, 2024
1 parent f495623 commit df22968
Show file tree
Hide file tree
Showing 36 changed files with 2,917 additions and 3,132 deletions.
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Python release
on:
push:
tags:
- '*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
permissions:
# this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install the project
run: uv sync --all-extras
- name: Publish package
run: |
sed -i -e "s/0.0.0/${GITHUB_REF#refs/*/}/" pyproject.toml
uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
25 changes: 0 additions & 25 deletions .github/workflows/releases.yml

This file was deleted.

33 changes: 10 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,16 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4

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

- name: Install poetry
run: pipx install poetry

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- name: Install poetry dependencies
run: |
export PATH="$PATH:$HOME/.local/bin"
poetry install --with=dev
- name: Run ruff
run: |
export PATH="$PATH:$HOME/.local/bin"
source `poetry env info --path`/bin/activate
poetry run ruff format --check .
poetry run ruff check .
run: uv python install ${{ matrix.python-version }}
- name: Install the project
run: uv sync --all-extras
- name: Run ruff format
run: uv run ruff format --check .
- name: Run ruff check
run: uv run ruff check .
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10
3.12
25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
[![Python test](https://github.com/lyon-esport/LouisDeLaTech/actions/workflows/test.yml/badge.svg)](https://github.com/lyon-esport/LouisDeLaTech/actions/workflows/test.yml)
[![Code Style](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://github.com/astral-sh/ruff)

## Requirements
# Setup

- Python with Poetry

## Setup

### Discord
## Discord

Create a [discord bot](https://discord.com/developers/applications) and get the token

### Google
## Google

- Create a [google project](https://console.cloud.google.com/iam-admin)
- Create a [google service account](https://console.cloud.google.com/iam-admin/serviceaccounts)
Expand All @@ -34,7 +30,7 @@ You must create [user custom attribute](https://admin.google.com/ac/customschema
}
```

### Hello asso
## Hello asso
[Documentation](https://centredaide.helloasso.com/s/article/api-comment-fonctionne-l-api-helloasso)

Custom fields
Expand Down Expand Up @@ -93,18 +89,19 @@ python3 -m les_louisdelatech.main -c config.toml -g google.json
```

# Dev
Install [uv](https://docs.astral.sh/uv/getting-started/installation/)

Install [Poetry](https://python-poetry.org/docs/master/#installing-with-the-official-installer)
Install and setup dependencies with `uv sync`

```bash
poetry install
poetry shell
### Run unit test
```
uv run pytest --cov
```

### Run ruff
```
poetry run ruff format --check .
poetry run ruff check .
uv run ruff format .
uv run ruff check .
```

## Licence
Expand Down
Loading

0 comments on commit df22968

Please sign in to comment.