Skip to content

Commit

Permalink
feat: add typing info (#126)
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Jul 4, 2022
1 parent ac522ca commit f55e8e5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ recursive-exclude Ninja-src *

include versioneer.py
include src/ninja/_version.py
include src/ninja/__init__.pyi
include src/ninja/py.typed
14 changes: 6 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
"scikit-build>=0.12",
]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
build = "cp39-*"
before-all = [
"pipx install -f --pip-args=\"-c {project}/constraints-ci.txt\" cmake",
"cmake --version",
'pipx install -f --pip-args="-c {project}/constraints-ci.txt" cmake',
'cmake --version',
]
before-build = "pip install -r requirements-repair.txt"
repair-wheel-command = "python scripts/repair_wheel.py -w {dest_dir} {wheel}"
Expand All @@ -26,12 +25,11 @@ MACOSX_DEPLOYMENT_TARGET = "10.9"

[tool.cibuildwheel.windows]
before-all = [
"pipx install -f --pip-args=\"-c {project}/constraints-ci.txt\" cmake",
"cmake --version",
"pipx install -f --pip-args=\"-c {project}/constraints-ci.txt\" ninja",
"ninja --version",
'pipx install -f --pip-args="-c {project}/constraints-ci.txt" cmake',
'cmake --version',
'pipx install -f --pip-args="-c {project}/constraints-ci.txt" ninja',
'ninja --version',
]

[tool.isort]
profile = "black"
multi_line_output = 3
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def parse_requirements(filename):
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools'
'Typing :: Typed',
],

license='Apache 2.0',
Expand Down
10 changes: 10 additions & 0 deletions src/ninja/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from typing import Iterable, NoReturn

__version__ = tuple[int, int, int] | tuple[int, int, int, int | str]

DATA = str
BIN_DIR = str

def _program(name: str, args: Iterable[str]) -> int: ...

def ninja() -> NoReturn: ...
Empty file added src/ninja/py.typed
Empty file.

0 comments on commit f55e8e5

Please sign in to comment.