Skip to content
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

chore: move python files into python subfolder #240

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.lazy.lua
/target
target/

# Byte-compiled / optimized / DLL files
__pycache__/
Expand All @@ -13,20 +12,6 @@ __pycache__/
.venv/
dist/

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml

.DS_Store

# Sphinx documentation
/docs/_build/
/docs/generated/

# PyCharm
.idea/

Expand Down
4 changes: 1 addition & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ version: 2

build:
os: ubuntu-24.04
tools:
python: "3.12"
commands:
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain none --profile minimal
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
- . "$HOME/.cargo/env" && uv run --no-dev --group docs --frozen -v make BUILDDIR="$READTHEDOCS_OUTPUT" O="-T" -C docs html
- . "$HOME/.cargo/env" && uv run --no-dev --group docs --frozen -v make BUILDDIR="$READTHEDOCS_OUTPUT" O="-T" -C python/docs html
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Docs are hosted on [Read the Docs](http://bosing.readthedocs.io/)

## Usage

Examples can be found in `examples`.
Examples can be found in `python/examples`.

```python
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -46,7 +46,7 @@ plt.show()

## Performance

`examples/schedule_stress.py` (0.15 s) vs `benches/naive.py` (1.4 s)
`python/examples/schedule_stress.py` (0.15 s) vs `python/benches/naive.py` (1.4 s)

CPU: AMD Ryzen 5 5600

Expand Down
39 changes: 9 additions & 30 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Issues = "https://github.com/kahojyun/Bosing/issues"
Source = "https://github.com/kahojyun/Bosing"

[tool.maturin]
python-source = "python"
python-source = "python/src"
module-name = "bosing._bosing"
manifest-path = "bosing-py/Cargo.toml"
features = ["pyo3/extension-module"]
Expand Down Expand Up @@ -69,39 +69,18 @@ test = "task test_py && task test_rs"
test_py = "pytest"
test_rs = "cargo test --workspace"
stubtest = "stubtest bosing --allowlist stubtest-allowlist.txt"
makedocs = "sphinx-build -M html docs docs/_build"
cleandocs = "sphinx-build -M clean docs docs/_build && rm -r docs/generated"
makedocs = "sphinx-build -M html python/docs python/docs/_build"
cleandocs = "sphinx-build -M clean python/docs python/docs/_build && rm -r python/docs/generated"

[tool.ruff.lint]
select = ["ALL"]
ignore = [
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"COM812", # Missing trailing comma
"ISC001", # implicit string concatenation
]
[tool.ruff.lint.per-file-ignores]
"{examples,benches}/*.py" = [
"T201", # Use of print
]
"tests/*.py" = [
"S101", # Use of assert
]
"!python/*.py" = [
"I002", # Missing required imports
"D", # Dosctring
"INP001", # Implicit namespace package
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.isort]
known-first-party = ["bosing"]
required-imports = ["from __future__ import annotations"]
[tool.pytest.ini_options]
testpaths = ["python/tests"]
addopts = "--import-mode=importlib"

[tool.basedpyright]
include = ["examples", "tests", "docs", "benches", "python"]
exclude = ["**/node_modules", "**/__pycache__", "docs/_build"]
include = ["python"]
exclude = ["**/node_modules", "**/__pycache__", "**/docs/_build"]
[[tool.basedpyright.executionEnvironments]]
root = "examples"
root = "python/examples"
reportAny = "none"
reportMissingTypeStubs = "none"
reportUnknownArgumentType = "none"
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions python/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_build/
generated/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions python/ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[lint]
select = ["ALL"]
ignore = [
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"COM812", # Missing trailing comma
"ISC001", # implicit string concatenation
]
[lint.per-file-ignores]
"{examples,benches}/**/*.py" = [
"T201", # Use of print
]
"tests/**/*.py" = [
"S101", # Use of assert
]
"!src/**/*.py" = [
"I002", # Missing required imports
"D", # Dosctring
"INP001", # Implicit namespace package
]
[lint.pydocstyle]
convention = "google"
[lint.isort]
known-first-party = ["bosing"]
required-imports = ["from __future__ import annotations"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.