Skip to content

Commit

Permalink
add SKIP_BUILD flag (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
shapiromatron authored Aug 1, 2024
1 parent 4c5c791 commit e4c2d29
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 9 additions & 1 deletion docs/source/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ pip install -U pip uv
uv pip install -e ".[dev,docs]"
```

This will install the package and all dependencies, including building the C++ `bmdscore` shared object which will require a compiler and related dependencies installed and configured for your local setup.

:::{tip}

If you want to skip building `bmdscore` locally, you can set an environment variable `SKIP_BUILD=1` in your python environment; this will allow you to install the package but skip compilation of the shared object.

:::

Tests are written using [pytest](http://doc.pytest.org/en/latest/). To run all tests:

```bash
Expand All @@ -31,7 +39,7 @@ There is a built in Makefile command, ``make dev`` that creates a tmux applicati

## Priors Report

The pybmds package includes Bayesian priors and frequentist parameter initialization settings that have been tuned to help improve model fit performance. To generate a report of the settings in all the possible permutations, run the command:
The `pybmds` package includes Bayesian priors and frequentist parameter initialization settings that have been tuned to help improve model fit performance. To generate a report of the settings in all permutations, run the command:

```bash
bmds-priors-report priors_report.md
Expand Down
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ def build_extension(self, ext: CMakeExtension) -> None:
subprocess.run(["cmake", "--build", ".", *build_args], cwd=build_temp, check=True)


setup(
ext_modules=[CMakeExtension("pybmds.bmdscore")],
cmdclass={"build_ext": CMakeBuild},
)
# if SKIP_BUILD exists, don't try to build the C++ code
build_kw = {}
if os.environ.get("SKIP_BUILD") is None:
build_kw.update(
ext_modules=[CMakeExtension("pybmds.bmdscore")], cmdclass={"build_ext": CMakeBuild}
)
setup(**build_kw)

0 comments on commit e4c2d29

Please sign in to comment.