Skip to content

Commit

Permalink
Fix CI scripts (#207)
Browse files Browse the repository at this point in the history
* Fix CI scripts

* Use uv for speeeeed

* Use scripts/install in github action
  • Loading branch information
karpetrosyan committed Mar 23, 2024
1 parent 319635a commit 088dc65
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"
Expand Down
14 changes: 10 additions & 4 deletions scripts/check
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions scripts/install
Original file line number Diff line number Diff line change
@@ -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
uv pip install -r requirements.txt
12 changes: 9 additions & 3 deletions scripts/lint
Original file line number Diff line number Diff line change
@@ -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
12 changes: 8 additions & 4 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -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
${PREFIX}coverage report --show-missing --skip-covered --fail-under=100

0 comments on commit 088dc65

Please sign in to comment.