Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

### 0.2.0

- Drop support for Python3.8
- Only install tomlkit for Python version less than 3.11 ([#5])
- Migrate lint tool from isort+black to ruff ([#5])
- Drop support for Python3.8 ([#4])

[#5]: https://github.com/tortoise/tortoise-cli/pull/5
[#4]: https://github.com/tortoise/tortoise-cli/pull/4

## 0.1

Expand Down
21 changes: 11 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
checkfiles = tortoise_cli/ tests/ examples/ conftest.py
black_opts = -l 100 -t py39
py_warn = PYTHONDEVMODE=1

up:
Expand All @@ -8,20 +7,22 @@ up:
deps:
@poetry install --all-groups

style: deps
isort -src $(checkfiles)
black $(black_opts) $(checkfiles)
style: deps _style
_style:
ruff format $(checkfiles)
ruff check --fix $(checkfiles)

check: deps
black --check $(black_opts) $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
flake8 $(checkfiles)
check: deps _check
_check:
ruff format --check $(checkfiles) || (echo "Please run 'make style' to auto-fix style issues" && false)
ruff check $(checkfiles)
mypy $(checkfiles)


test: deps
test: deps _test
_test:
$(py_warn) pytest

build: deps
@poetry build

ci: check test
ci: check _test
172 changes: 34 additions & 138 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 18 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies = [
"tortoise-orm",
"click",
"ptpython",
"tomlkit",
"tomlkit (>=0.11.4,<1.0.0); python_version < '3.11'",
]

[project.urls]
Expand All @@ -26,15 +26,13 @@ packages = [
]

[tool.poetry.group.test.dependencies]
pytest = "*"
pytest-xdist = "*"
pytest-sugar = "*"
pytest = "^8.4.0"
pytest-xdist = "^3.7.0"
pytest-sugar = "^1.0.0"

[tool.poetry.group.dev.dependencies]
isort = "*"
flake8 = "*"
black = "*"
mypy = "*"
ruff = "^0.11.13"
mypy = "^1.16.0"

[build-system]
requires = ["poetry-core>=2.0.0"]
Expand All @@ -50,3 +48,15 @@ tortoise_orm = "examples.TORTOISE_ORM"
pretty = true
check_untyped_defs = true
ignore_missing_imports = true

[tool.ruff]
line-length = 100
[tool.ruff.lint]
ignore = ["E501"]
extend-select = [
"I", # https://docs.astral.sh/ruff/rules/#isort-i
"SIM", # https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"FA", # https://docs.astral.sh/ruff/rules/#flake8-future-annotations-fa
"UP", # https://docs.astral.sh/ruff/rules/#pyupgrade-up
"RUF100", # https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
]
Loading