Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JCGoran committed Feb 28, 2024
1 parent 1872bcb commit dfde76a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 11 deletions.
5 changes: 2 additions & 3 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,8 @@ the Python API:
1. setup a sandbox environment with either *virtualenv*, *pyenv*, or
*pipenv*. For instance with *virtualenv*:
``python -m venv .venv && source .venv/bin/activate``
2. build the Python package with the command: ``python setup.py build``
3. install *pytest* Python package: ``pip install pytest``
4. execute the unit-tests: ``pytest``
2. build the Python wheel with the command: ``python -m pip wheel . --no-deps``
3. execute the unit-tests for the wheel: ``bash packaging/test_wheel.bash $(command -v python) WHEEL``, where ``WHEEL`` is the path to the wheel generated in the previous step.

Memory Leaks and clang-tidy
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
45 changes: 37 additions & 8 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ of all dependencies we recommend using `homebrew <https://brew.sh/>`__:
brew install flex bison cmake python3
The necessary Python packages can then easily be added using the pip3
command.
All of the Python dependencies (build, run, and development) can be installed
using:

.. code:: sh
pip3 install --user -r requirements.txt
pip3 install --user pip-tools
pip3 install --user -r <(pip-compile --all-build-deps --all-extras --no-strip-extras 2>&1)
Make sure to have latest flex/bison in $PATH :

Expand All @@ -74,11 +75,13 @@ installed along with the system toolchain:
apt-get install flex bison gcc python3 python3-pip
The Python dependencies are installed using:
All of the Python dependencies (build, run, and development) can be installed
using:

.. code:: sh
pip3 install --user -r requirements.txt
pip3 install --user pip-tools
pip3 install --user -r <(pip-compile --all-build-deps --all-extras --no-strip-extras 2>&1)
Build Project
-------------
Expand Down Expand Up @@ -139,6 +142,19 @@ This should build the NMODL framework and install it into your pip user
``site-packages`` folder such that it becomes available as a Python
module.

Building a wheel
~~~~~~~~~~~~~~~~

You can also build a wheel you can test and install in another environment using:

.. code:: sh
pip3 wheel . --no-deps [-C OPTION1=VALUE1 -C OPTION2=VALUE2...] [--wheel-dir DIRECTORY]
where the various ``OPTION`` values describe the build options (for a list of
all available options, please consult the `reference <https://scikit-build-core.readthedocs.io/en/latest/configuration.html>`_).
Notably, due to a bug in CMake, on MacOS one should pass ``-C build-dir=DIRECTORY`` to the above.

When building without linking against libpython
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -210,6 +226,16 @@ example in your Python 3 interpeter as follows:
SUFFIX hh
}
You can also run all of the Python tests for a given wheel using:

.. code:: sh
bash packaging/test_wheel.bash PYTHON_EXECUTABLE WHEEL
where ``PYTHON_EXECUTABLE`` should be replaced by the path to the Python
executable, and ``WHEEL`` should be replaced by the path to the wheel you wish
to test.

NMODL is now setup correctly!

Generating Documentation
Expand All @@ -219,9 +245,12 @@ In order to build the documentation you must have additionally
``pandoc`` installed. Use your system’s package manager to do this
(e.g. ``sudo apt-get install pandoc``).

You can build the entire documentation simply by using sphinx from
``setup.py``:
You can build the entire documentation simply by using the ``generate_docs.sh``
script:

.. code:: sh
python3 setup.py build_ext --inplace docs
bash docs/generate_docs.sh
The documentation will then be available in the ``public`` subdirectory. Note
that the Python package must be installed beforehand using ``pip install .``.

0 comments on commit dfde76a

Please sign in to comment.