diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8ef710..e628b71 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ jobs: python-version: "${{ matrix.python-version }}" allow-prereleases: true - name: "Install dependencies" - run: pip install -r requirements.txt + run: scripts/install - name: Start Redis uses: supercharge/redis-github-action@1.7.0 with: diff --git a/pyproject.toml b/pyproject.toml index 9537383..a109cef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,7 +79,7 @@ path = "CHANGELOG.md" strict = true show_error_codes = true warn_unused_ignores = false - +exclude = ['venv', '.venv'] [[tool.mypy.overrides]] module = "tests.*" diff --git a/scripts/check b/scripts/check index 842c2c7..6235e01 100755 --- a/scripts/check +++ b/scripts/check @@ -1,6 +1,12 @@ #! /bin/bash -ex -ruff format tests hishel --diff -ruff tests hishel -mypy tests hishel -python unasync.py --check +export PREFIX="" +if [ -d '.venv' ] ; then + export PREFIX=".venv/bin/" +fi +export SOURCE_FILES="hishel tests" + +${PREFIX}ruff format $SOURCE_FILES --diff +${PREFIX}ruff check $SOURCE_FILES +${PREFIX}mypy $SOURCE_FILES +${PREFIX}python unasync.py --check diff --git a/scripts/install b/scripts/install index 8c5caeb..e11077e 100755 --- a/scripts/install +++ b/scripts/install @@ -1,9 +1,9 @@ #! /bin/bash -x -rm -rf venv -python -m venv venv +rm -rf .venv +pip install uv +uv venv -source venv/bin/activate +source .venv/bin/activate -pip install --upgrade pip -pip install -r requirements.txt \ No newline at end of file +uv pip install -r requirements.txt \ No newline at end of file diff --git a/scripts/lint b/scripts/lint index 0ae545c..ccef300 100755 --- a/scripts/lint +++ b/scripts/lint @@ -1,5 +1,11 @@ #! /bin/bash -ex -ruff format hishel tests -ruff check --fix hishel tests -python unasync.py +export PREFIX="" +if [ -d '.venv' ]; then + export PREFIX=".venv/bin/" +fi +export SOURCE_FILES="hishel tests" + +${PREFIX}ruff check --fix $SOURCE_FILES +${PREFIX}ruff format $SOURCE_FILES +${PREFIX}python unasync.py diff --git a/scripts/test b/scripts/test index 164c892..4f1df5c 100755 --- a/scripts/test +++ b/scripts/test @@ -1,7 +1,11 @@ -#! /bin/bash -e -set -x +#! /bin/bash -ex + +export PREFIX="" +if [ -d '.venv' ] ; then + export PREFIX=".venv/bin/" +fi ./scripts/check -coverage run -m pytest tests +${PREFIX}coverage run -m pytest tests -coverage report --show-missing --skip-covered --fail-under=100 \ No newline at end of file +${PREFIX}coverage report --show-missing --skip-covered --fail-under=100 \ No newline at end of file