Skip to content

Commit b8248b5

Browse files
authored
Build project with pip (#9)
* Add build system requirements * Add instructions for building with pip * Make interline spacing between enumerated items the same * More test edits
1 parent d50b553 commit b8248b5

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed

README.rst

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,43 @@ pymt_heatf
55
This is an example of building a model,
66
written in Fortran and wrapped in Python with the `babelizer <https://github.com/csdms/babelizer>`_,
77
with the `meson-python <https://meson-python.readthedocs.io/en/latest/>`_ build system
8-
using a ``pyproject.toml`` file to describe the build.
8+
using only a *pyproject.toml* file for project metadata.
99

1010
Build/Install
1111
-------------
1212

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

15-
1. Create the conda environment from `environment.yml` and activate it
15+
With conda
16+
..........
17+
18+
1. Create a conda environment from the included *environment.yml* file and activate it
1619
2. Build/install the `Fortran BMI example <https://github.com/csdms/bmi-example-fortran/#buildinstall>`_
17-
3. Build/install this project with ``make install``
20+
3. Build/install the project with:
21+
22+
.. code-block:: bash
23+
24+
$ make install
25+
26+
With pip
27+
........
28+
29+
Make, CMake, and a Fortran compiler are required.
30+
31+
1. Create a virtual environment
32+
2. Install the build system requirements through ``pip``:
33+
34+
.. code-block:: bash
35+
36+
$ pip install meson-python meson ninja cython numpy bmipy
37+
38+
3. Build/install the `Fortran BMI specification <https://github.com/csdms/bmi-fortran/#buildinstall>`_ (it's not installable through ``pip``)
39+
4. Build/install the `Fortran BMI example <https://github.com/csdms/bmi-example-fortran/#buildinstall>`_
40+
5. Build/install the project with:
41+
42+
.. code-block:: bash
43+
44+
$ make install
1845
1946
Use
2047
---
@@ -31,4 +58,4 @@ Import the *pymt* component:
3158
3259
>>> from pymt.MODELS import HeatModelF
3360
34-
Try the examples in the `examples` directory.
61+
Try the examples in the *examples* directory.

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ dependencies = [
4040

4141
[project.optional-dependencies]
4242
dev = [
43+
"meson",
44+
"meson-python",
45+
"ninja",
46+
"cython",
47+
"make",
48+
]
49+
lint = [
4350
"black",
4451
"ruff",
4552
"isort",

0 commit comments

Comments
 (0)