-
Notifications
You must be signed in to change notification settings - Fork 4
Modernize Python tooling #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
0xDEC0DE
wants to merge
2
commits into
NicolasLM:master
Choose a base branch
from
0xDEC0DE:issue/33
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| [build-system] | ||
| requires = ["hatchling", "hatch-vcs"] | ||
| build-backend = "hatchling.build" | ||
|
|
||
| [project] | ||
| name = "spinach" | ||
| dynamic = ["version"] | ||
| description = "Modern Redis task queue for Python 3" | ||
| readme = "README.rst" | ||
| license-files = { paths = ["LICENSE"] } | ||
| requires-python = ">=3.8.0,<4.0.0" | ||
| authors = [ | ||
| { name = "Nicolas Le Manchet", email = "nicolas@lemanchet.fr" }, | ||
| ] | ||
| classifiers = [ | ||
| "Development Status :: 4 - Beta", | ||
| "Intended Audience :: Developers", | ||
| "Topic :: Software Development :: Libraries", | ||
| "Topic :: System :: Distributed Computing", | ||
| "License :: OSI Approved :: BSD License", | ||
| "Natural Language :: English", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3 :: Only", | ||
| "Programming Language :: Python :: 3.8", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11", | ||
| "Programming Language :: Python :: 3.12", | ||
| ] | ||
| keywords = ["task", "queue", "jobs", "redis"] | ||
| urls.Source = "https://github.com/NicolasLM/spinach" | ||
|
|
||
| dependencies = [ | ||
| "redis", | ||
| "blinker" | ||
| ] | ||
|
|
||
| [project.optional-dependencies] | ||
| tests = [ | ||
| "pytest", | ||
| "pytest-cov", | ||
| "pytest-threadleak", | ||
| "ruff", | ||
| "flask", | ||
| "django" | ||
| ] | ||
|
|
||
| [tool.hatch.version] | ||
| source = "vcs" | ||
|
|
||
| [tool.hatch.build.hooks.vcs] | ||
| version-file = "spinach/_version.py" | ||
|
|
||
| [tool.hatch.build.targets.sdist] | ||
| ignore-vcs = true | ||
| include = ["/spinach", "/tests"] | ||
|
|
||
| [tool.hatch.build.targets.wheel] | ||
| packages = ["spinach"] | ||
|
|
||
| [tool.hatch.build.targets.wheel.package-data] | ||
| "spinach.brokers.redis_scripts" = [ | ||
| "deregister.lua", | ||
| "enqueue_job.lua", | ||
| "enqueue_jobs_from_dead_broker.lua", | ||
| "flush.lua", | ||
| "get_jobs_from_queue.lua", | ||
| "move_future_jobs.lua", | ||
| "register_periodic_tasks.lua", | ||
| "remove_job_from_running.lua", | ||
| "set_concurrency_keys.lua", | ||
| ] | ||
|
|
||
| [tool.hatch.envs.default] | ||
| path = ".hatch" | ||
| features = ["tests"] | ||
|
|
||
| scripts.pep8 = ["ruff check spinach tests"] | ||
|
|
||
| scripts.py3 = [ | ||
| "docker-compose -f tests/docker-compose.yml up -d", | ||
| "pytest tests {args}", | ||
| "docker-compose -f tests/docker-compose.yml down", | ||
| ] | ||
|
|
||
| # A minimalist pytest runner for Github to use | ||
| scripts.ci = ["pytest -v --cov=spinach tests {args}"] | ||
|
|
||
| [tool.hatch.envs.docs] | ||
| detatched = true | ||
| dependencies = [ | ||
| "sphinx", | ||
| "blinker" | ||
| ] | ||
| path = ".hatch" | ||
| scripts.build = ["cd doc && make {args}"] | ||
|
|
||
| [tool.ruff.lint] | ||
| select = ["B", "C9", "D", "E", "F", "S", "W"] | ||
| ignore = [ | ||
| "B018", # Useless expression (seems to have false-positive bugs) | ||
| "S101", # Use of `assert` detected (conflicts with pytest) | ||
| "D10", # Missing docstring in public function / module / etc. | ||
| "D203", # 1 blank line required before class docstring | ||
| "D205", # 1 blank line required between summary line and description | ||
| "D213", # Multi-line docstring summary should start at the second line | ||
| "D40", # First line of docstring complaints | ||
| "D415", # First line should end with a period, question mark, or exclamation point | ||
| # TODO(nic): The remaining ignores point to actual issues in the code. | ||
| # Remove them and fix the issues later. | ||
| "B024", | ||
| "B027", | ||
| "B904", | ||
| "D204", | ||
| "F401", | ||
| "F841", | ||
| "S301", | ||
| "S311", | ||
| ] | ||
| # Aggregating symbols into a convenient location for import is good practice | ||
| # for libraries, we don't care if they look unused | ||
| per-file-ignores = { "__init__.py" = ["F401"] } | ||
| mccabe.max-complexity = 13 | ||
|
|
||
| [tool.coverage.run] | ||
| relative_files = true | ||
| include = ["spinach/*"] | ||
| omit = ["spinach/_version.py"] | ||
|
|
||
| [tool.pytest.ini_options] | ||
| threadleak = true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,8 +1,6 @@ | ||
| from ._version import __version__ | ||
| from .brokers.memory import MemoryBroker | ||
| from .brokers.redis import RedisBroker | ||
| from .const import VERSION | ||
| from .engine import Engine | ||
| from .task import Tasks, Batch, RetryException, AbortException | ||
| from .worker import ThreadWorkers, AsyncioWorkers | ||
|
|
||
| __version__ = VERSION | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| VERSION = '0.0.25' | ||
|
|
||
| DEFAULT_QUEUE = 'spinach' | ||
| DEFAULT_NAMESPACE = 'spinach' | ||
| DEFAULT_MAX_RETRIES = 0 | ||
|
|
||
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.