tree-sitter-muttrc 0.0.2 → 0.0.3

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.
package/CMakeLists.txt CHANGED
@@ -5,27 +5,32 @@ if(NOT VERSION)
5
5
  endif()
6
6
  if(ENV{GITHUB_REPOSITORY})
7
7
  set(HOMEPAGE_URL "https://github.com/$ENV{GITHUB_REPOSITORY}")
8
- string(REGEX REPLACE ".*/tree-sitter-([^/]*)$" "\\1" LANGUAGE $ENV{GITHUB_REPOSITORY})
8
+ string(REGEX REPLACE ".*/tree-sitter-([^/]*)$" "\\1" NAME $ENV{GITHUB_REPOSITORY})
9
9
  else()
10
10
  set(HOMEPAGE_URL "")
11
- file(GLOB LANGUAGE "${CMAKE_CURRENT_SOURCE_DIR}/bindings/python/*")
12
- string(REGEX REPLACE ".*/tree_sitter_([^/]*)$" "\\1" LANGUAGE ${LANGUAGE})
11
+ file(GLOB NAME "${CMAKE_CURRENT_SOURCE_DIR}/bindings/python/*")
12
+ string(REGEX REPLACE ".*/tree_sitter_([^/]*)$" "\\1" NAME ${NAME})
13
13
  endif()
14
14
  project(
15
- tree-sitter-${LANGUAGE}
15
+ tree-sitter-${NAME}
16
16
  VERSION ${VERSION}
17
- DESCRIPTION tree-sitter-${LANGUAGE}
17
+ DESCRIPTION tree-sitter-${NAME}
18
18
  HOMEPAGE_URL "${HOMEPAGE_URL}")
19
19
  include_directories(src)
20
- add_library(${LANGUAGE} SHARED src/parser.c)
21
- set_target_properties(${LANGUAGE} PROPERTIES PREFIX "")
20
+ add_library(${NAME} SHARED src/parser.c)
21
+ set_target_properties(${NAME} PROPERTIES PREFIX "")
22
22
  if(DEFINED SKBUILD_DATA_DIR)
23
23
  set(CMAKE_INSTALL_FULL_LIBDIR ${SKBUILD_DATA_DIR}/lib)
24
24
  endif()
25
+ # https://docs.python.org/3/library/ctypes.html#finding-shared-libraries
26
+ if(DEFINED SKBUILD_PLATLIB_DIR)
27
+ # it may be better to determine the shared library name at development time, and hardcode that into the wrapper module
28
+ configure_file(__init__.py.in ${SKBUILD_PLATLIB_DIR}/tree_sitter_${NAME}/__init__.py)
29
+ endif()
25
30
  if(NOT DEFINED CMAKE_INSTALL_FULL_LIBDIR)
26
31
  include(GNUInstallDirs)
27
32
  endif()
28
- install(TARGETS ${LANGUAGE} DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/parser)
33
+ install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/parser)
29
34
 
30
35
  set(CPACK_PACKAGE_CONTACT ${HOMEPAGE_URL}/issues)
31
36
  set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Wu Zhenyu <wuzhenyu@ustc.edu>")
package/Cargo.toml CHANGED
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  name = "tree-sitter-muttrc"
3
3
  description = "muttrc grammar for the tree-sitter parsing library"
4
- version = "0.0.2"
4
+ version = "0.0.3"
5
5
  keywords = ["incremental", "parsing", "muttrc"]
6
6
  categories = ["parsing", "text-editors"]
7
7
  repository = "https://github.com/Freed-Wu/tree-sitter-muttrc"
@@ -7,18 +7,9 @@ import sysconfig
7
7
 
8
8
  from tree_sitter import Language, Parser
9
9
 
10
- from . import __name__ as NAME
11
-
12
- NAME = NAME.split("_")[-1]
13
- DLL = sysconfig.get_config_var("SHLIB_SUFFIX")
14
- if DLL is None:
15
- DLL = ".dll"
16
-
17
- try:
18
- from ._version import __version__, __version_tuple__ # type: ignore
19
- except ImportError: # for setuptools-generate
20
- __version__ = "rolling"
21
- __version_tuple__ = (0, 0, 0, __version__, "")
10
+ __version__ = "@VERSION@"
11
+ NAME = "@NAME@"
12
+ DLL = "@CMAKE_SHARED_LIBRARY_SUFFIX@"
22
13
 
23
14
  paths = [
24
15
  os.path.join(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tree-sitter-muttrc",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "muttrc grammar for tree-sitter",
5
5
  "main": "bindings/node",
6
6
  "keywords": [
package/pyproject.toml CHANGED
@@ -58,7 +58,7 @@ experimental = true
58
58
  provider = "scikit_build_core.metadata.setuptools_scm"
59
59
 
60
60
  [tool.scikit-build.sdist]
61
- include = ["bindings/python/tree_sitter_muttrc/_version.py", "py.typed"]
61
+ include = ["py.typed"]
62
62
 
63
63
  [tool.scikit-build.wheel]
64
64
  packages = ["bindings/python/tree_sitter_muttrc"]
@@ -72,7 +72,6 @@ file = "requirements/dev.txt"
72
72
  # end: scripts/update-pyproject.toml.pl
73
73
 
74
74
  [tool.setuptools_scm]
75
- write_to = "bindings/python/tree_sitter_muttrc/_version.py"
76
75
 
77
76
  [tool.mdformat]
78
77
  number = true
@@ -119,6 +118,6 @@ exclude_lines = [
119
118
  archs = ["all"]
120
119
  skip = "*37-* *38-* *39-*"
121
120
  # https://github.com/pypa/cibuildwheel/issues/287#issuecomment-1937451870
122
- test-skip = "*-win32 *-macosx_*"
121
+ test-skip = "*-win32"
123
122
  before-test = "pip install -rrequirements.txt -rrequirements/dev.txt"
124
123
  test-command = "pytest {project}"