Skip to content

Commit 09eda07

Browse files
author
root
committed
format build.py
1 parent 0959450 commit 09eda07

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

build.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
LOGGER = getLogger(__name__)
2020
LOGGER.info("Running `build.py`...")
2121

22-
debug_print = (os.getenv('__PYNT_DEBUG__') == 'true') or False
22+
debug_print = (os.getenv("__PYNT_DEBUG__") == "true") or False
2323
LOGGER.info(f"`debug_print` = {debug_print}")
2424

25+
2526
def list_dir_contents(directory, depth, level=0):
2627
if level > depth:
2728
return
@@ -52,6 +53,7 @@ def get_package_name(
5253
"Unable to determine what is the `PACKAGE_NAME` for this repository, set `default_name` parameter to a default name"
5354
)
5455

56+
5557
# Constants
5658
# 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`
5759
PROJECT_ROOT_DIR = Path(__file__).resolve().parent
@@ -100,6 +102,7 @@ def where_am_i() -> "Path":
100102
LOGGER.info(f"Running in the correct directory: {current_dir}")
101103
return PROJECT_ROOT_DIR
102104

105+
103106
def extra_compile_args():
104107
"""A function to get all the extra compile arguments for the extension modules.
105108
Define your own arguments here.
@@ -130,11 +133,11 @@ def get_extension_modules():
130133
LOGGER.info(f"in function `get_extension_modules`; `include_dirs` = {include_dirs}")
131134

132135
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+
)
138141

139142
module_newtypeinit = Extension(
140143
"newtype.extensions.newtypeinit",
@@ -163,7 +166,6 @@ def copy_output_to_cmd_buildlib(cmd):
163166
LOGGER.info("File copied successfully")
164167

165168

166-
167169
def build_c_extensions():
168170
"""Builds the extension modules using pure C without Cython."""
169171
extensions = get_extension_modules()

poetry.lock

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)