From 5dd60f0f9f95692ba25ab5295d41d9f086c51823 Mon Sep 17 00:00:00 2001 From: Chris Barnes Date: Wed, 23 Jun 2021 18:11:50 +0100 Subject: [PATCH 1/5] add mlpack dependency to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a6d4f0c..6cb7c2e 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,5 @@ MALA ==== Training and evaluation scripts for MALA (https://arxiv.org/abs/1709.02974). + +Depends on mlpack (`mlpack` on AUR, `libmlpack-dev` on debian-based). From 133efecf4defcceb9e942034ad9c44fb3d7789e0 Mon Sep 17 00:00:00 2001 From: Chris Barnes Date: Wed, 23 Jun 2021 18:12:08 +0100 Subject: [PATCH 2/5] add dependencies to requirements.txt --- requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/requirements.txt b/requirements.txt index 0f57144..452fd06 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,4 @@ +numpy +cython +setuptools tensorflow From 01d368bfc569c935d6b88a0022180c8355c8fcea Mon Sep 17 00:00:00 2001 From: Chris Barnes Date: Wed, 23 Jun 2021 18:12:37 +0100 Subject: [PATCH 3/5] add CI --- .github/workflows/ci.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..8abf8e8 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,21 @@ +on: [push, pull_request] + +defaults: + run: + shell: bash + +jobs: + + test: + runs-on: ubuntu-18.04 + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + fail-fast: false + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - run: sudo apt-get install -y --no-install-recommends libmlpack-dev + - run: pip install . From b91371aae6fb618a13690578650656deec5f08f4 Mon Sep 17 00:00:00 2001 From: Chris Barnes Date: Wed, 23 Jun 2021 18:14:29 +0100 Subject: [PATCH 4/5] pep518 pyproject.toml --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..848e39b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "cython", "numpy", "wheel"] +build-backend = "setuptools.build_meta" From e96d56bc3f298c8a9656816aa863db2b6ff2f9ed Mon Sep 17 00:00:00 2001 From: Chris Barnes Date: Wed, 23 Jun 2021 18:17:24 +0100 Subject: [PATCH 5/5] py3 --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6370501..c14677d 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ from setuptools import setup, Extension from setuptools.command.build_ext import build_ext as _build_ext import os +import builtins include_dirs = [ os.path.join(os.path.dirname(os.path.abspath(__file__)), "mala"), @@ -18,7 +19,7 @@ class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_options(self) # Prevent numpy from thinking it is still in its setup process: - __builtins__.__NUMPY_SETUP__ = False + builtins.__NUMPY_SETUP__ = False import numpy self.include_dirs.append(numpy.get_include())