Skip to content

Commit

Permalink
Build project with pip (#9)
Browse files Browse the repository at this point in the history
* Add build system requirements

* Add instructions for building with pip

* Make interline spacing between enumerated items the same

* More test edits
  • Loading branch information
mdpiper authored Nov 3, 2023
1 parent d50b553 commit b8248b5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
37 changes: 32 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,43 @@ pymt_heatf
This is an example of building a model,
written in Fortran and wrapped in Python with the `babelizer <https://github.com/csdms/babelizer>`_,
with the `meson-python <https://meson-python.readthedocs.io/en/latest/>`_ build system
using a ``pyproject.toml`` file to describe the build.
using only a *pyproject.toml* file for project metadata.

Build/Install
-------------

This is a sketch of how to build and install this project.
This is a sketch of how to build and install this project with either ``conda`` or ``pip``.

1. Create the conda environment from `environment.yml` and activate it
With conda
..........

1. Create a conda environment from the included *environment.yml* file and activate it
2. Build/install the `Fortran BMI example <https://github.com/csdms/bmi-example-fortran/#buildinstall>`_
3. Build/install this project with ``make install``
3. Build/install the project with:

.. code-block:: bash
$ make install
With pip
........

Make, CMake, and a Fortran compiler are required.

1. Create a virtual environment
2. Install the build system requirements through ``pip``:

.. code-block:: bash
$ pip install meson-python meson ninja cython numpy bmipy
3. Build/install the `Fortran BMI specification <https://github.com/csdms/bmi-fortran/#buildinstall>`_ (it's not installable through ``pip``)
4. Build/install the `Fortran BMI example <https://github.com/csdms/bmi-example-fortran/#buildinstall>`_
5. Build/install the project with:

.. code-block:: bash
$ make install
Use
---
Expand All @@ -31,4 +58,4 @@ Import the *pymt* component:
>>> from pymt.MODELS import HeatModelF
Try the examples in the `examples` directory.
Try the examples in the *examples* directory.
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ dependencies = [

[project.optional-dependencies]
dev = [
"meson",
"meson-python",
"ninja",
"cython",
"make",
]
lint = [
"black",
"ruff",
"isort",
Expand Down

0 comments on commit b8248b5

Please sign in to comment.