-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
107 changed files
with
3,858 additions
and
2,233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
ea663c34775284590aef5cf1d087fc1840edb027 | ||
abb3085624a1e982f360086b73686b8b32e47087 | ||
abb3085624a1e982f360086b73686b8b32e47087 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,3 +206,6 @@ cython_debug/ | |
#.idea/ | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/c++,cmake,python | ||
|
||
|
||
tmp |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: "v4.3.0" | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: no-commit-to-branch | ||
|
||
- repo: local | ||
hooks: | ||
- id: black | ||
name: black | ||
entry: black | ||
language: python | ||
minimum_pre_commit_version: 2.9.2 | ||
require_serial: true | ||
types_or: [ python, pyi ] | ||
- id: isort | ||
name: isort | ||
entry: isort | ||
args: | ||
- --profile=black | ||
language: system | ||
types: [ python ] | ||
stages: [ commit ] | ||
- id: flake8 | ||
name: flake8 | ||
exclude: ^(tests|examples)/ | ||
language: system | ||
entry: flake8 | ||
args: | ||
# The line length in black | ||
- --max-line-length=88 | ||
- --extend-ignore=E203 | ||
types: [ python ] | ||
stages: [ commit ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Changelog | ||
========= | ||
|
||
Version 1.0-dev (Aug 29, 2023) | ||
-------------------------- | ||
⚠️ Project was rewritten from scratch for `1.x`. This allowed me to address some long-standing issues, but I might accidentally brake behaviour you relied on. | ||
|
||
Changes: | ||
- Updated CLI interface, some options were removed, please see `pybind11-stubgen --help` for details | ||
- Replaced regex-based signature parsing with more robust procedure which enables to produce partially degraded signatures | ||
- Added type parsing/replacing, including deeply annotated types | ||
- Support implicit imports required for static analysis | ||
- Add introspection of pure python functions | ||
- Support python 3.10+ only (temporarily) | ||
- Improved structure of test binary pybind module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[![pypi](https://img.shields.io/pypi/v/pybind11-stubgen.svg?logo=PyPI&logoColor=white)](https://pypi.org/project/pybind11-stubgen/) | ||
|
||
About | ||
---- | ||
|
||
Static analysis tools and IDE usually struggle to understand python binary extensions. | ||
`pybind11-stubgen` generates [stubs](https://peps.python.org/pep-0561/) for python extensions to make them less opaque. | ||
|
||
While the CLI tool includes tweaks to target modules compiled specifically | ||
with [pybind11](https://github.com/pybind/pybind11) but it should work well with modules built with other libraries. | ||
|
||
```bash | ||
# Install | ||
pip install pybind11-stubgen | ||
|
||
# Generate stubs for numpy | ||
pybind11-stubgen numpy | ||
``` | ||
|
||
Usage | ||
----- | ||
|
||
``` | ||
pybind11-stubgen [-h] | ||
[-o OUTPUT_DIR] | ||
[--root-suffix ROOT_SUFFIX] | ||
[--ignore-invalid-expressions REGEX] | ||
[--ignore-invalid-identifiers REGEX] | ||
[--ignore-unresolved-names REGEX] | ||
[--ignore-all-errors] | ||
[--numpy-array-wrap-with-annotated-fixed-size| --numpy-array-remove-parameters] | ||
[--print-invalid-expressions-as-is] | ||
[--exit-code] | ||
MODULE_NAME | ||
``` | ||
|
||
Customization | ||
------------- | ||
|
||
The configuration built into the CLI tool should suffice most of the use cases. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.