-
Notifications
You must be signed in to change notification settings - Fork 12
feat(spider-py): Add boilerplate for spider-py; Add build and lint tasks for spider-py. #179
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
Changes from all commits
d2ac198
cc8a097
7f68bdc
2394649
6ff3e33
7ae8a78
56502f9
6f6becf
a74523d
2345d22
77ee494
38b86c8
3698339
369e9f1
90aa5a2
1769c95
edaa834
7faac8f
f494a90
eb01bb2
ff2fe1c
d476e42
850126d
65841a0
8564fc2
a6e7d29
573b448
6ad72c3
ba7c6e5
209acb1
406b514
66892f5
80f0a10
3186a42
0925938
6936a9b
7407090
6a95b24
f29dcba
453f209
d1011c7
a7dc642
a7d92c2
1c6213b
0f13d07
14d6326
55a727a
c98fea1
ef64454
09ba8ad
4e7237e
1f944d0
68992fc
1127b22
4c51c91
56878b2
bb428c9
944bd5e
d75bc15
4b7eca2
8ddbda7
0d998ec
6004d64
bcab5db
a50d25a
fbebb96
0322bd5
2a08155
0b62f73
7384158
70ef90a
b09515c
bad9675
e009ff4
a0407a7
aa9a8de
3c7e794
b4d6576
23f31cd
0167ac0
f447614
a84de83
2d1b6fc
061d101
de149ee
d332dbe
8c27b16
95b98c8
427dd6b
854cd11
5565c9e
01dd0c6
e022404
7753153
526482c
539738f
2a36054
05f9c57
2c96e13
bc0c3b1
af6da1c
f38feb3
9e61e88
eb31097
9a05967
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.13 |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,41 @@ | ||||||||||||
| # spider-py | ||||||||||||
|
|
||||||||||||
| This project is a Python package that provides access to Spider, a distributed task execution | ||||||||||||
| framework, enabling seamless integration and task management in Python applications. | ||||||||||||
|
|
||||||||||||
| ## Building/Packing | ||||||||||||
|
|
||||||||||||
| To manually build a package for distribution, follow the steps below. | ||||||||||||
|
|
||||||||||||
| ### Requirements | ||||||||||||
|
|
||||||||||||
| * [Task] >= 3.40.0 | ||||||||||||
| * [uv] >= 0.7.0 | ||||||||||||
|
|
||||||||||||
|
Comment on lines
+12
to
+14
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add Python to the prerequisites to align with project standards. Per the project’s convention, Python should be documented alongside Task and uv. The repo pins Python to 3.13; make that explicit here. ### Requirements
* [Task] >= 3.40.0
* [uv] >= 0.7.0
+* Python 3.13 (see .python-version)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| ### Build Commands | ||||||||||||
|
|
||||||||||||
| * Build a Python wheel: | ||||||||||||
|
|
||||||||||||
| ```shell | ||||||||||||
| task build:spider-py | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| The command above will generate both a `.tar.gz` and a `.whl` package in the `build/spider-py` | ||||||||||||
| directory at the Spider project root. | ||||||||||||
|
|
||||||||||||
| ## Linting | ||||||||||||
|
|
||||||||||||
| To run all linting checks: | ||||||||||||
|
|
||||||||||||
| ```shell | ||||||||||||
| task lint:spider-py-check | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| To run all linting checks AND automatically fix any fixable issues: | ||||||||||||
|
|
||||||||||||
| ```shell | ||||||||||||
| task lint:spider-py-fix | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| [Task]: https://taskfile.dev | ||||||||||||
| [uv]: https://docs.astral.sh/uv/ | ||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| [project] | ||
| name = "spider-py" | ||
| version = "0.0.1" | ||
| description = "A distributed task execution framework." | ||
| readme = "README.md" | ||
| requires-python = ">=3.10" | ||
| authors = [ | ||
| { name = "Sitao Wang", email = "sitao.wang@yscope.com" }, | ||
| { name = "Zhihao Lin", email = "lin.zhihao@yscope.com" }, | ||
| ] | ||
| dependencies = [ | ||
| "mariadb>=1.1.13", | ||
| "msgpack-types>=0.5.0", | ||
| ] | ||
|
|
||
| [project.scripts] | ||
| spider_task_executor = "spider_py.task_executor.task_executor:main" | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "mypy>=1.12.0", | ||
| "ruff>=0.4.4", | ||
| ] | ||
|
|
||
| [build-system] | ||
| requires = ["hatchling>=1.18.0"] | ||
| build-backend = "hatchling.build" | ||
|
|
||
| [tool.mypy] | ||
| strict = true | ||
| # Additional output | ||
| pretty = true | ||
| show_error_code_links = true | ||
| show_error_context = true | ||
|
|
||
| [tool.ruff] | ||
| line-length = 100 | ||
|
|
||
| [tool.ruff.format] | ||
| docstring-code-format = true | ||
| docstring-code-line-length = 100 | ||
|
|
||
| [tool.ruff.lint] | ||
| select = ["ALL"] | ||
| extend-select = ["PT"] | ||
| ignore = [ | ||
| "COM812", # Redundant and conflicts with ruff format | ||
| "D203", # No blank line before docstrings (D211) | ||
| "D205", # Breaks if summary is larger than one line due to wrapping or if no summary exists | ||
| "D212", # Enforce docstring summary line on the next line after quotes (D213) | ||
| "D400", # First line of docstrings may not end in period | ||
| "D401", # Docstrings should be written in present tense (not imperative) | ||
| "D415", # First line of docstrings may not end in a period, question mark, or exclamation point | ||
| "FA102", # Allow use of PEP 604 union in type annotations | ||
| "FBT", # Allow bool positional parameters since other value positions are allowed | ||
| "FIX002", # Allow todo statements | ||
| "PERF401", # Allow for loops when creating lists | ||
| "PERF403", # Allow for loops when creating dicts | ||
| "S311", # Allow usage of `random` package | ||
| "SIM102", # Allow collapsible if statements for readability | ||
| "TD002", # Author unnecessary for todo statement | ||
| "TD003", # Issue link unnecessary for todo statement | ||
| "UP015", # Explicit open modes are helpful | ||
| ] | ||
| isort.order-by-type = false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Spider package root.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Spider python client.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Spider core package.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| """Task module for Spider.""" | ||
|
|
||
|
|
||
| class Task: | ||
| """Represents a task in Spider.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Python task executor for running Python task function.""" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| """Executes a Spider Python task.""" | ||
|
|
||
|
|
||
| def main() -> None: | ||
| """Main function to execute the task.""" | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
Uh oh!
There was an error while loading. Please reload this page.