omdev 0.0.0.dev463__py3-none-any.whl → 0.0.0.dev465__py3-none-any.whl

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.

Potentially problematic release.


This version of omdev might be problematic. Click here for more details.

omdev/pyproject/cexts.py DELETED
@@ -1,110 +0,0 @@
1
- # ruff: noqa: UP006 UP007 UP045
2
- import dataclasses as dc
3
- import typing as ta
4
-
5
-
6
- """
7
- # https://setuptools.pypa.io/en/latest/userguide/ext_modules.html#extension-api-reference
8
-
9
- name (str) -
10
- the full name of the extension, including any packages - ie. not a filename or pathname, but Python dotted name
11
-
12
- sources (list[str]) -
13
- list of source filenames, relative to the distribution root (where the setup script lives), in Unix form
14
- (slash-separated) for portability. Source files may be C, C++, SWIG (.i), platform-specific resource files, or
15
- whatever else is recognized by the "build_ext" command as source for a Python extension.
16
-
17
- include_dirs (list[str]) -
18
- list of directories to search for C/C++ header files (in Unix form for portability)
19
-
20
- define_macros (list[tuple[str, str|None]]) -
21
- list of macros to define; each macro is defined using a 2-tuple: the first item corresponding to the name of the
22
- macro and the second item either a string with its value or None to define it without a particular value (equivalent
23
- of "#define FOO" in source or -DFOO on Unix C compiler command line)
24
-
25
- undef_macros (list[str]) -
26
- list of macros to undefine explicitly
27
-
28
- library_dirs (list[str]) -
29
- list of directories to search for C/C++ libraries at link time
30
-
31
- libraries (list[str]) -
32
- list of library names (not filenames or paths) to link against
33
-
34
- runtime_library_dirs (list[str]) -
35
- list of directories to search for C/C++ libraries at run time (for shared extensions, this is when the extension is
36
- loaded). Setting this will cause an exception during build on Windows platforms.
37
-
38
- extra_objects (list[str]) -
39
- list of extra files to link with (eg. object files not implied by 'sources', static library that must be explicitly
40
- specified, binary resource files, etc.)
41
-
42
- extra_compile_args (list[str]) -
43
- any extra platform- and compiler-specific information to use when compiling the source files in 'sources'. For
44
- platforms and compilers where "command line" makes sense, this is typically a list of command-line arguments, but
45
- for other platforms it could be anything.
46
-
47
- extra_link_args (list[str]) -
48
- any extra platform- and compiler-specific information to use when linking object files together to create the
49
- extension (or to create a new static Python interpreter). Similar interpretation as for 'extra_compile_args'.
50
-
51
- export_symbols (list[str]) -
52
- list of symbols to be exported from a shared extension. Not used on all platforms, and not generally necessary for
53
- Python extensions, which typically export exactly one symbol: "init" + extension_name.
54
-
55
- swig_opts (list[str]) -
56
- any extra options to pass to SWIG if a source file has the .i extension.
57
-
58
- depends (list[str]) -
59
- list of files that the extension depends on
60
-
61
- language (str) -
62
- extension language (i.e. "c", "c++", "objc"). Will be detected from the source extensions if not provided.
63
-
64
- optional (bool) -
65
- specifies that a build failure in the extension should not abort the build process, but simply not install the
66
- failing extension.
67
-
68
- py_limited_api (bool) -
69
- opt-in flag for the usage of Python's limited API.
70
- """
71
-
72
-
73
- ##
74
-
75
-
76
- SETUP_PY_TMPL = """
77
- import setuptools as st
78
-
79
- st.setup(
80
- ext_modules=[
81
- st.Extension(
82
- '{mod_name}',
83
- [{mod_srcs}],
84
- include_dirs=['lib'],
85
- py_limited_api=True
86
- ),
87
- ],
88
- )
89
- """
90
-
91
-
92
- @dc.dataclass(frozen=True)
93
- class ExtModule:
94
- name: str
95
- sources: ta.List[str]
96
- include_dirs: ta.Optional[ta.List[str]] = None
97
- define_macros: ta.Optional[ta.List[ta.Tuple[str, ta.Optional[str]]]] = None
98
- undef_macros: ta.Optional[ta.List[str]] = None
99
- library_dirs: ta.Optional[ta.List[str]] = None
100
- libraries: ta.Optional[ta.List[str]] = None
101
- runtime_library_dirs: ta.Optional[ta.List[str]] = None
102
- extra_objects: ta.Optional[ta.List[str]] = None
103
- extra_compile_args: ta.Optional[ta.List[str]] = None
104
- extra_link_args: ta.Optional[ta.List[str]] = None
105
- export_symbols: ta.Optional[ta.List[str]] = None
106
- swig_opts: ta.Optional[ta.List[str]] = None
107
- depends: ta.Optional[ta.List[str]] = None
108
- language: ta.Optional[str] = None
109
- optional: ta.Optional[bool] = None
110
- py_limited_api: ta.Optional[bool] = None