mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Migrate to UV (#1748)
* Switch to using `uv` for dependency management and update related project workflows and scripts * Expand contributing documentation with instructions for using `uv`, including dependency management, testing, linting, and docs workflows. * Add changelog entry for migration to `uv` for dependency management and workflows
This commit is contained in:
parent
7201e82238
commit
ce4ddb77f4
9 changed files with 3203 additions and 149 deletions
34
.github/workflows/tests.yml
vendored
34
.github/workflows/tests.yml
vendored
|
|
@ -58,18 +58,21 @@ jobs:
|
|||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: "pip"
|
||||
cache-dependency-path: pyproject.toml
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
enable-cache: true
|
||||
|
||||
- name: Install project dependencies
|
||||
run: |
|
||||
pip install -e .[dev,test,redis,mongo,proxy,i18n,fast,signature]
|
||||
uv sync --all-extras --group dev --group test
|
||||
|
||||
- name: Lint code
|
||||
run: |
|
||||
ruff check --output-format=github aiogram examples
|
||||
mypy aiogram
|
||||
black --check --diff aiogram tests
|
||||
uv run ruff check --output-format=github aiogram examples
|
||||
uv run mypy aiogram
|
||||
uv run black --check --diff aiogram tests
|
||||
|
||||
- name: Setup redis
|
||||
if: ${{ env.IS_WINDOWS == 'false' }}
|
||||
|
|
@ -91,10 +94,10 @@ jobs:
|
|||
flags="$flags --cov=aiogram --cov-config .coveragerc --cov-report=xml"
|
||||
[[ "$IS_WINDOWS" == "false" ]] && flags="$flags --redis redis://localhost:6379/0"
|
||||
[[ "$IS_UBUNTU" == "true" ]] && flags="$flags --mongo mongodb://mongo:mongo@localhost:27017"
|
||||
pytest $flags
|
||||
uv run pytest $flags
|
||||
|
||||
- name: Upload coverage data
|
||||
uses: codecov/codecov-action@v4
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: coverage.xml
|
||||
|
|
@ -123,20 +126,23 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: "pip"
|
||||
cache-dependency-path: pyproject.toml
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
enable-cache: true
|
||||
|
||||
- name: Install project dependencies
|
||||
run: |
|
||||
pip install -e .[dev,test,redis,mongo,proxy,i18n,fast,signature]
|
||||
uv sync --all-extras --group dev --group test
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
flags=""
|
||||
pytest $flags
|
||||
uv run pytest $flags
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue