Skip to content

Commit 7286987

Browse files
Jonathanlyjwkliao
authored andcommitted
updated developer notes about installation
1 parent 83b9b2b commit 7286987

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

DEVELOPER_NOTES.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
## Notes for PnetCDF-python developers
22
---
3+
### Note on python library packaging
4+
* Quick install
5+
* Currently, quick install via `pip install pnetcdf` is disabled. Main challenge is that build distribution (using wheels) is platform-specific and multiple wheels need to be generated to cover all mainstream platforms. A working source distribution for `pip install` is easier and has been tested on PyPI (works for all platforms but still needs MPI and PnetCDF-C installation)
6+
* Developer install
7+
* Developer installation is mainly managed by `setup.py` and `pyproject.toml`. The former one is the core file to build the package and the latter manages dependencies required by `pip install` command.
8+
* `python setup.py install` builds and installs the python library based on the current python environment and will error out if dependency (e.g. mpi4py) not met. This command is going to be deprecated and is not recommended for modern python library installation.
9+
* `pip install .` works as a wrapper command for the above but it goes further: it automatically handles and install any dependencies listed in `pyproject.toml` file.Need to pay special attention to the dependencies listed in `requires` under `[build-system]` and `dependencies`.
10+
* `dependencies` defines python libraries required for running the project and will first check if requirement already satisfied in current environment before installing the latest qualified version of the library.
11+
* `requires` defines libraries required for building the project. `pip install` by default creates and uses isolated building env for building stage which completely ignores current user env. For example, if user already installed mpi4py==3.1.6, "mpi4py>=3.1.4" will still automatically install a mpi4py 4.0.0 in the building env and thereafter use syntax from 4.0.0 to build pnetcdf-python. This caused version mismatch issues between building and running envs when numpy 2.0 and mpi4py 4.0.0 are released. To address this issue, current user guide forces to use current python env for building stage by adding ` -no-build-isolation` arg to `pip install` command.
312

413
### Note on configuring Read the Docs tool for user guide generation
514
* Read the Docs settings
@@ -8,7 +17,7 @@
817
* `.readthedocs.yaml` -- The script that controls commands that run before installation of pnetcdf-python (under `pre-install:`) and installation (under `python:`)
918
* `/docs/requirements.txt` -- Python dependencies required for doc generation, including `sphinx`
1019
* Important environment variables
11-
* User guide generation requires enviroment variables set by Read the Docs dashboard (`Admin` -> `Environment Variables`). Delete and add a new variable to modify (remember to select `Expose this environment variable in PR builds` if PR auto-build is enabled)
20+
* User guide generation requires environment variables set by Read the Docs dashboard (`Admin` -> `Environment Variables`). Delete and add a new variable to modify (remember to select `Expose this environment variable in PR builds` if PR auto-build is enabled)
1221
* Current environment variables set (only effective solution found to set env variable at installation):
1322
* `CC`: mpicc.mpich
1423
* `PNETCDF_DIR`: /home/docs/checkouts/readthedocs.org/user_builds/pnetcdf-python/checkouts/latest/_readthedocs/PnetCDF

0 commit comments

Comments
 (0)