diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 763a5c3..00b9424 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11"] services: redis: diff --git a/README.md b/README.md index eae6a0b..b980987 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,6 @@ poetry install --all-extras poetry run python example/app.py ``` -## TODO +## 其他 -* 由于种种3.9之后才加入的语法与特性,减少开发与适配成本,计划后续版本不再适配Python3.9以下版本 +* 由于种种3.9之后才加入的语法与特性,减少开发与适配成本,计划后续版本不再适配Python3.9以下版本,0.3.0最后一个支持Python3.8的版本 diff --git a/pyproject.toml b/pyproject.toml index bbedb8a..36ea910 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,104 +1,100 @@ [tool.poetry] -name = "pyxxl" -version = "0.3.0" -readme = "README.md" -license = "GPL-3.0-only" -description = "A Python executor for XXL-jobs" authors = ["fcfangcc "] -repository = "https://github.com/fcfangcc/pyxxl" -keywords = ["XXL"] classifiers = [ - "Topic :: Software Development :: Libraries :: Python Modules" + "Topic :: Software Development :: Libraries :: Python Modules", ] - +description = "A Python executor for XXL-jobs" +keywords = ["XXL"] +license = "GPL-3.0-only" +name = "pyxxl" +readme = "README.md" +repository = "https://github.com/fcfangcc/pyxxl" +version = "0.3.1" [tool.poetry.dependencies] -python = "^3.8" -aiohttp = "^3.8.1" aiofiles = "^22.1.0" -redis = { version = "^4.4.0", optional = true } -python-dotenv = { version = "*", optional = true } -prometheus-client = { version = "*", optional = true } +aiohttp = "^3.8.1" +prometheus-client = {version = "*", optional = true} +python = "^3.9" +python-dotenv = {version = "*", optional = true} +redis = {version = "^4.4.0", optional = true} [tool.poetry.extras] -redis = ["redis"] +all = ["redis", "python-dotenv", "prometheus-client"] dotenv = ["python-dotenv"] metrics = ["prometheus-client"] -all = ["redis", "python-dotenv","prometheus-client"] +redis = ["redis"] [tool.poetry.group.doc.dependencies] +mdx-include = "^1.4.2" mkdocs = "^1.4.2" -mkdocstrings = { version = "^0.20.0", extras = ["python"] } mkdocs-material = "^9.0.9" -mdx-include = "^1.4.2" +mkdocstrings = {version = "^0.20.0", extras = ["python"]} [tool.poetry.group.dev.dependencies] -pytest = "7.1.2" -pytest-asyncio = "0.18.3" -pre-commit = "2.19.0" +black = "23.1.0" mypy = "0.942" +pre-commit = "2.19.0" +pytest = "7.1.2" pytest-aiohttp = "1.0.4" +pytest-asyncio = "0.18.3" pytest-cov = "3.0.0" ruff = "^0.0.249" -black = "23.1.0" - [build-system] -requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" +requires = ["poetry-core>=1.0.0"] # if your need # https://python-poetry.org/docs/repositories/#install-dependencies-from-a-private-repository [[tool.poetry.source]] name = "aliyun" -url = "https://mirrors.aliyun.com/pypi/simple/" secondary = true +url = "https://mirrors.aliyun.com/pypi/simple/" [tool.mypy] -files = "pyxxl" -ignore_missing_imports = true disallow_untyped_defs = true exclude = [ - '^pyxxl/tests/test_.*\.py$', - '^pyxxl/tests/api/test_.*\.py$', + '^pyxxl/tests/test_.*\.py$', + '^pyxxl/tests/api/test_.*\.py$', ] - +files = "pyxxl" +ignore_missing_imports = true [tool.coverage.run] concurrency = ["thread"] [tool.coverage.report] exclude_lines = [ - "pragma: no cover", - "if __name__ == .__main__.", - "raise NotImplementedError", - "\\.\\.\\.", - "if TYPE_CHECKING", + "pragma: no cover", + "if __name__ == .__main__.", + "raise NotImplementedError", + "\\.\\.\\.", + "if TYPE_CHECKING", ] [tool.black] line-length = 119 -target-version = ['py38'] +target-version = ['py39'] [tool.ruff] +exclude = [ + "__init__.py", +] line-length = 119 select = [ - "E", - "W", - "F", - "I", - "C", - "B", - "PGH" -] -exclude = [ - "__init__.py" + "E", + "W", + "F", + "I", + "C", + "B", + "PGH", ] ignore = [ - "C408", # Unnecessary `dict` call (rewrite as a literal) + "C408", # Unnecessary `dict` call (rewrite as a literal) ] - [tool.pytest.ini_options] addopts = "--asyncio-mode auto"