From bb12667bb1349e73997ae3cdac5fd0f935e387cc Mon Sep 17 00:00:00 2001 From: benefactarch Date: Mon, 28 Aug 2023 20:13:23 -0400 Subject: [PATCH] chore: readme [ci skip] --- COVERAGE.md | 6 +++--- README.md | 20 ++++++++++++-------- example/hatch.toml | 1 - example/src/example_lib/_alias.pyx | 1 - 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/COVERAGE.md b/COVERAGE.md index 3a61e20..5af6cf2 100644 --- a/COVERAGE.md +++ b/COVERAGE.md @@ -5,14 +5,14 @@ | src/hatch\_cython/config/autoimport.py | 9 | 0 | 4 | 0 | 100% | | src/hatch\_cython/config/config.py | 145 | 16 | 70 | 10 | 87% | | src/hatch\_cython/config/defaults.py | 6 | 0 | 0 | 0 | 100% | -| src/hatch\_cython/config/files.py | 5 | 0 | 2 | 0 | 100% | +| src/hatch\_cython/config/files.py | 22 | 1 | 12 | 2 | 91% | | src/hatch\_cython/config/flags.py | 53 | 1 | 16 | 0 | 99% | | src/hatch\_cython/config/platform.py | 71 | 2 | 28 | 2 | 96% | | src/hatch\_cython/constants.py | 11 | 0 | 0 | 0 | 100% | | src/hatch\_cython/devel.py | 5 | 0 | 0 | 0 | 100% | | src/hatch\_cython/hooks.py | 5 | 1 | 2 | 0 | 86% | -| src/hatch\_cython/plugin.py | 186 | 9 | 140 | 8 | 95% | +| src/hatch\_cython/plugin.py | 189 | 9 | 142 | 8 | 95% | | src/hatch\_cython/temp.py | 12 | 0 | 2 | 0 | 100% | | src/hatch\_cython/types.py | 19 | 4 | 2 | 1 | 76% | | src/hatch\_cython/utils.py | 22 | 0 | 8 | 0 | 100% | -| **TOTAL** | **553** | **33** | **274** | **21** | **93%** | +| **TOTAL** | **573** | **34** | **286** | **23** | **93%** | diff --git a/README.md b/README.md index dd21ef5..1024c2d 100644 --- a/README.md +++ b/README.md @@ -87,11 +87,12 @@ include_somelib = { pkg = "pyarrow", include="get_include", libraries="get_libra | extra_link_args | str or `{ platforms = ["*"] \| "*", arg = str }` | | env | `{ env = "VAR1", arg = "VALUE", platforms = ["*"], arch = ["*"] }`
 if flag is one of:
 - ARFLAGS
 - LDSHARED 
 - LDFLAGS
 - CPPFLAGS 
 - CFLAGS 
 - CCSHARED
the current env vars will be merged with the value (provided platform & arch applies), separated by a space. This can be enabled by adding `{ env = "MYVAR" ... , merges = true }` to the definition. | | includes | list str | -| includes\_{package} | `{ pkg = str, include = str, libraries = str\| None, library_dirs = str \| None , required_call = str \| None }` 
 where all fields, but `pkg`, are attributes of `pkg` in the type of `callable() -> list[str] \| str` \| `list[str] \| str`. `pkg` is a module, or loadable module object, which may be imported through `import x.y.z`. | -| includes_numpy \| includes_pyarrow | bool
 3rd party named imports. must have the respective opt in `dependencies` | -| retain_intermediate_artifacts | bool = False 
 whether to keep `.c` \| `.cpp` files | -| parallel | bool = False 
if parallel, add openmp headers
 important: if using macos, you need the *homebrew* llvm vs _apple's_ llvm in order to pass `-fopenmp` to clang compiler | -| compiler | compiler used at build-time. if `msvc` (Microsoft Visual Studio), `/openmp` is used as argument to compile instead of `-fopenmp`  when `parallel = true` | +| includes\_{package} | `{ pkg = str, include = str, libraries = str\| None, library_dirs = str \| None , required_call = str \| None }` 
where all fields, but `pkg`, are attributes of `pkg` in the type of `callable() -> list[str] \| str` \| `list[str] \| str`. `pkg` is a module, or loadable module object, which may be imported through `import x.y.z`. | +| includes_numpy \| includes_pyarrow | bool
3rd party named imports. must have the respective opt in `dependencies` | +| retain_intermediate_artifacts | bool = False 
whether to keep `.c` \| `.cpp` files | +| parallel | bool = False 
if parallel, add openmp headers
important: if using macos, you need the *homebrew* llvm vs _apple's_ llvm in order to pass `-fopenmp` to clang compiler | +| compiler | compiler used at build-time. if `msvc` (Microsoft Visual Studio), `/openmp` is used as argument to compile instead of `-fopenmp`  when `parallel = true`. `default = false` | +| compile_py | whether to include `.py` files when building cython exts. note, this can be enabled & you can do per file / matched file ignores as below. `default = true` | | \*\* kwargs | keyword = value pair arguments to pass to the extension module when building | ### Files @@ -100,12 +101,15 @@ include_somelib = { pkg = "pyarrow", include="get_include", libraries="get_libra [build.targets.wheel.hooks.cython.options.files] exclude = [ # anything matching no_compile is ignored by cython - "*/no_compile/*" + "*/no_compile/*", + # note - anything "*" is escaped to "([^\s]*)" (non whitespace). + # if you need an actual * for python regex, use as below: + # this excludes all pyd or pytempl extensions + "([^.]\\*).(pyd$|pytempl$)" ] +aliases = {"abclib._filewithoutsuffix" = "abclib.importalias"} ``` - - ## License `hatch-cython` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license. diff --git a/example/hatch.toml b/example/hatch.toml index 31f2c97..b8ccf7c 100644 --- a/example/hatch.toml +++ b/example/hatch.toml @@ -24,7 +24,6 @@ src = "example_lib" parallel = true include_numpy = true retain_intermediate_artifacts = true - directives = { language_level = 3, boundscheck = false } compile_args = [ { arg = "-v" }, diff --git a/example/src/example_lib/_alias.pyx b/example/src/example_lib/_alias.pyx index 6df9b09..34392e6 100644 --- a/example/src/example_lib/_alias.pyx +++ b/example/src/example_lib/_alias.pyx @@ -2,4 +2,3 @@ cpdef str some_aliased(str name): return name -