Skip to content

Commit

Permalink
merge: pr #17 from joshua-auchincloss/v0.2.5
Browse files Browse the repository at this point in the history
v0.2.5 patch
  • Loading branch information
joshua-auchincloss authored Aug 30, 2023
2 parents 54a3699 + 3784560 commit b2e982a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,19 @@ includes = []
include_numpy = false
<!-- equivalent to include_pyarrow = true -->
include_somelib = { pkg = "pyarrow", include="get_include", libraries="get_libraries", library_dirs="get_library_dirs", required_call="create_library_symlinks" }
define_macros = [
["NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"],
]
```

## Configuration Options

| Field | Type |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| src | `str \| None` <br/> directory within `src` dir or `.`  which aliases the package being built. e.g. `package_a` -> `src/package_a_lib` <br/> `src = "package_a"` |
| directives | directives to cython (see cython docs) |
| compile_args | str or `{ platforms = ["*"] \| "*", arg = str }` |
| extra_link_args | str or `{ platforms = ["*"] \| "*", arg = str }` |
| directives | directives to cython (see [compiler directives]) |
| compile_args | str or `{ platforms = ["*"] \| "*", arg = str }`. see [extensions] for what args may be relevant |
| extra_link_args | str or `{ platforms = ["*"] \| "*", arg = str }`. see [extensions] for what args may be relevant |
| 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`. |
Expand All @@ -93,7 +96,8 @@ include_somelib = { pkg = "pyarrow", include="get_include", libraries="get_libra
| 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 |
| define_macros | list of list str (of len 1 or 2). len 1 == [KEY] == `#define KEY FOO` . len 2 == [KEY, VALUE] == `#define KEY VALUE`. see [extensions] |
| \*\* kwargs | keyword = value pair arguments to pass to the extension module when building. see [extensions] |

### Files

Expand All @@ -113,3 +117,7 @@ aliases = {"abclib._filewithoutsuffix" = "abclib.importalias"}
## License

`hatch-cython` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.

[extensions]: (https://docs.python.org/3/distutils/apiref.html#distutils.core.Extension)

[compiler directives]:(https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#compiler-directives))

0 comments on commit b2e982a

Please sign in to comment.