From 73266257a6f30636678b8f0c38e4abecb4121d4b Mon Sep 17 00:00:00 2001 From: Alan Brammer Date: Wed, 21 Apr 2021 17:06:29 -0600 Subject: [PATCH 01/13] first pass at setting up many-linux environment Author: Alan Brammer --- .github/workflows/package.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/package.yml diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..3833344 --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,17 @@ +name: package into static linked wheel + +jobs: + package: + name: package up into a nice wheel + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Build manylinux Python wheels + uses: RalfG/python-wheels-manylinux-build@v0.2-manylinux1_x86_64 + with: + python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39' + ystem-packages: 'epel-release hdf hdf-devel' + build-requirements: 'numpy' + pre-build-command: 'ln -s /usr/lib64/hdf/lib* /usr/lib64/' + package-path: '' From e2d5c9fdb16b4838b75e792040f665e66762d773 Mon Sep 17 00:00:00 2001 From: Alan Brammer Date: Wed, 21 Apr 2021 17:08:51 -0600 Subject: [PATCH 02/13] add on entry Author: Alan Brammer --- .github/workflows/package.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 3833344..2d0d1ef 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -1,5 +1,7 @@ name: package into static linked wheel +on: [push] + jobs: package: name: package up into a nice wheel From 681f733a6ba6c65e9117b4e33d65dd28e3c5080d Mon Sep 17 00:00:00 2001 From: Alan Brammer Date: Wed, 21 Apr 2021 17:10:53 -0600 Subject: [PATCH 03/13] update version and fix typo Author: Alan Brammer Date: Wed, 21 Apr 2021 17:26:35 -0600 Subject: [PATCH 04/13] update to 2014 manylinux and upload wheels as artifcat Author: Alan Brammer --- .github/workflows/package.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index a614a16..fd08f74 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -10,10 +10,15 @@ jobs: - uses: actions/checkout@v2 - name: Build manylinux Python wheels - uses: RalfG/python-wheels-manylinux-build@v0.3.3-manylinux1_x86_64 + uses: RalfG/python-wheels-manylinux-build@v0.3.3-manylinux2014_x86_64 with: python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39' system-packages: 'epel-release hdf hdf-devel' build-requirements: 'numpy' pre-build-command: 'ln -s /usr/lib64/hdf/lib* /usr/lib64/' package-path: '' + - uses: actions/upload-artifact@v2 + with: + name: wheelhouse + path: dist + From 167b428f8e95e3744c349309a4185d353b162699 Mon Sep 17 00:00:00 2001 From: Alan Brammer Date: Wed, 21 Apr 2021 18:16:03 -0600 Subject: [PATCH 05/13] include pypa twine upload action Author: Alan Brammer --- .github/workflows/package.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index fd08f74..ed716c0 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -17,8 +17,17 @@ jobs: build-requirements: 'numpy' pre-build-command: 'ln -s /usr/lib64/hdf/lib* /usr/lib64/' package-path: '' + - uses: actions/upload-artifact@v2 with: name: wheelhouse path: dist + - name: Publish a Python distribution to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + packages_dir: dist/ From 5e2f86b045aa096d8daf9dfef39533b39e4e4cfd Mon Sep 17 00:00:00 2001 From: Alan Brammer Date: Wed, 21 Apr 2021 19:05:29 -0600 Subject: [PATCH 06/13] move manylinux wheels to upload location Author: Alan Brammer --- .github/workflows/package.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index ed716c0..b89c582 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -2,10 +2,12 @@ name: package into static linked wheel on: [push] + jobs: package: name: package up into a nice wheel runs-on: ubuntu-latest + steps: - uses: actions/checkout@v2 @@ -17,11 +19,16 @@ jobs: build-requirements: 'numpy' pre-build-command: 'ln -s /usr/lib64/hdf/lib* /usr/lib64/' package-path: '' - + + - name: purge old _linux_wheels + run: | + mkdir wheelhouse + cp dist/*manylinux* wheelhouse/ + - uses: actions/upload-artifact@v2 with: name: wheelhouse - path: dist + path: wheelhouse - name: Publish a Python distribution to PyPI if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') @@ -30,4 +37,6 @@ jobs: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ - packages_dir: dist/ + packages_dir: wheelhouse/ + + From fec6d8a1745c9f0c635000d9a206c60f2d82d292 Mon Sep 17 00:00:00 2001 From: Alan Brammer Date: Sun, 25 Apr 2021 09:49:58 -0600 Subject: [PATCH 07/13] Add libraries to LICENCE file, not a lawyer but I think this is pretty much good enough Author: Alan Brammer --- LICENSE | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/LICENSE b/LICENSE index 0426e5e..f956da2 100644 --- a/LICENSE +++ b/LICENSE @@ -19,3 +19,10 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Built distributions of pyhdf also include: +Libary | Licence +- hdf | BSD-3 +- jpeg | Custom BSD-like +- zlib | zlib From 5366715491543c4c133b215258fb5d2cd5c173b4 Mon Sep 17 00:00:00 2001 From: Alan Brammer Date: Sun, 25 Apr 2021 10:04:17 -0600 Subject: [PATCH 08/13] update install docs with pip built information --- doc/install.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/install.rst b/doc/install.rst index 81b1d04..dbfbe09 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -16,8 +16,11 @@ Once you're in the conda environment, install `pyhdf from conda-forge conda install -c conda-forge pyhdf If you don't want to use conda, the instructions below describes how you -can compile pyhdf from source. - +can compile pyhdf from source. Version 0.10.3 also incldues static linked wheels for +linux with cpython 3.6-3.9. If compatible, `pip install pyhdf` will include the neccessary +libraries for you. If you don't want to use the built manylinux distribution +`pip install pyhdf --no-binary :all:` will compile from source as below, or after installing HDF4 +libraries. Download the source ------------------- From 4b7d0db3128f89ccb784e280b4a0413154670b1a Mon Sep 17 00:00:00 2001 From: Alan Brammer Date: Sun, 25 Apr 2021 10:13:48 -0600 Subject: [PATCH 09/13] reowrd docs installation sentence --- doc/install.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/install.rst b/doc/install.rst index dbfbe09..a2b49ca 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -18,9 +18,9 @@ Once you're in the conda environment, install `pyhdf from conda-forge If you don't want to use conda, the instructions below describes how you can compile pyhdf from source. Version 0.10.3 also incldues static linked wheels for linux with cpython 3.6-3.9. If compatible, `pip install pyhdf` will include the neccessary -libraries for you. If you don't want to use the built manylinux distribution -`pip install pyhdf --no-binary :all:` will compile from source as below, or after installing HDF4 -libraries. +libraries for you. If you don't want to use the built manylinux distribution, follow instructions +below to build from source downloading from pypi with `pip install pyhdf --no-binary :all:`. + Download the source ------------------- From 62517284227a02321b3fbc4c8d1236bb18d8fede Mon Sep 17 00:00:00 2001 From: Alan Brammer Date: Wed, 12 May 2021 20:58:52 -0600 Subject: [PATCH 10/13] Add test pypi action first to check for errors. Only run workflow on tags, only push to main pypi on master --- .github/workflows/package.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index b89c582..47e430c 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -1,7 +1,9 @@ name: package into static linked wheel -on: [push] - +on: + push: + tags: + - 'v*' # jobs: package: @@ -30,13 +32,21 @@ jobs: name: wheelhouse path: wheelhouse + - name: Publish a Python distribution to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_TEST_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + packages_dir: wheelhouse/ + verbose: true + - name: Publish a Python distribution to PyPI - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + if: github.event.base_ref == 'refs/heads/master' uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ packages_dir: wheelhouse/ From bf7ffdb30c44ff7fcfb2ce98792ff709f07d74d1 Mon Sep 17 00:00:00 2001 From: Alan Brammer Date: Fri, 14 May 2021 09:19:00 -0600 Subject: [PATCH 11/13] Change from using external action to using cibuildwheel --- .github/workflows/package.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 47e430c..0ec6694 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -13,14 +13,23 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Build manylinux Python wheels - uses: RalfG/python-wheels-manylinux-build@v0.3.3-manylinux2014_x86_64 + - uses: actions/setup-python@v2 + name: Install Python with: - python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39' - system-packages: 'epel-release hdf hdf-devel' - build-requirements: 'numpy' - pre-build-command: 'ln -s /usr/lib64/hdf/lib* /usr/lib64/' - package-path: '' + python-version: '3.7' + + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==1.9.0 + + - name: Build wheels for linux python versions + run: | + python -m cibuildwheel --output-dir dist + env: + CIBW_BUILD: '{cp,pp}3*-*' + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_BEFORE_ALL_LINUX: yum -y install epel-release hdf hdf-devel && ln -s /usr/lib64/hdf/lib* /usr/lib64/ + CIBW_ARCHS_LINUX: 'x86_64' - name: purge old _linux_wheels run: | From d532105ac3b216154b19ef75add1b1641b4089e1 Mon Sep 17 00:00:00 2001 From: Alan Brammer Date: Sun, 16 May 2021 12:23:23 -0600 Subject: [PATCH 12/13] Update LICENSE Be consistent with American spellings Co-authored-by: Fazlul Shahriar --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index f956da2..e641f40 100644 --- a/LICENSE +++ b/LICENSE @@ -22,7 +22,7 @@ THE SOFTWARE. Built distributions of pyhdf also include: -Libary | Licence +Libary | License - hdf | BSD-3 - jpeg | Custom BSD-like - zlib | zlib From 53713d7caa7a506f02914d87a4caa17f66d10933 Mon Sep 17 00:00:00 2001 From: Alan Brammer Date: Sun, 16 May 2021 12:23:50 -0600 Subject: [PATCH 13/13] Update doc/install.rst fix spelling Co-authored-by: Fazlul Shahriar --- doc/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/install.rst b/doc/install.rst index a2b49ca..ab08c59 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -16,7 +16,7 @@ Once you're in the conda environment, install `pyhdf from conda-forge conda install -c conda-forge pyhdf If you don't want to use conda, the instructions below describes how you -can compile pyhdf from source. Version 0.10.3 also incldues static linked wheels for +can compile pyhdf from source. Version 0.10.3 also includes static linked wheels for linux with cpython 3.6-3.9. If compatible, `pip install pyhdf` will include the neccessary libraries for you. If you don't want to use the built manylinux distribution, follow instructions below to build from source downloading from pypi with `pip install pyhdf --no-binary :all:`.