From 2e1e705f763738bb652babaa27833c6efbcfbe55 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 21 Oct 2020 12:28:19 -0500 Subject: [PATCH 1/9] Fix quotes in setup.py --- setup.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/setup.py b/setup.py index a55ab79..b0c06db 100644 --- a/setup.py +++ b/setup.py @@ -215,7 +215,7 @@ def main(): EXTRA_DEFINES["USE_SMALL_INT_OPT"] = 1 import sys - if sys.platform in ['linux', 'linux2', 'darwin']: + if sys.platform in ["linux", "linux2", "darwin"]: CXXFLAGS.insert(0, "-std=gnu99") conf["ISL_INC_DIR"].append("isl/imath") @@ -276,21 +276,21 @@ def main(): license="MIT", url="http://documen.tician.de/islpy", classifiers=[ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Intended Audience :: Other Audience', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: MIT License', - 'Natural Language :: English', - 'Programming Language :: C++', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Topic :: Multimedia :: Graphics :: 3D Modeling', - 'Topic :: Scientific/Engineering', - 'Topic :: Scientific/Engineering :: Mathematics', - 'Topic :: Scientific/Engineering :: Physics', - 'Topic :: Scientific/Engineering :: Visualization', - 'Topic :: Software Development :: Libraries', + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Other Audience", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Programming Language :: C++", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Topic :: Multimedia :: Graphics :: 3D Modeling", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Mathematics", + "Topic :: Scientific/Engineering :: Physics", + "Topic :: Scientific/Engineering :: Visualization", + "Topic :: Software Development :: Libraries", ], packages=["islpy"], @@ -324,9 +324,9 @@ def main(): extra_link_args=conf["LDFLAGS"], ), ], - cmdclass={'build_ext': IslPyBuildExtCommand}, + cmdclass={"build_ext": IslPyBuildExtCommand}, ) -if __name__ == '__main__': +if __name__ == "__main__": main() -- GitLab From cb6654baa898581e4176cec4664d186efebc6588 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 21 Oct 2020 12:36:33 -0500 Subject: [PATCH 2/9] Run flake8 in CI on examples --- .github/workflows/ci.yml | 2 +- .gitlab-ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 574a064..24e2fd2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: "Main Script" run: | curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-flake8.sh - . ./prepare-and-run-flake8.sh "$(basename $GITHUB_REPOSITORY)" test gen_wrap.py + . ./prepare-and-run-flake8.sh "$(basename $GITHUB_REPOSITORY)" test gen_wrap.py examples pytest: name: Pytest Linux on Py${{ matrix.python-version }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 210656e..6f95ba9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -67,6 +67,6 @@ Documentation: Flake8: script: - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-flake8.sh - - . ./prepare-and-run-flake8.sh "$CI_PROJECT_NAME" test gen_wrap.py + - . ./prepare-and-run-flake8.sh "$CI_PROJECT_NAME" test gen_wrap.py examples tags: - python3 -- GitLab From 0bb297baddcca3092bed19a7cb926ca86f3698cd Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 21 Oct 2020 12:36:51 -0500 Subject: [PATCH 3/9] Default small integer opt to on --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b0c06db..e7b09b0 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ def get_config_schema(): Switch("USE_SHIPPED_IMATH", True, "Use included copy of imath in isl"), Switch("USE_GMP", True, "Use gmp in external isl"), Switch("USE_BARVINOK", False, "Include wrapper for Barvinok"), - Switch("USE_IMATH_SIO", False, "When using imath, use small-integer " + Switch("USE_IMATH_SIO", True, "When using imath, use small-integer " "optimization"), IncludeDir("GMP", []), -- GitLab From 0f0ab0b702ecbbe4c1a700ac4b2eb42fba047a31 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 21 Oct 2020 12:37:18 -0500 Subject: [PATCH 4/9] Gitlab CI test: install numpy --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6f95ba9..6cc041c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,8 @@ Python 3: - script: - - export PY_EXE=python3 - - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - - ". ./build-and-test-py-project.sh" + script: | + EXTRA_INSTALL="numpy" + curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh + ". ./build-and-test-py-project.sh" tags: - python3 except: -- GitLab From d201d11bcd7e39cd8f4f376d7137ddf527276829 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 21 Oct 2020 12:37:45 -0500 Subject: [PATCH 5/9] Fix example, run during CI --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ .gitlab-ci.yml | 12 ++++++++++++ examples/demo.py | 9 ++++----- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24e2fd2..a48302b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,26 @@ jobs: curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh . ./build-and-test-py-project.sh + examples: + name: Examples Linux on Py${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] + steps: + - uses: actions/checkout@v2 + - + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: "Main Script" + run: | + EXTRA_INSTALL="matplotlib numpy" + curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/ci-support.sh + . ./ci-support.sh + build_py_project_in_venv + run_examples + pytest_mac: name: Pytest macOS runs-on: macos-latest diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6cc041c..a58b29b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,18 @@ Python 3: reports: junit: test/pytest.xml +Examples: + script: | + EXTRA_INSTALL="matplotlib numpy" + curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/ci-support.sh + . ./ci-support.sh + build_py_project_in_venv + run_examples + tags: + - python3 + except: + - tags + Python 3 small integer opt: script: - export PY_EXE=python3 diff --git a/examples/demo.py b/examples/demo.py index cbca0d8..4750af1 100644 --- a/examples/demo.py +++ b/examples/demo.py @@ -34,8 +34,7 @@ def plot_basic_set(bset, *args, **kwargs): for v in vertices: points = [] - myset = (isl.Map.from_basic_map(isl.BasicMap.from_multi_aff(v.get_expr())) - .range()) + myset = isl.BasicSet.from_multi_aff(v.get_expr()) myset.foreach_point(points.append) point, = points vertex_pts.append([ @@ -72,14 +71,14 @@ def plot_basic_set(bset, *args, **kwargs): pt.gca().add_patch(patch) -plot_basic_set(bset, facecolor='red', edgecolor='black', alpha=0.3) -plot_basic_set(bset2, facecolor='green', edgecolor='black', alpha=0.2) +plot_basic_set(bset, facecolor="red", edgecolor="black", alpha=0.3) +plot_basic_set(bset2, facecolor="green", edgecolor="black", alpha=0.2) pt.grid() pt.xlim([-1, 6]) pt.ylim([-1, 8]) #pt.show() pt.savefig("before-union.png", dpi=50) -plot_basic_set(union, facecolor='blue', edgecolor='yellow', +plot_basic_set(union, facecolor="blue", edgecolor="yellow", alpha=0.5, plot_vert=True) pt.savefig("after-union.png", dpi=50) -- GitLab From fd609c9ae2c38d2ded1284e4895b803166c44802 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 21 Oct 2020 12:45:19 -0500 Subject: [PATCH 6/9] Fix Gitlab CI script --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a58b29b..121c80e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ Python 3: script: | EXTRA_INSTALL="numpy" curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - ". ./build-and-test-py-project.sh" + . ./build-and-test-py-project.sh tags: - python3 except: -- GitLab From d6d930694c09e76332bef07b8a04d70d8fd30265 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 21 Oct 2020 12:45:27 -0500 Subject: [PATCH 7/9] Switch Gitlab SIO CI to test non-SIO since SIO is now default --- .gitlab-ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 121c80e..fe1ff8a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,12 +23,11 @@ Examples: except: - tags -Python 3 small integer opt: +Python 3 without small-integer opt: script: - - export PY_EXE=python3 - - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh - - ./configure.py --use-imath-sio - - ". ./build-and-test-py-project.sh" + curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh + ./configure.py --no-use-imath-sio + . ./build-and-test-py-project.sh tags: - python3 except: -- GitLab From 032e6f9dace51a8770f31cbc108443d127519866 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 21 Oct 2020 12:47:27 -0500 Subject: [PATCH 8/9] Drop -std option for SIO --- setup.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/setup.py b/setup.py index e7b09b0..bb703b4 100644 --- a/setup.py +++ b/setup.py @@ -214,10 +214,6 @@ def main(): if conf["USE_IMATH_SIO"]: EXTRA_DEFINES["USE_SMALL_INT_OPT"] = 1 - import sys - if sys.platform in ["linux", "linux2", "darwin"]: - CXXFLAGS.insert(0, "-std=gnu99") - conf["ISL_INC_DIR"].append("isl/imath") else: EXTRA_DEFINES["USE_GMP_FOR_MP"] = 1 -- GitLab From 2c92088752f60387de040e254edb98ab7fa96bb2 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 21 Oct 2020 12:55:15 -0500 Subject: [PATCH 9/9] Fix Gitlab CI YAML --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe1ff8a..d8c1411 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ Examples: - tags Python 3 without small-integer opt: - script: + script: | curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project.sh ./configure.py --no-use-imath-sio . ./build-and-test-py-project.sh -- GitLab