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

feat: add typing info #126

Merged
merged 1 commit into from
Jul 4, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.