clangquill 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- clangquill-0.0.3/.editorconfig +24 -0
- clangquill-0.0.3/.gitattributes +5 -0
- clangquill-0.0.3/.gitignore +109 -0
- clangquill-0.0.3/.markdown_link_check_config.json +8 -0
- clangquill-0.0.3/.pre-commit-config.yaml +46 -0
- clangquill-0.0.3/.readthedocs.yml +14 -0
- clangquill-0.0.3/AUTHORS.md +4 -0
- clangquill-0.0.3/CMakeLists.txt +47 -0
- clangquill-0.0.3/CONTRIBUTING.md +112 -0
- clangquill-0.0.3/LICENSE +24 -0
- clangquill-0.0.3/MANIFEST.in +15 -0
- clangquill-0.0.3/Makefile +20 -0
- clangquill-0.0.3/PKG-INFO +79 -0
- clangquill-0.0.3/README.md +47 -0
- clangquill-0.0.3/cmake/FindLibClang.cmake +58 -0
- clangquill-0.0.3/docs/.gitignore +2 -0
- clangquill-0.0.3/docs/Makefile +20 -0
- clangquill-0.0.3/docs/_static/.git.keep.dir +0 -0
- clangquill-0.0.3/docs/authors.md +2 -0
- clangquill-0.0.3/docs/conf.py +186 -0
- clangquill-0.0.3/docs/contributing.md +2 -0
- clangquill-0.0.3/docs/development/adr-0001-libclang-sourcing.md +103 -0
- clangquill-0.0.3/docs/development/index.md +9 -0
- clangquill-0.0.3/docs/examples/basic.md +29 -0
- clangquill-0.0.3/docs/index.md +21 -0
- clangquill-0.0.3/docs/installation.md +56 -0
- clangquill-0.0.3/docs/make.bat +36 -0
- clangquill-0.0.3/docs/readme.md +2 -0
- clangquill-0.0.3/docs/substitutions.py +51 -0
- clangquill-0.0.3/docs/usage.md +14 -0
- clangquill-0.0.3/pyproject.toml +78 -0
- clangquill-0.0.3/src/clangquill/__init__.py +13 -0
- clangquill-0.0.3/src/clangquill/cli.py +18 -0
- clangquill-0.0.3/src/clangquill/tools.py +1 -0
- clangquill-0.0.3/src/cpp/bindings/module.cpp +52 -0
- clangquill-0.0.3/src/cpp/core/version.hpp +11 -0
- clangquill-0.0.3/tests/__init__.py +1 -0
- clangquill-0.0.3/tests/conftest.py +9 -0
- clangquill-0.0.3/tests/fixtures.py +1 -0
- clangquill-0.0.3/tests/test_clangquill.py +25 -0
- clangquill-0.0.3/tests/test_core.py +20 -0
- clangquill-0.0.3/uv.lock +1612 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# http://editorconfig.org
|
|
2
|
+
|
|
3
|
+
root = true
|
|
4
|
+
|
|
5
|
+
[*]
|
|
6
|
+
indent_style = space
|
|
7
|
+
indent_size = 4
|
|
8
|
+
trim_trailing_whitespace = true
|
|
9
|
+
insert_final_newline = true
|
|
10
|
+
charset = utf-8
|
|
11
|
+
end_of_line = lf
|
|
12
|
+
|
|
13
|
+
[*.{yaml,yml}]
|
|
14
|
+
indent_size = 2
|
|
15
|
+
|
|
16
|
+
[*.bat]
|
|
17
|
+
indent_style = tab
|
|
18
|
+
end_of_line = crlf
|
|
19
|
+
|
|
20
|
+
[LICENSE]
|
|
21
|
+
insert_final_newline = false
|
|
22
|
+
|
|
23
|
+
[Makefile]
|
|
24
|
+
indent_style = tab
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
env/
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
|
|
28
|
+
# PyInstaller
|
|
29
|
+
# Usually these files are written by a python script from a template
|
|
30
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
31
|
+
*.manifest
|
|
32
|
+
*.spec
|
|
33
|
+
|
|
34
|
+
# Installer logs
|
|
35
|
+
pip-log.txt
|
|
36
|
+
pip-delete-this-directory.txt
|
|
37
|
+
|
|
38
|
+
# Unit test / coverage reports
|
|
39
|
+
htmlcov/
|
|
40
|
+
.tox/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
.cache
|
|
44
|
+
nosetests.xml
|
|
45
|
+
coverage.xml
|
|
46
|
+
*.cover
|
|
47
|
+
.hypothesis/
|
|
48
|
+
.pytest_cache/
|
|
49
|
+
|
|
50
|
+
# Translations
|
|
51
|
+
*.mo
|
|
52
|
+
*.pot
|
|
53
|
+
|
|
54
|
+
# Django stuff:
|
|
55
|
+
*.log
|
|
56
|
+
local_settings.py
|
|
57
|
+
|
|
58
|
+
# Flask stuff:
|
|
59
|
+
instance/
|
|
60
|
+
.webassets-cache
|
|
61
|
+
|
|
62
|
+
# Scrapy stuff:
|
|
63
|
+
.scrapy
|
|
64
|
+
|
|
65
|
+
# Sphinx documentation
|
|
66
|
+
docs/_build/
|
|
67
|
+
|
|
68
|
+
# PyBuilder
|
|
69
|
+
target/
|
|
70
|
+
|
|
71
|
+
# Jupyter Notebook
|
|
72
|
+
.ipynb_checkpoints
|
|
73
|
+
|
|
74
|
+
# pyenv
|
|
75
|
+
.python-version
|
|
76
|
+
|
|
77
|
+
# celery beat schedule file
|
|
78
|
+
celerybeat-schedule
|
|
79
|
+
|
|
80
|
+
# SageMath parsed files
|
|
81
|
+
*.sage.py
|
|
82
|
+
|
|
83
|
+
# dotenv
|
|
84
|
+
.env
|
|
85
|
+
|
|
86
|
+
# virtualenv
|
|
87
|
+
.venv
|
|
88
|
+
venv/
|
|
89
|
+
ENV/
|
|
90
|
+
|
|
91
|
+
# Spyder project settings
|
|
92
|
+
.spyderproject
|
|
93
|
+
.spyproject
|
|
94
|
+
|
|
95
|
+
# Rope project settings
|
|
96
|
+
.ropeproject
|
|
97
|
+
|
|
98
|
+
# mkdocs documentation
|
|
99
|
+
/site
|
|
100
|
+
|
|
101
|
+
# mypy
|
|
102
|
+
.mypy_cache/
|
|
103
|
+
|
|
104
|
+
# IDE settings
|
|
105
|
+
.vscode/.idea
|
|
106
|
+
.idea
|
|
107
|
+
|
|
108
|
+
# hatch-vcs generated version file
|
|
109
|
+
src/clangquill/_version.py
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
# See https://pre-commit.com for more information
|
|
3
|
+
# See https://pre-commit.com/hooks.html for more hooks
|
|
4
|
+
repos:
|
|
5
|
+
- repo: https://github.com/lyz-code/yamlfix/
|
|
6
|
+
rev: 1.16.0
|
|
7
|
+
hooks:
|
|
8
|
+
- id: yamlfix
|
|
9
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
10
|
+
rev: v0.9.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: ruff
|
|
13
|
+
- id: ruff-format
|
|
14
|
+
# The markdown-link-check can't access internal or private repos, see
|
|
15
|
+
# .markdown_link_check_config.json on how to exclude more than the
|
|
16
|
+
# github.com/arup-group
|
|
17
|
+
- repo: https://github.com/tcort/markdown-link-check
|
|
18
|
+
rev: v3.11.2
|
|
19
|
+
hooks:
|
|
20
|
+
- id: markdown-link-check
|
|
21
|
+
args: [--quiet, --config=.markdown_link_check_config.json]
|
|
22
|
+
- repo: https://github.com/rhysd/actionlint
|
|
23
|
+
rev: v1.6.26
|
|
24
|
+
hooks:
|
|
25
|
+
- id: actionlint
|
|
26
|
+
# this should go last since it will fix line endings broken by other tools
|
|
27
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
28
|
+
rev: v4.5.0
|
|
29
|
+
hooks:
|
|
30
|
+
- id: trailing-whitespace
|
|
31
|
+
# The pre-commit check on CI detects some whitespace changes if we include .github
|
|
32
|
+
exclude: .github
|
|
33
|
+
- id: check-added-large-files
|
|
34
|
+
- id: check-case-conflict
|
|
35
|
+
- id: mixed-line-ending
|
|
36
|
+
args: [--fix=lf]
|
|
37
|
+
- id: end-of-file-fixer
|
|
38
|
+
- id: check-yaml
|
|
39
|
+
- id: check-xml
|
|
40
|
+
- id: check-json
|
|
41
|
+
- id: pretty-format-json
|
|
42
|
+
args: [--autofix, --no-sort-keys, --indent=4]
|
|
43
|
+
exclude: .*\.ipynb$
|
|
44
|
+
- id: check-symlinks
|
|
45
|
+
- id: debug-statements
|
|
46
|
+
- id: fix-byte-order-marker
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.26...3.29)
|
|
2
|
+
|
|
3
|
+
project(
|
|
4
|
+
clangquill
|
|
5
|
+
LANGUAGES CXX
|
|
6
|
+
DESCRIPTION "libclang -> Sphinx MyST API-docs generator core")
|
|
7
|
+
|
|
8
|
+
set(CMAKE_CXX_STANDARD 20)
|
|
9
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
10
|
+
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
11
|
+
|
|
12
|
+
# --- Python + nanobind -------------------------------------------------------
|
|
13
|
+
# scikit-build-core puts the right Python here; find nanobind via its pip wheel.
|
|
14
|
+
find_package(Python 3.11 REQUIRED COMPONENTS Interpreter Development.Module)
|
|
15
|
+
|
|
16
|
+
execute_process(
|
|
17
|
+
COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir
|
|
18
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
19
|
+
OUTPUT_VARIABLE nanobind_ROOT
|
|
20
|
+
COMMAND_ERROR_IS_FATAL ANY)
|
|
21
|
+
find_package(nanobind CONFIG REQUIRED)
|
|
22
|
+
|
|
23
|
+
# --- Optional libclang -------------------------------------------------------
|
|
24
|
+
# CLANGQUILL_WITH_LIBCLANG: ON | OFF | AUTO (default). When ON/AUTO and libclang
|
|
25
|
+
# is found, the core links it and CLANGQUILL_HAVE_LIBCLANG is defined. This keeps
|
|
26
|
+
# M1 (build system) independent of the libclang-sourcing spike (#4).
|
|
27
|
+
set(CLANGQUILL_WITH_LIBCLANG "AUTO" CACHE STRING "Link libclang: ON, OFF or AUTO")
|
|
28
|
+
include(cmake/FindLibClang.cmake)
|
|
29
|
+
|
|
30
|
+
# --- Core extension ----------------------------------------------------------
|
|
31
|
+
nanobind_add_module(
|
|
32
|
+
_core
|
|
33
|
+
STABLE_ABI
|
|
34
|
+
NB_STATIC
|
|
35
|
+
src/cpp/bindings/module.cpp)
|
|
36
|
+
|
|
37
|
+
target_include_directories(_core PRIVATE src/cpp)
|
|
38
|
+
|
|
39
|
+
if(CLANGQUILL_LIBCLANG_FOUND)
|
|
40
|
+
target_link_libraries(_core PRIVATE clangquill::libclang)
|
|
41
|
+
target_compile_definitions(_core PRIVATE CLANGQUILL_HAVE_LIBCLANG=1)
|
|
42
|
+
message(STATUS "clangquill: building WITH libclang")
|
|
43
|
+
else()
|
|
44
|
+
message(STATUS "clangquill: building WITHOUT libclang (stub backend)")
|
|
45
|
+
endif()
|
|
46
|
+
|
|
47
|
+
install(TARGETS _core LIBRARY DESTINATION clangquill)
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
```{highlight} shell
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
|
|
5
|
+
# Contributing
|
|
6
|
+
|
|
7
|
+
Contributions are welcome, and they are greatly appreciated! Every little bit
|
|
8
|
+
helps, and credit will always be given.
|
|
9
|
+
|
|
10
|
+
You can contribute in many ways:
|
|
11
|
+
|
|
12
|
+
## Types of Contributions
|
|
13
|
+
|
|
14
|
+
### Report Bugs
|
|
15
|
+
|
|
16
|
+
Report bugs at <https://github.com/renefritze/clangquill/issues>.
|
|
17
|
+
|
|
18
|
+
If you are reporting a bug, please include:
|
|
19
|
+
|
|
20
|
+
* Your operating system name and version.
|
|
21
|
+
* Any details about your local setup that might be helpful in troubleshooting.
|
|
22
|
+
* Detailed steps to reproduce the bug.
|
|
23
|
+
|
|
24
|
+
### Fix Bugs
|
|
25
|
+
|
|
26
|
+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
|
|
27
|
+
wanted" is open to whoever wants to implement it.
|
|
28
|
+
|
|
29
|
+
### Implement Features
|
|
30
|
+
|
|
31
|
+
Look through the GitHub issues for features. Anything tagged with "enhancement"
|
|
32
|
+
and "help wanted" is open to whoever wants to implement it.
|
|
33
|
+
|
|
34
|
+
### Write Documentation
|
|
35
|
+
|
|
36
|
+
clangquill could always use more documentation, whether as part of the
|
|
37
|
+
official clangquill docs, in docstrings, or even on the web in blog posts,
|
|
38
|
+
articles, and such.
|
|
39
|
+
|
|
40
|
+
### Submit Feedback
|
|
41
|
+
|
|
42
|
+
The best way to send feedback is to file an issue at <https://github.com/renefritze/clangquill/issues>.
|
|
43
|
+
|
|
44
|
+
If you are proposing a feature:
|
|
45
|
+
|
|
46
|
+
* Explain in detail how it would work.
|
|
47
|
+
* Keep the scope as narrow as possible, to make it easier to implement.
|
|
48
|
+
* Remember that this is a volunteer-driven project, and that contributions
|
|
49
|
+
are welcome :)
|
|
50
|
+
|
|
51
|
+
## Get Started!
|
|
52
|
+
|
|
53
|
+
Ready to contribute? Here's how to set up {}`clangquill` for local development.
|
|
54
|
+
|
|
55
|
+
1. Fork the {}`clangquill` repo on GitHub.
|
|
56
|
+
2. Clone your fork locally:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
$ git clone https://github.com/renefritze/clangquill
|
|
60
|
+
```
|
|
61
|
+
3. Install your local copy into a virtualenv:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
$ cd clangquill/
|
|
65
|
+
$ python3 -m venv venv
|
|
66
|
+
$ source venv/bin/activate
|
|
67
|
+
$ python3 -m pip install .[dev]
|
|
68
|
+
```
|
|
69
|
+
4. Create a branch for local development:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
$ git checkout -b name-of-your-bugfix-or-feature
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Now you can make your changes locally.
|
|
76
|
+
5. Make sure you have pre-commit installed and activated:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
$ pre-commit install
|
|
80
|
+
$ pre-commit run --all-files
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
6. Commit your changes and push your branch to GitHub:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
$ git add .
|
|
87
|
+
$ git commit -m "Your detailed description of your changes."
|
|
88
|
+
$ git push origin name-of-your-bugfix-or-feature
|
|
89
|
+
```
|
|
90
|
+
7. Submit a pull request through the GitHub website.
|
|
91
|
+
|
|
92
|
+
## Pull Request Guidelines
|
|
93
|
+
|
|
94
|
+
Before you submit a pull request, check that it meets these guidelines:
|
|
95
|
+
|
|
96
|
+
1. The pull request should include tests.
|
|
97
|
+
2. If the pull request adds functionality, the docs should be updated. Put
|
|
98
|
+
your new functionality into a function with a docstring, and add the
|
|
99
|
+
feature to the list in README.rst.
|
|
100
|
+
3. The pull request should work for multiple Python versions.
|
|
101
|
+
|
|
102
|
+
## Tips
|
|
103
|
+
|
|
104
|
+
To run a subset of tests:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
$ pytest tests.test_clangquill
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Deploying
|
|
111
|
+
|
|
112
|
+
TBD
|
clangquill-0.0.3/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
BSD 2-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, René Fritze
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
16
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
17
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
18
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
19
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
20
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
21
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
22
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
23
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
24
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
include AUTHORS.md
|
|
2
|
+
include CONTRIBUTING.md
|
|
3
|
+
include LICENSE
|
|
4
|
+
include README.md
|
|
5
|
+
|
|
6
|
+
recursive-include tests *
|
|
7
|
+
recursive-exclude * __pycache__
|
|
8
|
+
recursive-exclude * *.py[co]
|
|
9
|
+
|
|
10
|
+
recursive-include docs *.rst *.md conf.py Makefile make.bat *.jpg *.png *.gif
|
|
11
|
+
|
|
12
|
+
# The C++ core is needed to build the extension from an sdist.
|
|
13
|
+
include CMakeLists.txt
|
|
14
|
+
recursive-include cmake *.cmake
|
|
15
|
+
recursive-include src/cpp *.cpp *.hpp
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env make
|
|
2
|
+
|
|
3
|
+
# this loads $(ENV_FILE) as both makefile variables and into shell env
|
|
4
|
+
ENV_FILE?=.env
|
|
5
|
+
ifneq ($(wildcard $(ENV_FILE)),)
|
|
6
|
+
include $(ENV_FILE)
|
|
7
|
+
export $(shell sed 's/=.*//' $(ENV_FILE))
|
|
8
|
+
endif
|
|
9
|
+
|
|
10
|
+
.PHONY: deps format docs
|
|
11
|
+
|
|
12
|
+
deps:
|
|
13
|
+
./dependencies.py
|
|
14
|
+
|
|
15
|
+
format:
|
|
16
|
+
ruff format .
|
|
17
|
+
ruff check --fix .
|
|
18
|
+
|
|
19
|
+
docs:
|
|
20
|
+
make -C docs html
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: clangquill
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: Parse Doxygen-documented C++ with libclang and generate MyST Markdown API docs for Sphinx
|
|
5
|
+
Author-Email: clangquill <rene@fritze.me>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
7
|
+
Project-URL: Documentation, https://github.com/renefritze/clangquill
|
|
8
|
+
Project-URL: Source, https://github.com/renefritze/clangquill
|
|
9
|
+
Requires-Python: >=3.13
|
|
10
|
+
Requires-Dist: rich
|
|
11
|
+
Requires-Dist: packaging
|
|
12
|
+
Requires-Dist: typer
|
|
13
|
+
Requires-Dist: click
|
|
14
|
+
Provides-Extra: docs
|
|
15
|
+
Requires-Dist: sphinx>=6; extra == "docs"
|
|
16
|
+
Requires-Dist: sphinx-autoapi>=3; extra == "docs"
|
|
17
|
+
Requires-Dist: myst-nb>=0.18; extra == "docs"
|
|
18
|
+
Requires-Dist: furo>=2023.9.10; extra == "docs"
|
|
19
|
+
Provides-Extra: ci
|
|
20
|
+
Requires-Dist: pytest; extra == "ci"
|
|
21
|
+
Requires-Dist: pytest-cov; extra == "ci"
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: ty; extra == "dev"
|
|
24
|
+
Requires-Dist: ruff; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest-pycharm; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-regressions; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-datadir; extra == "dev"
|
|
30
|
+
Requires-Dist: clangquill[docs]; extra == "dev"
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
clangquill
|
|
34
|
+
=========
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
[](https://github.com/renefritze/clangquill/actions)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
Parse Doxygen-documented C++ with libclang and generate MyST Markdown API docs for Sphinx
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
Features
|
|
44
|
+
--------
|
|
45
|
+
|
|
46
|
+
- TODO
|
|
47
|
+
|
|
48
|
+
Building from source
|
|
49
|
+
--------------------
|
|
50
|
+
|
|
51
|
+
`clangquill` ships a compiled C++ core (`clangquill._core`) built with
|
|
52
|
+
[scikit-build-core](https://scikit-build-core.readthedocs.io/), CMake and
|
|
53
|
+
[nanobind](https://nanobind.readthedocs.io/). A standard install builds it:
|
|
54
|
+
|
|
55
|
+
```console
|
|
56
|
+
$ pip install .
|
|
57
|
+
$ python -c "from clangquill import _core; print(_core.have_libclang())"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The core optionally links **libclang**; when `libclang-dev` (or an LLVM prefix
|
|
61
|
+
via `LibClang_ROOT`) is available at build time the extraction backend is
|
|
62
|
+
enabled. Pass `-DCLANGQUILL_WITH_LIBCLANG=ON` to require it.
|
|
63
|
+
|
|
64
|
+
After generating your project
|
|
65
|
+
-----------------------------
|
|
66
|
+
|
|
67
|
+
- setup branch protection+automerge in [github project settings](https://github.com/renefritze/clangquill/settings/branches)
|
|
68
|
+
- request install for the codecov.io app in [github project settings](https://github.com/renefritze/clangquill/settings/installations)
|
|
69
|
+
- configure codecov.io in [codecov.io settings](https://codecov.io/gh/renefritze/clangquill/settings)
|
|
70
|
+
- add the `CODECOV_TOKEN` secret in [github project settings](https://github.com/renefritze/clangquill/settings/secrets/actions)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
Credits
|
|
74
|
+
-------
|
|
75
|
+
|
|
76
|
+
This package was created with
|
|
77
|
+
[Cookiecutter](https://github.com/audreyr/cookiecutter) and the
|
|
78
|
+
[renefritze/python_cookiecutter](https://github.com/renefritze/python_cookiecutter)
|
|
79
|
+
project template.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
clangquill
|
|
2
|
+
=========
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
[](https://github.com/renefritze/clangquill/actions)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Parse Doxygen-documented C++ with libclang and generate MyST Markdown API docs for Sphinx
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
Features
|
|
12
|
+
--------
|
|
13
|
+
|
|
14
|
+
- TODO
|
|
15
|
+
|
|
16
|
+
Building from source
|
|
17
|
+
--------------------
|
|
18
|
+
|
|
19
|
+
`clangquill` ships a compiled C++ core (`clangquill._core`) built with
|
|
20
|
+
[scikit-build-core](https://scikit-build-core.readthedocs.io/), CMake and
|
|
21
|
+
[nanobind](https://nanobind.readthedocs.io/). A standard install builds it:
|
|
22
|
+
|
|
23
|
+
```console
|
|
24
|
+
$ pip install .
|
|
25
|
+
$ python -c "from clangquill import _core; print(_core.have_libclang())"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The core optionally links **libclang**; when `libclang-dev` (or an LLVM prefix
|
|
29
|
+
via `LibClang_ROOT`) is available at build time the extraction backend is
|
|
30
|
+
enabled. Pass `-DCLANGQUILL_WITH_LIBCLANG=ON` to require it.
|
|
31
|
+
|
|
32
|
+
After generating your project
|
|
33
|
+
-----------------------------
|
|
34
|
+
|
|
35
|
+
- setup branch protection+automerge in [github project settings](https://github.com/renefritze/clangquill/settings/branches)
|
|
36
|
+
- request install for the codecov.io app in [github project settings](https://github.com/renefritze/clangquill/settings/installations)
|
|
37
|
+
- configure codecov.io in [codecov.io settings](https://codecov.io/gh/renefritze/clangquill/settings)
|
|
38
|
+
- add the `CODECOV_TOKEN` secret in [github project settings](https://github.com/renefritze/clangquill/settings/secrets/actions)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
Credits
|
|
42
|
+
-------
|
|
43
|
+
|
|
44
|
+
This package was created with
|
|
45
|
+
[Cookiecutter](https://github.com/audreyr/cookiecutter) and the
|
|
46
|
+
[renefritze/python_cookiecutter](https://github.com/renefritze/python_cookiecutter)
|
|
47
|
+
project template.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Locate libclang (the C API) and expose it as the imported target
|
|
2
|
+
# clangquill::libclang plus the cache variable CLANGQUILL_LIBCLANG_FOUND.
|
|
3
|
+
#
|
|
4
|
+
# Honors CLANGQUILL_WITH_LIBCLANG (ON | OFF | AUTO):
|
|
5
|
+
# OFF - never look; build the stub backend.
|
|
6
|
+
# AUTO - look; build with libclang only if found (default, no hard failure).
|
|
7
|
+
# ON - look; fail the configure if it cannot be found.
|
|
8
|
+
#
|
|
9
|
+
# Discovery order: an explicit hint (LibClang_ROOT / llvm-config), then common
|
|
10
|
+
# system locations. The manylinux build wires this to a prebuilt LLVM (see #4).
|
|
11
|
+
|
|
12
|
+
set(CLANGQUILL_LIBCLANG_FOUND FALSE)
|
|
13
|
+
|
|
14
|
+
if(CLANGQUILL_WITH_LIBCLANG STREQUAL "OFF")
|
|
15
|
+
return()
|
|
16
|
+
endif()
|
|
17
|
+
|
|
18
|
+
# Allow an llvm-config to point us at the right prefix.
|
|
19
|
+
find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config llvm-config-18 llvm-config-17)
|
|
20
|
+
if(LLVM_CONFIG_EXECUTABLE)
|
|
21
|
+
execute_process(
|
|
22
|
+
COMMAND "${LLVM_CONFIG_EXECUTABLE}" --includedir
|
|
23
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE _llvm_incdir
|
|
24
|
+
ERROR_QUIET)
|
|
25
|
+
execute_process(
|
|
26
|
+
COMMAND "${LLVM_CONFIG_EXECUTABLE}" --libdir
|
|
27
|
+
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE _llvm_libdir
|
|
28
|
+
ERROR_QUIET)
|
|
29
|
+
endif()
|
|
30
|
+
|
|
31
|
+
find_path(
|
|
32
|
+
LibClang_INCLUDE_DIR
|
|
33
|
+
NAMES clang-c/Index.h
|
|
34
|
+
HINTS ${LibClang_ROOT} ${_llvm_incdir}
|
|
35
|
+
PATH_SUFFIXES include)
|
|
36
|
+
|
|
37
|
+
find_library(
|
|
38
|
+
LibClang_LIBRARY
|
|
39
|
+
NAMES clang libclang clang-18 clang-17
|
|
40
|
+
HINTS ${LibClang_ROOT} ${_llvm_libdir}
|
|
41
|
+
PATH_SUFFIXES lib lib64)
|
|
42
|
+
|
|
43
|
+
if(LibClang_INCLUDE_DIR AND LibClang_LIBRARY)
|
|
44
|
+
add_library(clangquill::libclang UNKNOWN IMPORTED)
|
|
45
|
+
set_target_properties(
|
|
46
|
+
clangquill::libclang PROPERTIES
|
|
47
|
+
IMPORTED_LOCATION "${LibClang_LIBRARY}"
|
|
48
|
+
INTERFACE_INCLUDE_DIRECTORIES "${LibClang_INCLUDE_DIR}")
|
|
49
|
+
set(CLANGQUILL_LIBCLANG_FOUND TRUE)
|
|
50
|
+
message(STATUS "clangquill: found libclang at ${LibClang_LIBRARY}")
|
|
51
|
+
elseif(CLANGQUILL_WITH_LIBCLANG STREQUAL "ON")
|
|
52
|
+
message(
|
|
53
|
+
FATAL_ERROR
|
|
54
|
+
"CLANGQUILL_WITH_LIBCLANG=ON but libclang was not found. "
|
|
55
|
+
"Install libclang-dev or set LibClang_ROOT to an LLVM prefix.")
|
|
56
|
+
else()
|
|
57
|
+
message(STATUS "clangquill: libclang not found; building stub backend")
|
|
58
|
+
endif()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line.
|
|
5
|
+
SPHINXOPTS = -W --keep-going
|
|
6
|
+
SPHINXBUILD = python -m sphinx
|
|
7
|
+
SPHINXPROJ = clangquill
|
|
8
|
+
SOURCEDIR = .
|
|
9
|
+
BUILDDIR = _build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
File without changes
|