Skip to content

Commit

Permalink
Merge pull request #368 from BvB93/master
Browse files Browse the repository at this point in the history
ENH: Add a workflow for creating manylinyx2014 wheels
  • Loading branch information
BvB93 authored Apr 21, 2022
2 parents 1712ba3 + cdf288a commit 3394e01
Show file tree
Hide file tree
Showing 15 changed files with 378 additions and 160 deletions.
155 changes: 140 additions & 15 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,162 @@ name: Publish
on:
release:
types: [published]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
build:
name: Build wheels
runs-on: ubuntu-latest
build_wheels:
name: Build wheels ${{ matrix.version }}-${{ matrix.buildplat[1] }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
fail-fast: false
matrix:
buildplat:
- [ubuntu-20.04, manylinux_x86_64]
version:
- "cp37"
- "cp38"
- "cp39"
- "cp310"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.version }}-${{ matrix.buildplat[1] }}

- name: Setup conda
uses: s-weigand/setup-conda@v1
- uses: actions/upload-artifact@v3
with:
update-conda: false
name: wheels
path: ./wheelhouse/*.whl

build_sdist:
name: Build wheels sdist
runs-on: ubuntu-latest
env:
QMFLOWS_INCLUDEDIR: ""
QMFLOWS_LIBDIR: ""
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3

- name: Install dependencies
run: conda create -n test -c conda-forge boost eigen libint==2.6.0 highfive Cython setuptools wheel "pybind11>=2.2.4"
run: pip install Cython "setuptools>=48.0" wheel "pybind11>=2.2.4"

- name: Conda info
- name: Python info
run: |
source $CONDA/bin/activate test
conda info
which python
python --version
- name: Conda list
run: conda list -n test
- name: Installed packages
run: pip list

- name: Build wheels
- name: Build sdist
run: |
source $CONDA/bin/activate test
python setup.py sdist
tree dist
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./dist/*.tar.gz

test_sdist:
name: Test wheels sdist
runs-on: ubuntu-latest
needs: [build_sdist]
steps:
- uses: actions/checkout@v3

- name: Install CP2K
run: bash scripts/download_cp2k.sh 9.1

- name: Info CP2K
run: cp2k.popt --version

- name: Setup conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true

- uses: actions/download-artifact@v3
with:
name: wheels
path: dist

- name: Install dependencies
run: |
conda install -c conda-forge boost eigen libint==2.6.0 highfive
cd dist
pip install *.tar.gz -v
pip install -r ../test_requirements.txt
- name: Conda info
run: conda info

- name: Conda list
run: conda list

- name: Test with pytest
run: |
mkdir /tmp/nanoqm
cp setup.cfg /tmp/nanoqm/
cp conftest.py /tmp/nanoqm/conftest.py
cp -r test /tmp/nanoqm/test
cd /tmp/nanoqm
pytest -m "not (slow or long)"
upload_wheels:
name: Upload wheels
runs-on: ubuntu-latest
needs: [test_sdist, build_wheels]
steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
name: wheels
path: dist

- name: Set up Python
uses: actions/setup-python@v3

- name: Install dependencies
run: pip install twine

- name: Python info
run: |
which python
python --version
- name: Installed packages
run: pip list

- name: Validate wheels
run: |
tree dist
twine check dist/*
- name: Publish wheels
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

- name: Attach wheels to GitHub release
if: github.event_name == 'release'
uses: AButler/[email protected]
with:
files: 'dist/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}
18 changes: 4 additions & 14 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,7 @@ jobs:
- uses: actions/checkout@v3

- name: Install CP2K
run: |
version="${{ matrix.cp2k }}"
version_long=v"${{ matrix.cp2k }}".0
git clone https://github.com/cp2k/cp2k
cd cp2k
git checkout tags/$version_long
ln -s data /usr/share/cp2k
wget -nv https://github.com/cp2k/cp2k/releases/download/$version_long/cp2k-$version-Linux-x86_64.ssmp -O cp2k.ssmp
chmod u+rx cp2k.ssmp
mv cp2k.ssmp /usr/local/bin/cp2k.popt
run: bash scripts/download_cp2k.sh "${{ matrix.cp2k }}"

- name: Info CP2K
run: cp2k.popt --version
Expand Down Expand Up @@ -122,12 +111,13 @@ jobs:
source $CONDA/bin/activate test
case "${{ matrix.pre_release }}" in
"true")
pip install --pre -r ./test_requirements.txt --upgrade --force-reinstall
pip install --pre -r ./install_requirements.txt -r ./test_requirements.txt --upgrade --force-reinstall
pip install git+https://github.com/SCM-NV/qmflows@master --upgrade
pip uninstall plams -y; pip install git+https://github.com/SCM-NV/PLAMS@master --upgrade
pip install git+https://github.com/NLeSC/noodles@master --upgrade
;;
*)
pip install -r ./install_requirements.txt
pip install -r ./test_requirements.txt
;;
esac
Expand All @@ -143,7 +133,7 @@ jobs:
- name: Install the package
run: |
source $CONDA/bin/activate test
pip install -e . -vvv
pip install -e . -vvv --no-deps
- name: Test with pytest
run: |
Expand Down
13 changes: 13 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
exclude test/*
include *_requirements.txt

include licenses/*.txt
include licenses/*.rst

include nanoqm/py.typed
recursive-include nanoqm *.pyi
include nanoqm/basis/GTH_POTENTIALS
include nanoqm/basis/*.json
include nanoqm/basis/BASIS_*

include libint/include/*.hpp
20 changes: 14 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,25 @@ For further information on the theory behind nano-qmflows and how to use the pro
Installation
------------

In order to install the **nano-qmflows** library you need to install *Miniconda* as detailed here_.
In order to install the **nano-qmflows** library there two options:

1. Install pre-compiled binaries.
2. Build Nano-QMFlows from source.

Pre-compiled linux binaries are available on pypi. In order to use them all one needs is a linux machine and then issue the ``pip install nano-qmflows`` command.

On the other hand, other operating systems (and source builds in general) first require an installation of *Miniconda* as is detailed here_.

.. _here: https://docs.conda.io/en/latest/miniconda.html

Then, to install the **nano-qmflows** library type the following commands inside the conda environment:
- ``conda create -n qmflows -c conda-forge boost eigen libint==2.6.0 highfive``
- ``conda activate qmflows``
- ``pip install nano-qmflows --upgrade``
Then, to install the **nano-qmflows** library type the following commands inside the conda environment:

- ``conda create -n qmflows -c conda-forge boost eigen libint==2.6.0 highfive``
- ``conda activate qmflows``
- ``pip install nano-qmflows --upgrade``

.. note::
For GCC <7 one has to pass ``eigen=3.3``.
Older compilers, such as GCC <7, might not be compatible with the latest ``eigen`` version and require specification of *.e.g* ``eigen=3.3``.

Advantages and Limitations
--------------------------
Expand Down
12 changes: 12 additions & 0 deletions install_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
h5py
mendeleev
more-itertools
noodles>=0.3.3
numpy
scipy
schema
pyyaml>=5.1
plams>=1.5.1
qmflows>=0.12.0
packaging>=1.16.8
Nano-Utils>=2.0.0
3 changes: 3 additions & 0 deletions licenses/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Licenses for various third-party binaries distributed in the Nano-QMFlows wheels.

Note that no such files are present in source-only Nano-QMFlows distributions.
74 changes: 74 additions & 0 deletions licenses/hdf5.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
Copyright Notice and License Terms for
HDF5 (Hierarchical Data Format 5) Software Library and Utilities
-----------------------------------------------------------------------------

HDF5 (Hierarchical Data Format 5) Software Library and Utilities
Copyright 2006 by The HDF Group.

NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities
Copyright 1998-2006 by The Board of Trustees of the University of Illinois.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted for any
purpose (including commercial purposes) provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions, and
the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions,
and the following disclaimer in the documentation and/or materials provided with the distribution.
3. Neither the name of The HDF Group, the name of the University, nor the name of any Contributor
may be used to endorse or promote products derived from this software without specific prior
written permission from The HDF Group, the University, or the Contributor, respectively.

DISCLAIMER:
THIS SOFTWARE IS PROVIDED BY THE HDF GROUP AND THE CONTRIBUTORS "AS IS" WITH NO
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. IN NO EVENT SHALL THE HDF GROUP OR
THE CONTRIBUTORS BE LIABLE FOR ANY DAMAGES SUFFERED BY THE USERS ARISING OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features,
functionality or performance of the source code ("Enhancements") to anyone; however, if you choose
to make your Enhancements available either publicly, or directly to The HDF Group, without imposing a
separate written license agreement for such Enhancements, then you hereby grant the following
license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works,
incorporate into other computer software, distribute, and sublicense such enhancements or derivative
works thereof, in binary and source code form.

Limited portions of HDF5 were developed by Lawrence Berkeley National Laboratory (LBNL). LBNL's
Copyright Notice and Licensing Terms can be found here: COPYING_LBNL_HDF5 file in this directory or
at http://support.hdfgroup.org/ftp/HDF5/releases/COPYING_LBNL_HDF5.

Contributors: National Center for Supercomputing Applications (NCSA) at the University of Illinois,
Fortner Software, Unidata Program Center (netCDF), The Independent JPEG Group (JPEG), Jean-loup
Gailly and Mark Adler (gzip), and Digital Equipment Corporation (DEC).

Portions of HDF5 were developed with support from the Lawrence Berkeley National Laboratory (LBNL)
and the United States Department of Energy under Prime Contract No. DE-AC02-05CH11231.

Portions of HDF5 were developed with support from Lawrence Livermore National Laboratory and the
United States Department of Energy under Prime Contract No. DE-AC52-07NA27344.

Portions of HDF5 were developed with support from the University of California, Lawrence Livermore
National Laboratory (UC LLNL). The following statement applies to those portions of the product and
must be retained in any redistribution of source code, binaries, documentation, and/or accompanying
materials:

This work was partially produced at the University of California, Lawrence Livermore National
Laboratory (UC LLNL) under contract no. W-7405-ENG-48 (Contract 48) between the U.S. Department
of Energy (DOE) and The Regents of the University of California (University) for the operation of UC
LLNL.

DISCLAIMER:
THIS WORK WAS PREPARED AS AN ACCOUNT OF WORK SPONSORED BY AN AGENCY OF THEUNITED
STATES GOVERNMENT. NEITHER THE UNITED STATES GOVERNMENT NOR THE UNIVERSITY OF
CALIFORNIA NOR ANY OF THEIR EMPLOYEES, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR
ASSUMES ANY LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS OF
ANY INFORMATION, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE
WOULD NOT INFRINGE PRIVATELY- OWNED RIGHTS. REFERENCE HEREIN TO ANY SPECIFIC
COMMERCIAL PRODUCTS, PROCESS, OR SERVICE BY TRADE NAME, TRADEMARK, MANUFACTURER, OR
OTHERWISE, DOES NOT NECESSARILY CONSTITUTE OR IMPLY ITS ENDORSEMENT, RECOMMENDATION,
OR FAVORING BY THE UNITED STATES GOVERNMENT OR THE UNIVERSITY OF CALIFORNIA. THE VIEWS
AND OPINIONS OF AUTHORS EXPRESSED HEREIN DO NOT NECESSARILY STATE OR REFLECT THOSE OF
THE UNITED STATES GOVERNMENT OR THE UNIVERSITY OF CALIFORNIA, AND SHALL NOT BE USED FOR
ADVERTISING OR PRODUCT ENDORSEMENT PURPOSES.
17 changes: 17 additions & 0 deletions licenses/libint.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Libint - a library for the evaluation of molecular integrals of many-body operators over Gaussian functions

Copyright (C) 2004-2020 Edward F. Valeev

Libint is free software. Most of the source code of the Libint compiler (code generator)
can be redistributed and/or modified under the terms of the GNU General Public License, version 3,
as published by the Free Software Foundation (see the accompanying file COPYING;
if you did not receive this file refer to <http://www.gnu.org/licenses/>).
The rest of Libint, including the generated source, can be distributed under
the GNU Lesser General Public License, version 3, (see the file COPYING.LESSER,
or <http://www.gnu.org/licenses/>). The applicable license is specified in each
source file. If not indicated, the applicable license is GNU LGPL, version 3 (not GPL).

Libint is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Loading

0 comments on commit 3394e01

Please sign in to comment.