Skip to content

Commit 32287b5

Browse files
adeebshihadehclaude
andcommitted
add proper Python packaging with pyproject.toml
Replace setup.py with pyproject.toml, add MANIFEST.in for source distribution, and export path constants from __init__.py for consumers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7fddc8e commit 32287b5

File tree

4 files changed

+35
-42
lines changed

4 files changed

+35
-42
lines changed

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
recursive-include rednose/helpers *.h *.cc *.pyx *.pxd
2+
recursive-include rednose/templates *
3+
include rednose/helpers/chi2_lookup_table.npy

pyproject.toml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
# https://beta.ruff.rs/docs/configuration/#using-pyprojecttoml
2-
[tool.ruff]
3-
line-length = 160
4-
target-version="py311"
1+
[project]
2+
name = "rednose"
3+
version = "0.1.0"
4+
description = "Kalman filter library"
5+
requires-python = ">=3.11,<3.13"
6+
license = {text = "MIT"}
7+
authors = [{name = "comma.ai"}]
8+
dependencies = [
9+
"numpy",
10+
"cffi",
11+
"sympy",
12+
"scons",
13+
"Cython",
14+
]
515

6-
[tool.ruff.lint]
7-
select = ["E", "F", "W", "PIE", "C4", "ISC", "RUF100", "A"]
8-
ignore = ["W292", "E741", "E402", "C408", "ISC003"]
9-
flake8-implicit-str-concat.allow-multiline=false
16+
[project.optional-dependencies]
17+
dev = ["scipy", "pytest", "pytest-xdist", "ruff"]
1018

11-
[tool.ruff.lint.flake8-tidy-imports.banned-api]
12-
"pytest.main".msg = "pytest.main requires special handling that is easy to mess up!"
13-
"unittest".msg = "Use pytest"
19+
[build-system]
20+
requires = ["setuptools"]
21+
build-backend = "setuptools.build_meta"
1422

15-
[tool.pytest.ini_options]
16-
addopts = "--durations=10 -n auto"
23+
[tool.setuptools]
24+
include-package-data = true
25+
26+
[tool.setuptools.package-data]
27+
"rednose.helpers" = ["chi2_lookup_table.npy", "*.h", "*.cc", "*.pyx", "*.pxd"]
28+
"rednose.templates" = ["*"]

rednose/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import os
2+
3+
BASEDIR = os.path.dirname(os.path.abspath(__file__))
4+
HELPERS_PATH = os.path.join(BASEDIR, "helpers")
5+
TEMPLATE_DIR = os.path.join(BASEDIR, "templates")
6+
# For consumers that need the parent dir in include paths
7+
INCLUDE_PATH = os.path.abspath(os.path.join(BASEDIR, "../"))

setup.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)