|
| 1 | +[build-system] |
| 2 | +requires = ["hatchling", "hatch-vcs"] |
| 3 | +build-backend = "hatchling.build" |
| 4 | + |
| 5 | +[project] |
| 6 | +name = "spinach" |
| 7 | +dynamic = ["version"] |
| 8 | +description = "Modern Redis task queue for Python 3" |
| 9 | +readme = "README.rst" |
| 10 | +license-files = { paths = ["LICENSE"] } |
| 11 | +requires-python = ">=3.8.0,<4.0.0" |
| 12 | +authors = [ |
| 13 | + { name = "Nicolas Le Manchet", email = "nicolas@lemanchet.fr" }, |
| 14 | +] |
| 15 | +classifiers = [ |
| 16 | + "Development Status :: 4 - Beta", |
| 17 | + "Intended Audience :: Developers", |
| 18 | + "Topic :: Software Development :: Libraries", |
| 19 | + "Topic :: System :: Distributed Computing", |
| 20 | + "License :: OSI Approved :: BSD License", |
| 21 | + "Natural Language :: English", |
| 22 | + "Programming Language :: Python :: 3", |
| 23 | + "Programming Language :: Python :: 3 :: Only", |
| 24 | + "Programming Language :: Python :: 3.8", |
| 25 | + "Programming Language :: Python :: 3.9", |
| 26 | + "Programming Language :: Python :: 3.10", |
| 27 | + "Programming Language :: Python :: 3.11", |
| 28 | + "Programming Language :: Python :: 3.12", |
| 29 | +] |
| 30 | +keywords = ["task", "queue", "jobs", "redis"] |
| 31 | +urls.Source = "https://github.com/NicolasLM/spinach" |
| 32 | + |
| 33 | +dependencies = [ |
| 34 | + "redis", |
| 35 | + "blinker" |
| 36 | +] |
| 37 | + |
| 38 | +[project.optional-dependencies] |
| 39 | +tests = [ |
| 40 | + "pytest", |
| 41 | + "pytest-cov", |
| 42 | + "pytest-threadleak", |
| 43 | + "ruff", |
| 44 | + "flask", |
| 45 | + "django" |
| 46 | +] |
| 47 | + |
| 48 | +[tool.hatch.version] |
| 49 | +source = "vcs" |
| 50 | + |
| 51 | +[tool.hatch.build.hooks.vcs] |
| 52 | +version-file = "spinach/_version.py" |
| 53 | + |
| 54 | +[tool.hatch.build.targets.sdist] |
| 55 | +ignore-vcs = true |
| 56 | +include = ["/spinach", "/tests"] |
| 57 | + |
| 58 | +[tool.hatch.build.targets.wheel] |
| 59 | +packages = ["spinach"] |
| 60 | + |
| 61 | +[tool.hatch.build.targets.wheel.package-data] |
| 62 | +"spinach.brokers.redis_scripts" = [ |
| 63 | + "deregister.lua", |
| 64 | + "enqueue_job.lua", |
| 65 | + "enqueue_jobs_from_dead_broker.lua", |
| 66 | + "flush.lua", |
| 67 | + "get_jobs_from_queue.lua", |
| 68 | + "move_future_jobs.lua", |
| 69 | + "register_periodic_tasks.lua", |
| 70 | + "remove_job_from_running.lua", |
| 71 | + "set_concurrency_keys.lua", |
| 72 | +] |
| 73 | + |
| 74 | +[tool.hatch.envs.default] |
| 75 | +path = ".hatch" |
| 76 | +features = ["tests"] |
| 77 | + |
| 78 | +scripts.pep8 = ["ruff spinach tests"] |
| 79 | + |
| 80 | +scripts.py3 = [ |
| 81 | + "docker-compose -f tests/docker-compose.yml up -d", |
| 82 | + "pytest tests {args}", |
| 83 | + "docker-compose -f tests/docker-compose.yml down", |
| 84 | +] |
| 85 | + |
| 86 | +# A minimalist pytest runner for Github to use |
| 87 | +scripts.ci = ["pytest -v --cov=spinach tests {args}"] |
| 88 | + |
| 89 | +[tool.ruff.lint] |
| 90 | +select = ["B", "C9", "D", "E", "F", "S", "W"] |
| 91 | +ignore = [ |
| 92 | + "B018", # Useless expression (seems to have false-positive bugs) |
| 93 | + "S101", # Use of `assert` detected (conflicts with pytest) |
| 94 | + "D10", # Missing docstring in public function / module / etc. |
| 95 | + "D203", # 1 blank line required before class docstring |
| 96 | + "D205", # 1 blank line required between summary line and description |
| 97 | + "D213", # Multi-line docstring summary should start at the second line |
| 98 | + "D40", # First line of docstring complaints |
| 99 | + "D415", # First line should end with a period, question mark, or exclamation point |
| 100 | +] |
| 101 | +mccabe.max-complexity = 13 |
| 102 | + |
| 103 | +[tool.ruff.lint.per-file-ignores] |
| 104 | +# Aggregating symbols into a convenient location for import is good practice |
| 105 | +# for libraries, we don't care if they look unused |
| 106 | +"__init__.py" = ["F401"] |
| 107 | + |
| 108 | +[tool.coverage.run] |
| 109 | +relative_files = true |
| 110 | +include = ["spinach/*"] |
| 111 | +omit = ["spinach/_version.py"] |
| 112 | + |
| 113 | +[tool.pytest.ini_options] |
| 114 | +threadleak = true |
0 commit comments