nmhit 0.1.1__tar.gz → 0.1.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.
- {nmhit-0.1.1 → nmhit-0.1.3}/.github/workflows/ci.yml +1 -1
- {nmhit-0.1.1 → nmhit-0.1.3}/.github/workflows/release.yml +1 -2
- {nmhit-0.1.1 → nmhit-0.1.3}/CMakeLists.txt +24 -11
- {nmhit-0.1.1 → nmhit-0.1.3}/PKG-INFO +1 -1
- {nmhit-0.1.1 → nmhit-0.1.3}/generated/Lexer.cpp +365 -82
- {nmhit-0.1.1 → nmhit-0.1.3}/generated/Lexer.h +234 -4
- {nmhit-0.1.1 → nmhit-0.1.3}/generated/Parser.cpp +3 -71
- {nmhit-0.1.1 → nmhit-0.1.3}/generated/Parser.h +4 -10
- {nmhit-0.1.1 → nmhit-0.1.3}/generated/location.hh +4 -8
- {nmhit-0.1.1 → nmhit-0.1.3}/pyproject.toml +7 -4
- {nmhit-0.1.1 → nmhit-0.1.3}/src/Lexer.l +4 -4
- {nmhit-0.1.1 → nmhit-0.1.3}/src/Node.cpp +2 -2
- {nmhit-0.1.1 → nmhit-0.1.3}/src/ParseDriver.h +4 -4
- {nmhit-0.1.1 → nmhit-0.1.3}/src/Parser.y +3 -3
- {nmhit-0.1.1 → nmhit-0.1.3}/tests/test_hit.cpp +46 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/.clang-format +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/.gitignore +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/.pre-commit-config.yaml +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/CONTRIBUTING.md +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/README.md +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/cmake/nmhit.pc.in +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/cmake/nmhitConfig.cmake.in +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/include/nmhit/BraceExpr.h +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/include/nmhit/Node.h +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/include/nmhit/TypeRegistry.h +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/include/nmhit/nmhit.h +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/python/nmhit/__init__.py +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/python/nmhit/py.typed +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/python/src/_nmhit.cpp +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/python/tests/test_nmhit.py +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/src/BraceExpr.cpp +0 -0
- {nmhit-0.1.1 → nmhit-0.1.3}/tests/CMakeLists.txt +0 -0
|
@@ -27,8 +27,7 @@ jobs:
|
|
|
27
27
|
- name: Build wheels
|
|
28
28
|
uses: pypa/cibuildwheel@v2.19
|
|
29
29
|
env:
|
|
30
|
-
|
|
31
|
-
CIBW_BUILD: "cp39-*"
|
|
30
|
+
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
|
|
32
31
|
CIBW_SKIP: "*-musllinux* *-manylinux_i686"
|
|
33
32
|
CIBW_ARCHS_LINUX: "x86_64 aarch64"
|
|
34
33
|
CIBW_ARCHS_MACOS: "x86_64 arm64"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
cmake_minimum_required(VERSION 3.
|
|
2
|
-
project
|
|
1
|
+
cmake_minimum_required(VERSION 3.20)
|
|
2
|
+
# Keep this version in sync with [project] version in pyproject.toml.
|
|
3
|
+
project(neml2-hit VERSION 0.1.3 LANGUAGES CXX)
|
|
3
4
|
|
|
4
5
|
set(CMAKE_CXX_STANDARD 17)
|
|
5
6
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
@@ -19,6 +20,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR NOT CMAKE_BUILD_TYPE)
|
|
|
19
20
|
src/Lexer.l
|
|
20
21
|
${CMAKE_CURRENT_BINARY_DIR}/Lexer.cpp
|
|
21
22
|
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/Lexer.h
|
|
23
|
+
COMPILE_FLAGS "--noline"
|
|
22
24
|
)
|
|
23
25
|
|
|
24
26
|
BISON_TARGET(
|
|
@@ -26,6 +28,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR NOT CMAKE_BUILD_TYPE)
|
|
|
26
28
|
src/Parser.y
|
|
27
29
|
${CMAKE_CURRENT_BINARY_DIR}/Parser.cpp
|
|
28
30
|
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/Parser.h
|
|
31
|
+
COMPILE_FLAGS "--no-lines"
|
|
29
32
|
)
|
|
30
33
|
|
|
31
34
|
ADD_FLEX_BISON_DEPENDENCY(HITLexer HITParser)
|
|
@@ -37,18 +40,23 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR NOT CMAKE_BUILD_TYPE)
|
|
|
37
40
|
set(_parser_include_dir ${CMAKE_CURRENT_BINARY_DIR})
|
|
38
41
|
|
|
39
42
|
# Helper target: copy freshly-generated files back to generated/ for committing.
|
|
43
|
+
# The sed step removes any residual #line directives (flex emits one before
|
|
44
|
+
# %top{} even with --noline) so no local filesystem paths leak into the repo.
|
|
45
|
+
set(_gen_dest ${CMAKE_CURRENT_SOURCE_DIR}/generated)
|
|
40
46
|
add_custom_target(update_generated
|
|
41
47
|
COMMAND ${CMAKE_COMMAND} -E copy
|
|
42
|
-
${
|
|
43
|
-
|
|
44
|
-
${
|
|
45
|
-
${
|
|
46
|
-
${
|
|
47
|
-
${
|
|
48
|
+
Lexer.cpp Lexer.h Parser.cpp Parser.h location.hh ${_gen_dest}/
|
|
49
|
+
COMMAND sed -i "/^#line /d"
|
|
50
|
+
${_gen_dest}/Lexer.cpp
|
|
51
|
+
${_gen_dest}/Lexer.h
|
|
52
|
+
${_gen_dest}/Parser.cpp
|
|
53
|
+
${_gen_dest}/Parser.h
|
|
54
|
+
${_gen_dest}/location.hh
|
|
55
|
+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
48
56
|
DEPENDS
|
|
49
57
|
${FLEX_HITLexer_OUTPUTS}
|
|
50
58
|
${BISON_HITParser_OUTPUTS}
|
|
51
|
-
COMMENT "
|
|
59
|
+
COMMENT "Stripping #line directives and copying generated parser/lexer files to generated/"
|
|
52
60
|
)
|
|
53
61
|
else()
|
|
54
62
|
set(_parser_sources
|
|
@@ -148,7 +156,13 @@ endif()
|
|
|
148
156
|
|
|
149
157
|
option(NMHIT_BUILD_PYTHON "Build Python bindings via nanobind" OFF)
|
|
150
158
|
if(NMHIT_BUILD_PYTHON)
|
|
151
|
-
|
|
159
|
+
# Per-version wheels: only Development.Module is needed here.
|
|
160
|
+
# When Python 3.12 becomes the project minimum, switch to a single abi3 wheel:
|
|
161
|
+
# - set wheel.py-api = "cp312" in pyproject.toml
|
|
162
|
+
# - add Development.SABIModule to this find_package call (requires CMake >= 3.26)
|
|
163
|
+
# - add STABLE_ABI back to nanobind_add_module below
|
|
164
|
+
# nanobind's STABLE_ABI silently no-ops below Python 3.12 (Py_LIMITED_API=0x030C0000).
|
|
165
|
+
find_package(Python 3.9 REQUIRED COMPONENTS Interpreter Development.Module)
|
|
152
166
|
|
|
153
167
|
# Locate nanobind's CMake integration through the Python interpreter.
|
|
154
168
|
# scikit-build-core installs nanobind into the build venv so it is findable
|
|
@@ -168,7 +182,6 @@ if(NMHIT_BUILD_PYTHON)
|
|
|
168
182
|
|
|
169
183
|
nanobind_add_module(
|
|
170
184
|
_nmhit
|
|
171
|
-
STABLE_ABI # Py_LIMITED_API=0x03090000: one .so covers Python 3.9+
|
|
172
185
|
NB_STATIC # embed nanobind runtime; wheel is self-contained
|
|
173
186
|
python/src/_nmhit.cpp
|
|
174
187
|
)
|