From 02d58a6932a7afc1247313e79c05ffc515d340d6 Mon Sep 17 00:00:00 2001 From: mjwen Date: Sat, 5 Nov 2022 13:40:26 -0500 Subject: [PATCH 1/5] Add pyproject.toml to host build requires --- .gitignore | 1 + pyproject.toml | 3 +++ setup.py | 19 ++++++++++++------- 3 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore index acd6ed6..1c76032 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ kim.log .cache .pytest_cache/ .DS_Store +.idea diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8902b08 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel", "pybind11"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 0a6d24b..b831f06 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,17 @@ -"""Setup.""" - import os import subprocess import sys +from sysconfig import get_config_vars -from setuptools import setup, Extension, find_packages, distutils +from setuptools import Extension, distutils, find_packages, setup from setuptools.command.build_ext import build_ext -from sysconfig import get_config_vars -from api_compatibility import check_kim_api_compatibility +try: + from api_compatibility import check_kim_api_compatibility +except ImportError: + # new version of pip does not add cwd to path + sys.path.append(os.getcwd()) + from api_compatibility import check_kim_api_compatibility # remove `-Wstrict-prototypes' that is for C not C++ @@ -306,8 +309,10 @@ def chech_kim_api_compatibility(): name="kimpy", version=get_kimpy_version(), packages=find_packages(), - setup_requires=["pybind11"], - install_requires=["pybind11", "numpy", "pytest"], + install_requires=["numpy"], + extras_require={ + "test": ["pytest", "ase"], + }, python_requires=">=3.7", cmdclass={"build_ext": BuildExt}, ext_modules=get_kimpy_ext_modules(), From df4ebbd1a4850dd381b9f62dfdd956c18f7627f6 Mon Sep 17 00:00:00 2001 From: mjwen Date: Tue, 6 Dec 2022 12:35:42 -0600 Subject: [PATCH 2/5] Major FIX: typo to compute inverse matrix, result in bad padding atoms --- kimpy/neighlist/helper.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kimpy/neighlist/helper.hpp b/kimpy/neighlist/helper.hpp index e7e8737..03d5b97 100644 --- a/kimpy/neighlist/helper.hpp +++ b/kimpy/neighlist/helper.hpp @@ -76,7 +76,7 @@ inline int inverse(double const * mat, double * const inv) inv[1] = det2(mat[2], mat[1], mat[8], mat[7]); inv[2] = det2(mat[1], mat[2], mat[4], mat[5]); inv[3] = det2(mat[5], mat[3], mat[8], mat[6]); - inv[4] = det2(mat[0], mat[3], mat[6], mat[8]); + inv[4] = det2(mat[0], mat[2], mat[6], mat[8]); inv[5] = det2(mat[2], mat[0], mat[5], mat[3]); inv[6] = det2(mat[3], mat[4], mat[6], mat[7]); inv[7] = det2(mat[1], mat[0], mat[7], mat[6]); From 6411d6e560a36dbb5e6307021a0e95ab2c9454ca Mon Sep 17 00:00:00 2001 From: mjwen Date: Tue, 6 Dec 2022 20:41:38 -0600 Subject: [PATCH 3/5] Update GH action to drop py3.7 in favor of 3.10 --- .github/workflows/pythonpublish.yml | 2 +- .github/workflows/testing.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 2697ccf..08228a1 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -31,7 +31,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: '3.x' + python-version: "3.10" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 2b4d569..8f879c1 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 - name: Install gcc @@ -59,7 +59,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: ["3.8", "3.9", "3.10"] compiler: [clang, gcc] steps: - uses: actions/checkout@v2 @@ -126,7 +126,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: ["3.8", "3.9", "3.10"] compiler: [gcc] defaults: run: From ec799a257382fb8b7f4949ae9b3f88b3d9987200 Mon Sep 17 00:00:00 2001 From: mjwen Date: Tue, 6 Dec 2022 20:45:40 -0600 Subject: [PATCH 4/5] Remove Makefile --- Makefile | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index c16543d..0000000 --- a/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -build: - python setup.py build -develop: - python setup.py develop -inplace: - python setup.py build_ext --inplace -install: - python setup.py install -clean: - python setup.py clean -clean_all: - rm -rf build/ dist/ kimpy.egg-info/ */*.so */*.pyc */__pycache__ \ From 912c93495435796f65d58ea8b45d9f0b92938d88 Mon Sep 17 00:00:00 2001 From: mjwen Date: Tue, 6 Dec 2022 20:49:39 -0600 Subject: [PATCH 5/5] Update version, preparing for release --- CHANGELOG.txt | 7 +++++++ api_compatibility.txt | 1 + kimpy/__init__.py | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7cec460..a72f8a6 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,13 @@ Change Log ========== +v2.1.0 (2022/12/06) +=================== + +- Fixing inverse function bug in neighbor list, which can result in incorrect + padding +- Using pyproject.toml, and refactoring build and test requires + v2.0.1 (2022/08/18) =================== diff --git a/api_compatibility.txt b/api_compatibility.txt index 580ea70..5121817 100644 --- a/api_compatibility.txt +++ b/api_compatibility.txt @@ -21,3 +21,4 @@ 1.0.0 2.2.1 2.2.0 2.0.0 2.2.1 2.2.1 2.0.1 2.3.0 2.2.1 + 2.1.0 2.3.0 2.2.1 diff --git a/kimpy/__init__.py b/kimpy/__init__.py index b6a3e89..70813a5 100644 --- a/kimpy/__init__.py +++ b/kimpy/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.0.1" +__version__ = "2.1.0" # import all modules from . import model