From b191122db7d545da85fe9365196fa18c93de9ff2 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sun, 8 Jan 2023 21:57:48 +0200 Subject: [PATCH] Change dependencies --- .github/workflows/tests.yml | 23 ++++++++++++----------- pyproject.toml | 30 ++++++++++++++++-------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fdf7d177..0a3bb508 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -64,28 +64,23 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - - name: Setup redis - if: ${{ env.IS_WINDOWS == 'false' }} - uses: shogo82148/actions-setup-redis@v1 - with: - redis-version: 6 + cache: "pip" + cache-dependency-path: pyproject.toml - name: Load cached venv id: cached-pip-dependencies uses: actions/cache@v2 with: - path: .venv - key: venv-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}-${{ secrets.CACHE_VERSION }} + path: ${{ env.pythonLocation }} + key: ${{ matrix.os }}-python-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ secrets.CACHE_VERSION }} - name: Install project dependencies if: steps.cached-pip-dependencies.outputs.cache-hit != 'true' run: | python -m venv .venv - source .venv/bin/activate - extras="redis,proxy,i18n,test" + extras="dev,test,redis,proxy,i18n" [[ "$IS_PYPY" == "false" ]] && extras="$extras,fast" - pip install -e .[$extras] + .venv/bin/pip install -e .[$extras] - name: Lint code if: "env.IS_PYPY == 'false'" @@ -94,6 +89,12 @@ jobs: mypy aiogram black --check --diff aiogram tests + - name: Setup redis + if: ${{ env.IS_WINDOWS == 'false' }} + uses: shogo82148/actions-setup-redis@v1 + with: + redis-version: 6 + - name: Run tests run: | flags="" diff --git a/pyproject.toml b/pyproject.toml index 1be5e855..48acb1f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,20 +90,7 @@ docs = [ "Pygments~=2.13.0", "sphinxcontrib-towncrier~=0.3.1a3", ] - -[project.urls] -Homepage = "https://aiogram.dev/" -Documentation = "https://docs.aiogram.dev/" -Repository = "https://github.com/aiogram/aiogram/" - -[tool.hatch.envs.default] -features = [ - "fast", - "redis", - "proxy", - "i18n", -] -dependencies = [ +dev = [ "black~=22.8", "isort~=5.11", "ruff~=0.0.215", @@ -113,6 +100,20 @@ dependencies = [ "packaging~=21.3", "typing-extensions~=4.3.0", ] + +[project.urls] +Homepage = "https://aiogram.dev/" +Documentation = "https://docs.aiogram.dev/" +Repository = "https://github.com/aiogram/aiogram/" + +[tool.hatch.envs.default] +features = [ + "dev", + "fast", + "redis", + "proxy", + "i18n", +] post-install-commands = [ "pre-commit install", ] @@ -138,6 +139,7 @@ serve = "sphinx-autobuild --watch aiogram/ --watch CHANGELOG.rst --watch README. [tool.hatch.envs.dev] python = "3.10" features = [ + "dev", "fast", "redis", "proxy",