|
1 | 1 | ## Notes for PnetCDF-python developers |
2 | 2 | --- |
3 | 3 | ### Library packaging and publishing |
4 | | - * Packaging: build source distribution and wheel distribution (optional) |
| 4 | + * Currently, pip-install via build distribution is disabled. No wheel files are uploaded to PyPI. Lastest pnetcdf-python package on PyPI: https://pypi.org/project/pnetcdf/ |
| 5 | + * Packaging: build source distribution and wheel distribution |
5 | 6 | 1. Create virtual env and install PnetCDF-C and all python dependencies as developer installation |
6 | 7 | 2. Update version number, cd to repo directory and generate distribution: |
7 | 8 | ``` |
|
10 | 11 | ``` |
11 | 12 | CC=/path/to/mpicc PNETCDF_DIR=/path/to/pnetcdf/dir python3 -m build |
12 | 13 | ``` |
13 | | - * (Recommended) publish on [TestPyPI](https://packaging.python.org/en/latest/guides/using-testpypi/) for testing |
14 | | - 1. Create TestPyPI account and update `.pypirc` per TestPyPI instruction |
| 14 | + * (Recommended) publish on [TestPyPI](https://packaging.python.org/en/latest/guides/using-testpypi/) for testing. Only upload source distribution archive, as the wheel file (dist/pncpy-x.x.x*.whl) works exclusively for your own system and python version. |
| 15 | + 1. Create TestPyPI account and update `.pypirc` per instruction |
15 | 16 | 2. Publish source distribution on TestPyPI |
16 | 17 | ``` |
17 | 18 | python3 -m twine upload --repository testpypi dist/pnetcdf-x.x.x.tar.gz |
|
20 | 21 | ``` |
21 | 22 | CC=/path/to/mpicc PNETCDF_DIR=/path/to/pnetcdf/dir pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pnetcdf==x.x.x |
22 | 23 | ``` |
| 24 | + 4. Run pnetcdf-python test programs |
23 | 25 |
|
24 | | - 4. Run test programs |
| 26 | + * Officially publish on [PyPI](https://pypi.org/) for testing |
| 27 | + 1. Create TestPyPI account and update `.pypirc` per instruction |
| 28 | + 2. Publish source distribution on PyPI |
| 29 | + ``` |
| 30 | + python3 -m twine upload dist/pnetcdf-x.x.x.tar.gz |
| 31 | + ``` |
| 32 | + 3. For testing, just create a new virtual env and quick install (using default PyPI index) without source code repo. |
| 33 | + ``` |
| 34 | + CC=/path/to/mpicc PNETCDF_DIR=/path/to/pnetcdf/dir pip install pnetcdf |
| 35 | + ``` |
25 | 36 |
|
26 | 37 |
|
27 | 38 | ### Library installation |
28 | 39 | * Quick install |
29 | | - * 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) |
30 | 40 | * `MANIFEST.in` controls files to be included in source distribution (sdist), which will be eventually uploaded to PyPI if we enables quick install in the future. After modifications to `MANIFEST.IN` file, here are steps to check if the files included are valid to build the library. |
31 | 41 | 1. Make sure pnetcdf.egg-info folder is deleted. Otherwise it will first cache previous versions of `MANIFEST.IN` requirement. |
32 | 42 | 2. Build the source distribution |
|
0 commit comments