Skip to content

Commit d2543d6

Browse files
authored
Merge pull request #4 from sangshuduo/maturin-support
feat: pip install support
2 parents d60a775 + 85d2afb commit d2543d6

File tree

9 files changed

+274
-11
lines changed

9 files changed

+274
-11
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ target/
44
# Added by cargo
55

66
/target
7+
.ai-commit.json
8+
venv
9+
__pycache__
10+
*.so

Cargo.lock

Lines changed: 191 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
[package]
22
name = "pysleuth"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors = ["Shuduo Sang <sangshuduo@gmail.com>"]
55
edition = "2021"
66
description = "PySleuth is a Python code linter written in Rust"
77

8+
[lib]
9+
name = "pysleuth"
10+
crate-type = ["cdylib"] # Important for building a dynamic library
11+
812
[dependencies]
913
tree-sitter = "0.24.4"
1014
tree-sitter-python = "0.23.4"
1115
anyhow = "1.0.93"
1216
colored = "2.1.0"
13-
clap = { version = "4.5.21", features = ["derive"] }
17+
clap = { version = "4.5.23", features = ["derive"] }
18+
pyo3 = { version = "0.18.0", features = ["extension-module"] } # For Python bindings

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# PySleuth
22

33
Hunging down your Python code errors with PySleuth.
4+
5+
## Installation
6+
7+
```bash
8+
pip install pysleuth
9+
```

ai-commit

4.9 MB
Binary file not shown.

pyproject.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[build-system]
2+
requires = ["maturin>=1.0,<2.0"]
3+
build-backend = "maturin"
4+
5+
[project]
6+
name = "pysleuth"
7+
version = "0.1.2"
8+
description = "A tool to analyze Python code for potential error."
9+
authors = [
10+
{ name = "Shudou Sang", email = "sangshuduo@gmail.com" },
11+
]
12+
readme = "README.md"
13+
license = "MIT"
14+
requires-python = ">=3.6"
15+
16+
[project.urls]
17+
Repository = "https://github.com/sangshuduo/pysleuth"
18+
19+
[project.scripts]
20+
pysleuth = "pysleuth.__main__:main"

pysleuth/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# __init__.py
2+
# Let this be minimal, or import from the Rust extension if you want:
3+
from .pysleuth import version_py, run_command

pysleuth/__main__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import sys
2+
from .pysleuth import version_py, run_command
3+
4+
def main():
5+
if "--version" in sys.argv:
6+
print(version_py())
7+
else:
8+
# Example: pass everything except the script name to Rust:
9+
args = " ".join(sys.argv[1:])
10+
run_command(args)
11+
12+
if __name__ == "__main__":
13+
main()

0 commit comments

Comments
 (0)