-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1968 from backend-developers-ltd/ruff
replace `black` with `ruff`
- Loading branch information
Showing
31 changed files
with
152 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ orbs: | |
# coveralls: coveralls/[email protected] | ||
|
||
jobs: | ||
black: | ||
ruff: | ||
resource_class: small | ||
parameters: | ||
python-version: | ||
|
@@ -18,29 +18,29 @@ jobs: | |
- checkout | ||
|
||
- restore_cache: | ||
name: Restore cached black venv | ||
name: Restore cached ruff venv | ||
keys: | ||
- v2-pypi-py-black-<< parameters.python-version >> | ||
- v2-pypi-py-ruff-<< parameters.python-version >> | ||
|
||
- run: | ||
name: Update & Activate black venv | ||
name: Update & Activate ruff venv | ||
command: | | ||
python -m venv env/ | ||
. env/bin/activate | ||
python -m venv .venv | ||
. .venv/bin/activate | ||
python -m pip install --upgrade pip | ||
pip install black==23.7.0 | ||
pip install ruff -c requirements/dev.txt | ||
- save_cache: | ||
name: Save cached black venv | ||
name: Save cached ruff venv | ||
paths: | ||
- "env/" | ||
key: v2-pypi-py-black-<< parameters.python-version >> | ||
- ".venv/" | ||
key: v2-pypi-py-ruff-<< parameters.python-version >> | ||
|
||
- run: | ||
name: Black format check | ||
name: Ruff format check | ||
command: | | ||
. env/bin/activate | ||
python -m black --exclude '(env|venv|.eggs)' --check . | ||
. .venv/bin/activate | ||
ruff format --diff . | ||
check_compatibility: | ||
parameters: | ||
|
@@ -85,8 +85,8 @@ jobs: | |
- run: | ||
name: Update & Activate venv | ||
command: | | ||
python -m venv env/ | ||
. env/bin/activate | ||
python -m venv .venv | ||
. .venv/bin/activate | ||
python -m pip install --upgrade pip | ||
python -m pip install '.[dev]' | ||
|
@@ -99,20 +99,20 @@ jobs: | |
- run: | ||
name: Install Bittensor | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
pip install -e '.[dev]' | ||
- run: | ||
name: Instantiate Mock Wallet | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
./scripts/create_wallet.sh | ||
# TODO: Update test durations on different runs | ||
- run: | ||
name: Unit Tests | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
export PYTHONUNBUFFERED=1 | ||
pytest -n2 --reruns 3 --durations=0 --verbose --junitxml=test-results/unit_tests.xml \ | ||
--cov=. --cov-append --cov-config .coveragerc \ | ||
|
@@ -123,7 +123,7 @@ jobs: | |
- run: | ||
name: Integration Tests | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
export PYTHONUNBUFFERED=1 | ||
pytest -n2 --reruns 3 --reruns-delay 15 --durations=0 --verbose --junitxml=test-results/integration_tests.xml \ | ||
--cov=. --cov-append --cov-config .coveragerc \ | ||
|
@@ -143,7 +143,7 @@ jobs: | |
#- run: | ||
#name: Upload Coverage | ||
#command: | | ||
#. env/bin/activate && coveralls | ||
#. .venv/bin/activate && coveralls | ||
#env: | ||
#CI_NAME: circleci | ||
#CI_BUILD_NUMBER: $CIRCLE_BUILD_NUM | ||
|
@@ -173,8 +173,8 @@ jobs: | |
- run: | ||
name: Update & Activate venv | ||
command: | | ||
python -m venv env/ | ||
. env/bin/activate | ||
python -m venv .venv | ||
. .venv/bin/activate | ||
python -m pip install --upgrade pip | ||
python -m pip install '.[dev]' | ||
pip install flake8 | ||
|
@@ -188,19 +188,19 @@ jobs: | |
- run: | ||
name: Install Bittensor | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
pip install -e '.[dev]' | ||
- run: | ||
name: Lint with flake8 | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
python -m flake8 bittensor/ --count | ||
- run: | ||
name: Type check with mypy | ||
command: | | ||
. env/bin/activate | ||
. .venv/bin/activate | ||
python -m mypy --ignore-missing-imports bittensor/ | ||
unit-tests-all-python-versions: | ||
|
@@ -290,7 +290,7 @@ workflows: | |
|
||
pr-requirements: | ||
jobs: | ||
- black: | ||
- ruff: | ||
python-version: "3.9.13" | ||
- build-and-test: | ||
matrix: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.