diff --git a/.github/workflows/python-test-with-style.yml b/.github/workflows/python-test-with-style.yml index 4c2764b244..e503f1636c 100644 --- a/.github/workflows/python-test-with-style.yml +++ b/.github/workflows/python-test-with-style.yml @@ -23,10 +23,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Python dependencies - run: | - pip install -r requirements.txt - pip install -r requirements-test.txt - name: Python test env: CC: ${{ matrix.compiler }} @@ -35,7 +31,7 @@ jobs: make info make -j2 export CEED_DIR=$PWD - pip install . + pip install '.[test]' cd python/tests PYTHON=python3 make test TEST_OPTS="--ceed /cpu/self/ref/serial -vv" cd ../../examples/python diff --git a/pyproject.toml b/pyproject.toml index ccdfc350ef..05c05d3ef6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [build-system] -requires = ["setuptools>=40.8.0", "wheel", "cffi"] +requires = ["setuptools>=77.0.0", "wheel", "cffi>=1.0.0"] build-backend = "setuptools.build_meta" [tool.autopep8] max_line_length = 80 [tool.cibuildwheel] -build-verbosity = "1" +build-verbosity = 1 test-requires = ["pytest"] test-command = "bash {project}/python/test-wheel.sh {project}" skip = "cp36-* cp37-* pp37-* *-manylinux_i686 *_ppc64le *_s390x *-musllinux*" @@ -14,3 +14,59 @@ skip = "cp36-* cp37-* pp37-* *-manylinux_i686 *_ppc64le *_s390x *-musllinux*" [tool.cibuildwheel.linux] manylinux-x86_64-image = "manylinux2014" manylinux-aarch64-image = "manylinux2014" + +[tool.setuptools] +package-dir = { "libceed" = "python" } +include-package-data = true +platforms = ["POSIX"] + +[project] +name="libceed" +description="libCEED: Code for Efficient Extensible Discretization" +authors = [ + {name="libCEED Team", email="ceed-users@llnl.gov"} +] +readme = "python/README.md" +license = "BSD-2-Clause" +license-files = ["LICENSE"] +dependencies = [ + "cffi>=1.0.0", + "numpy" +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Operating System :: POSIX", + "Programming Language :: C", + "Programming Language :: C++", + "Programming Language :: Fortran", + "Programming Language :: Python", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Scientific/Engineering", + "Topic :: Software Development :: Libraries", +] +keywords = ["libCEED"] +dynamic = [ + "version" +] + +[project.urls] +Homepage = "https://libceed.org" +Download = "https://github.com/CEED/libCEED/releases" +Repository = "https://github.com/CEED/libCEED" +Documentation = "https://libceed.org" +Issues = "https://github.com/CEED/libCEED/issues" + +[project.optional-dependencies] +cuda = ['numba'] +test = [ + 'autopep8', + 'pytest', + 'setuptools', + 'vermin', +] diff --git a/python/README.md b/python/README.md index a6e8d0df2e..2b404132ff 100644 --- a/python/README.md +++ b/python/README.md @@ -1,4 +1,12 @@ -# libCEED for Python +# libCEED: Code for Efficient Extensible Discretization + +libCEED is a lightweight library for expressing and manipulating operators that arise in high-order element-based discretization of partial differential equations. +libCEED's representations are much for efficient than assembled sparse matrices, and can achieve very high performance on modern CPU and GPU hardware. +This approach is applicable to a broad range of linear and nonlinear problems, and includes facilities for preconditioning. +libCEED is meant to be easy to incorporate into existing libraries and applications, and to build new tools on top of. + +libCEED has been developed as part of the DOE Exascale Computing Project +co-design Center for Efficient Exascale Discretizations (CEED). ## Install diff --git a/requirements-gpu.txt b/requirements-gpu.txt deleted file mode 100644 index c3db4451e8..0000000000 --- a/requirements-gpu.txt +++ /dev/null @@ -1 +0,0 @@ -numba diff --git a/requirements-test.txt b/requirements-test.txt deleted file mode 100644 index 612fd38d56..0000000000 --- a/requirements-test.txt +++ /dev/null @@ -1,4 +0,0 @@ -autopep8 -pytest -setuptools -vermin diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 180d4b48b3..0000000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -cffi -numpy diff --git a/setup.py b/setup.py index a2bb813e59..c19a9341d7 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ # testbed platforms, in support of the nation"s exascale computing imperative. # pylint: disable=no-name-in-module,import-error,unused-variable import os -from setuptools import setup +from setuptools import setup, Extension from setuptools.command.build_ext import build_ext # ------------------------------------------------------------------------------ @@ -30,11 +30,6 @@ def version(): return ceed_version[0] -def requirements(): - with open('requirements.txt') as f: - return f.readlines() - - class libceed_build_ext(build_ext): def run(self): prefix = os.path.join(self.build_lib, 'libceed') @@ -58,74 +53,11 @@ def make_libceed_so(self, prefix): ]) -description = """ -libCEED: Code for Efficient Extensible Discretization -===================================================== - -libCEED is a lightweight library for expressing and manipulating operators that -arise in high-order element-based discretization of partial differential -equations. libCEED's representations are much for efficient than assembled -sparse matrices, and can achieve very high performance on modern CPU and GPU -hardware. This approach is applicable to a broad range of linear and nonlinear -problems, and includes facilities for preconditioning. libCEED is meant to be -easy to incorporate into existing libraries and applications, and to build new -tools on top of. - -libCEED has been developed as part of the DOE Exascale Computing Project -co-design Center for Efficient Exascale Discretizations (CEED). -""" - -classifiers = """ -Development Status :: 4 - Beta -Intended Audience :: Developers -Intended Audience :: Science/Research -License :: OSI Approved :: BSD License -Operating System :: POSIX -Programming Language :: C -Programming Language :: C++ -Programming Language :: Fortran -Programming Language :: Python -Programming Language :: Python :: 3.5 -Programming Language :: Python :: 3.6 -Programming Language :: Python :: 3.7 -Programming Language :: Python :: 3.8 -Programming Language :: Python :: 3 :: Only -Topic :: Scientific/Engineering -Topic :: Software Development :: Libraries -""" - -setup(name="libceed", - version=version(), - description="libCEED: Code for Efficient Extensible Discretization", - long_description=description, - long_description_content_type='text/x-rst', - classifiers=classifiers.split("\n")[1:-1], - keywords=["libCEED"], - platforms=["POSIX"], - license="BSD 2", - license_file='LICENSE', - url="https://libceed.org", - download_url="https://github.com/CEED/libCEED/releases", - project_urls={ - "Bug Tracker": "https://github.com/CEED/libCEED/issues", - "Documentation": "https://libceed.org", - "Source Code": "https://github.com/CEED/libCEED", - }, - author="libCEED Team", - author_email="ceed-users@llnl.gov", - - install_requires=requirements(), - packages=["libceed"], - package_dir={"libceed": "python"}, - include_package_data=True, - - setup_requires=["cffi"], - cffi_modules=["python/build_ceed_cffi.py:ffibuilder"], - cmdclass={'build_ext': libceed_build_ext}, +setup( + version=version(), + cffi_modules=["python/build_ceed_cffi.py:ffibuilder"], + cmdclass={'build_ext': libceed_build_ext}, +) - extras_require={ - 'cuda': ['numba'] - }, - ) # ------------------------------------------------------------------------------