Skip to content

Commit

Permalink
Use ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterDing committed Feb 4, 2024
1 parent a2f468b commit 93a4930
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@ jobs:
poetry run pip3 install setuptools
poetry install --no-root
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Format check with black
run: poetry run black --check .
- name: Typecheck with mypy at Windows
run: poetry run mypy -p alipcs_py --ignore-missing-imports --warn-unreachable --implicit-optional --allow-redefinition --disable-error-code abstract --disable-error-code attr-defined
if: matrix.os == 'windows-latest'
- name: Typecheck with mypy at Linux
run: poetry run mypy -p alipcs_py --ignore-missing-imports --warn-unreachable --implicit-optional --allow-redefinition --disable-error-code abstract
if: matrix.os == 'ubuntu-latest'
- name: Format check
run: poetry run ruff format --check .
- name: Typecheck
run: poetry run ruff check alipcs_py
- name: Test with pytest
run: |
poetry run python build.py build_ext --inplace
Expand Down
11 changes: 3 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
typecheck:
mypy -p alipcs_py \
--ignore-missing-imports \
--warn-unreachable \
--implicit-optional \
--allow-redefinition \
--disable-error-code abstract
ruff check alipcs_py


format-check:
black --check .
ruff format --check .

format:
black .
ruff format .

build-pyx:
python build.py build_ext --inplace
Expand Down
12 changes: 7 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
build = "build.py"

[tool.black]
line-length = 119

[tool.ruff]
ignore = ["E501", "F401", "F841"]
ignore = ["E501", "E402", "F401", "F403", "F841"]
line-length = 119

[tool.poetry.dependencies]
Expand All @@ -51,16 +50,19 @@ passlib = ">=1.7"

[tool.poetry.group.dev.dependencies]
pytest = ">=7.4"
mypy = ">=1.7"
black = ">=23.11"
ruff = ">=0.2"
setuptools = ">=69.0"
cython = ">=3.0"

[tool.poetry.build]
script = "build.py"
generate-setup-file = true

[tool.poetry.scripts]
AliPCS-Py = 'alipcs_py.app:main'

[tool.pyright]
reportGeneralTypeIssues = true

[build-system]
requires = ["cython", "wheel", "setuptools"]
requires = ["poetry-core", "cython", "wheel", "setuptools"]

0 comments on commit 93a4930

Please sign in to comment.