From 46d1b93b6bc09a08cbca451b5b77086a058972a8 Mon Sep 17 00:00:00 2001 From: Tin Kei Cheng <tinkei.cheng@tum.de> Date: Fri, 20 May 2022 14:21:01 +0200 Subject: [PATCH] Add `install_requires` to `setup.cfg` to fix #1. Add dummy `setup.py`. Remove unneeded `mpi4py` requirement. Rename `test` -> `tests` and update `.gitlab-ci.yml`. --- .gitlab-ci.yml | 8 ++--- build_and_test.sh | 2 +- requirements.txt | 1 - setup.cfg | 16 ++++++++++ setup.py | 30 +++++++++++++++++++ test/__init__.py | 7 ----- tests/__init__.py | 11 +++++++ {test => tests}/cleanup.py | 0 {test => tests}/disabled_test_divB.ipynb | 0 {test => tests}/disabled_test_divB.py | 0 {test => tests}/test_GVEC_class.py | 0 {test => tests}/test_blown_up_B.py | 0 .../test_greville_and_element_boundaries.py | 0 {test => tests}/test_gvec_spline.py | 0 .../test_implementations_of_dphi.py | 0 {test => tests}/test_iota_eq_dchi_dphi.py | 0 ...nested_maps_and_jacobians_with_meshgrid.py | 0 {test => tests}/test_paraview.py | 0 18 files changed, 62 insertions(+), 13 deletions(-) create mode 100644 setup.py delete mode 100644 test/__init__.py create mode 100644 tests/__init__.py rename {test => tests}/cleanup.py (100%) rename {test => tests}/disabled_test_divB.ipynb (100%) rename {test => tests}/disabled_test_divB.py (100%) rename {test => tests}/test_GVEC_class.py (100%) rename {test => tests}/test_blown_up_B.py (100%) rename {test => tests}/test_greville_and_element_boundaries.py (100%) rename {test => tests}/test_gvec_spline.py (100%) rename {test => tests}/test_implementations_of_dphi.py (100%) rename {test => tests}/test_iota_eq_dchi_dphi.py (100%) rename {test => tests}/test_nested_maps_and_jacobians_with_meshgrid.py (100%) rename {test => tests}/test_paraview.py (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a09690d..7c035a5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,8 +45,8 @@ pages: # - apt-get -qq insall -y texlive-latex-recommended texlive-fonts-recommended tex-gyre texlive-latex-extra latexmk texlive-lang-cyrillic texlive-lang-greek cm-super texlive-xetex texlive-luatex fonts-freefont-otf xindy graphviz - python -m venv ipp-env - source ipp-env/bin/activate - - pip install -U pip build wheel pytest coverage - - pip install -r requirements.txt + - pip install -U pip build wheel pytest coverage sphinx sphinx_rtd_theme + # - pip install -r requirements.txt # Print directory structure, but exclude virtual environment directory. - tree -I 'ipp-env' @@ -63,12 +63,12 @@ pages: # - make latexpdf LATEXMKOPTS="-xelatex -silent" # - cd .. - # Build: make pyccel, build python package, install package. + # Build: build python package, install package. - echo "Run python build:" - python -m build - ls -lah dist - echo "Install dist:" - - pip install -U dist/gvec_to_python-*.whl --force-reinstall + - pip install -U dist/gvec_to_python-*.whl # --force-reinstall # Test: run pytest and coverage report. - echo "Run pytest and coverage report:" diff --git a/build_and_test.sh b/build_and_test.sh index 6ffbdd7..8af68dc 100755 --- a/build_and_test.sh +++ b/build_and_test.sh @@ -16,7 +16,7 @@ echo "Run python build:" python -m build ls -lah dist echo "Install dist:" -pip install -U dist/gvec_to_python-*.whl --force-reinstall +pip install -U dist/gvec_to_python-*.whl # --force-reinstall # Test: run pytest. echo "Run pytest:" diff --git a/requirements.txt b/requirements.txt index a74b484..6c5f3c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ h5py>=3.3.0 matplotlib>=3.3.3 -mpi4py>=3.0.3 numba>=0.53.1 numpy>=1.19.5 pandas>=1.2.1 diff --git a/setup.cfg b/setup.cfg index d4c125f..4834679 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,6 +6,7 @@ author_email = tinkei.cheng@tum.de description = Converts GVEC output to STRUPHY input long_description = file: README.md long_description_content_type = text/markdown +keywords = plasma, mhd, equilibrium, discrete differential forms, gvec url = https://gitlab.mpcdf.mpg.de/spossann/gvec_to_python project_urls = Bug Tracker = https://gitlab.mpcdf.mpg.de/spossann/gvec_to_python/-/issues @@ -19,6 +20,21 @@ package_dir = = src packages = find: python_requires = >=3.6 +install_requires = + h5py>=3.3.0 + matplotlib>=3.3.3 + numba>=0.53.1 + numpy>=1.19.5 + pandas>=1.2.1 + psutil>=5.8.0 + pytz>=2021.1 + regex>=2021.8.3 + scipy>=1.6.0 + sphinx>=4.2.0 + sphinx_rtd_theme>=1.0.0 + tqdm>=4.56.0 + vtk>=9.0.3 + [options.packages.find] where = src diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..b9bd4e5 --- /dev/null +++ b/setup.py @@ -0,0 +1,30 @@ +from setuptools import setup, find_packages + +if __name__ == "__main__": + + setup( + # name="gvec_to_python", + # version="0.1.2", + # packages=find_packages(), + # install_requires=[ + # 'h5py>=3.3.0' + # 'matplotlib>=3.3.3' + # 'numba>=0.53.1' + # 'numpy>=1.19.5' + # 'pandas>=1.2.1' + # 'psutil>=5.8.0' + # 'pytz>=2021.1' + # 'regex>=2021.8.3' + # 'scipy>=1.6.0' + # 'sphinx>=4.2.0' + # 'sphinx_rtd_theme>=1.0.0' + # 'tqdm>=4.56.0' + # 'vtk>=9.0.3' + # ], + # author="Tin Kei Cheng", + # author_email="tinkei.cheng@tum.de", + # description="", + # license="", + # keywords="plasma, mhd, equilibrium, discrete differential forms, gvec", + # url="https://gitlab.mpcdf.mpg.de/spossann/gvec_to_python", + ) diff --git a/test/__init__.py b/test/__init__.py deleted file mode 100644 index 43bb6b4..0000000 --- a/test/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# Specify __all__ variable to enable `from gvec_to_python import *`. -# Source: https://docs.python.org/3/tutorial/modules.html#importing-from-a-package -__all__ = [ - 'test_greville_and_element_boundaries', - 'test_iota_eq_dchi_dphi', - 'test_paraview', - ] diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..5a70476 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,11 @@ +# Specify __all__ variable to enable `from gvec_to_python import *`. +# Source: https://docs.python.org/3/tutorial/modules.html#importing-from-a-package +__all__ = [ + 'test_greville_and_element_boundaries', + 'test_GVEC_class', + 'test_gvec_spline', + 'test_implementations_of_dphi', + 'test_iota_eq_dchi_dphi', + 'test_nested_maps_and_jacobians_with_meshgrid', + 'test_paraview', +] diff --git a/test/cleanup.py b/tests/cleanup.py similarity index 100% rename from test/cleanup.py rename to tests/cleanup.py diff --git a/test/disabled_test_divB.ipynb b/tests/disabled_test_divB.ipynb similarity index 100% rename from test/disabled_test_divB.ipynb rename to tests/disabled_test_divB.ipynb diff --git a/test/disabled_test_divB.py b/tests/disabled_test_divB.py similarity index 100% rename from test/disabled_test_divB.py rename to tests/disabled_test_divB.py diff --git a/test/test_GVEC_class.py b/tests/test_GVEC_class.py similarity index 100% rename from test/test_GVEC_class.py rename to tests/test_GVEC_class.py diff --git a/test/test_blown_up_B.py b/tests/test_blown_up_B.py similarity index 100% rename from test/test_blown_up_B.py rename to tests/test_blown_up_B.py diff --git a/test/test_greville_and_element_boundaries.py b/tests/test_greville_and_element_boundaries.py similarity index 100% rename from test/test_greville_and_element_boundaries.py rename to tests/test_greville_and_element_boundaries.py diff --git a/test/test_gvec_spline.py b/tests/test_gvec_spline.py similarity index 100% rename from test/test_gvec_spline.py rename to tests/test_gvec_spline.py diff --git a/test/test_implementations_of_dphi.py b/tests/test_implementations_of_dphi.py similarity index 100% rename from test/test_implementations_of_dphi.py rename to tests/test_implementations_of_dphi.py diff --git a/test/test_iota_eq_dchi_dphi.py b/tests/test_iota_eq_dchi_dphi.py similarity index 100% rename from test/test_iota_eq_dchi_dphi.py rename to tests/test_iota_eq_dchi_dphi.py diff --git a/test/test_nested_maps_and_jacobians_with_meshgrid.py b/tests/test_nested_maps_and_jacobians_with_meshgrid.py similarity index 100% rename from test/test_nested_maps_and_jacobians_with_meshgrid.py rename to tests/test_nested_maps_and_jacobians_with_meshgrid.py diff --git a/test/test_paraview.py b/tests/test_paraview.py similarity index 100% rename from test/test_paraview.py rename to tests/test_paraview.py -- GitLab