|
19 | 19 | LOGGER = getLogger(__name__) |
20 | 20 | LOGGER.info("Running `build.py`...") |
21 | 21 |
|
22 | | -debug_print = (os.getenv('__PYNT_DEBUG__') == 'true') or False |
| 22 | +debug_print = (os.getenv("__PYNT_DEBUG__") == "true") or False |
23 | 23 | LOGGER.info(f"`debug_print` = {debug_print}") |
24 | 24 |
|
| 25 | + |
25 | 26 | def list_dir_contents(directory, depth, level=0): |
26 | 27 | if level > depth: |
27 | 28 | return |
@@ -52,6 +53,7 @@ def get_package_name( |
52 | 53 | "Unable to determine what is the `PACKAGE_NAME` for this repository, set `default_name` parameter to a default name" |
53 | 54 | ) |
54 | 55 |
|
| 56 | + |
55 | 57 | # Constants |
56 | 58 | # Set `PROJECT_ROOT_DIR` to the directory of the current file, if in doubt with regards to path, always use relative to `PROJECT_ROOT_DIR` |
57 | 59 | PROJECT_ROOT_DIR = Path(__file__).resolve().parent |
@@ -100,6 +102,7 @@ def where_am_i() -> "Path": |
100 | 102 | LOGGER.info(f"Running in the correct directory: {current_dir}") |
101 | 103 | return PROJECT_ROOT_DIR |
102 | 104 |
|
| 105 | + |
103 | 106 | def extra_compile_args(): |
104 | 107 | """A function to get all the extra compile arguments for the extension modules. |
105 | 108 | Define your own arguments here. |
@@ -130,11 +133,11 @@ def get_extension_modules(): |
130 | 133 | LOGGER.info(f"in function `get_extension_modules`; `include_dirs` = {include_dirs}") |
131 | 134 |
|
132 | 135 | module_newtypemethod = Extension( |
133 | | - "newtype.extensions.newtypemethod", |
134 | | - sources=["newtype/extensions/newtype_meth.c"], |
135 | | - include_dirs=["newtype/extensions"], |
136 | | - extra_compile_args=["-D__DEBUG_PRINT__"] if debug_print else [], |
137 | | -) |
| 136 | + "newtype.extensions.newtypemethod", |
| 137 | + sources=["newtype/extensions/newtype_meth.c"], |
| 138 | + include_dirs=["newtype/extensions"], |
| 139 | + extra_compile_args=["-D__DEBUG_PRINT__"] if debug_print else [], |
| 140 | + ) |
138 | 141 |
|
139 | 142 | module_newtypeinit = Extension( |
140 | 143 | "newtype.extensions.newtypeinit", |
@@ -163,7 +166,6 @@ def copy_output_to_cmd_buildlib(cmd): |
163 | 166 | LOGGER.info("File copied successfully") |
164 | 167 |
|
165 | 168 |
|
166 | | - |
167 | 169 | def build_c_extensions(): |
168 | 170 | """Builds the extension modules using pure C without Cython.""" |
169 | 171 | extensions = get_extension_modules() |
|
0 commit comments