Skip to content

Commit

Permalink
chore: readme [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-auchincloss committed Aug 29, 2023
1 parent 1ed8963 commit bb12667
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
6 changes: 3 additions & 3 deletions COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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%** |
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ["*"] }`<br/> if flag is one of:<br/> - ARFLAGS<br/> - LDSHARED <br/> - LDFLAGS<br/> - CPPFLAGS <br/> - CFLAGS <br/> - CCSHARED<br/>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 }` <br/> 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<br/> 3rd party named imports. must have the respective opt in `dependencies` |
| retain_intermediate_artifacts | bool = False <br/> whether to keep `.c` \| `.cpp` files |
| parallel | bool = False <br/>if parallel, add openmp headers<br/> 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 }` <br/>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<br/>3rd party named imports. must have the respective opt in `dependencies` |
| retain_intermediate_artifacts | bool = False <br/>whether to keep `.c` \| `.cpp` files |
| parallel | bool = False <br/>if parallel, add openmp headers<br/>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
Expand All @@ -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.
1 change: 0 additions & 1 deletion example/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
1 change: 0 additions & 1 deletion example/src/example_lib/_alias.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

cpdef str some_aliased(str name):
return name

0 comments on commit bb12667

Please sign in to comment.