From b4c6ca64fcfabdd98a8819e44281edeb1dbc3cdc Mon Sep 17 00:00:00 2001 From: Daniel Otto de Mentock Date: Mon, 25 Apr 2022 12:00:54 +0200 Subject: [PATCH] replaced setup.py with setup.cfg file modified .gitlab-ci.yml file to strip away "v" from git describe result --- .gitlab-ci.yml | 3 ++- python/setup.cfg | 31 +++++++++++++++++++++++++++++++ python/setup.py | 36 ------------------------------------ 3 files changed, 33 insertions(+), 37 deletions(-) create mode 100644 python/setup.cfg delete mode 100644 python/setup.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3c736136c..89c22a2f8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -233,7 +233,8 @@ update_revision: - cd $(mktemp -d) - git clone -q git@git.damask.mpie.de:damask/DAMASK.git . - git pull - - export VERSION=$(git describe ${CI_COMMIT_SHA}) + - VERSION=$(git describe ${CI_COMMIT_SHA}) + - export VERSION="${VERSION:1:-1}" - echo ${VERSION} > python/damask/VERSION - > git diff-index --quiet HEAD || diff --git a/python/setup.cfg b/python/setup.cfg new file mode 100644 index 000000000..89a3cacf5 --- /dev/null +++ b/python/setup.cfg @@ -0,0 +1,31 @@ +[metadata] +name = damask +version = file: damask/VERSION +author = The DAMASK team +author_email = damask@mpie.de +url = https://damask.mpie.de +description = DAMASK processing tools +long_description = Pre- and post-processing tools for DAMASK +license: AGPL3 +classifiers = + Intended Audience :: Science/Research + Topic :: Scientific/Engineering + Programming Language :: Python :: 3 + License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+) + Operating System :: OS Independent + +[options] +packages = damask +zip_safe = false +include_package_data = true +python_requires = >= 3.8 +install_requires = + importlib-metadata; python_version<"3.8" + pandas; python_version<="0.24" # requires numpy + numpy; python_version<="1.17" # needed for default_rng + scipy; python_version<="1.2" + h5py; python_version<="2.9" # requires numpy + vtk; python_version<="8.1" + matplotlib; python_version<="3.0" # requires numpy, pillow + pyyaml; python_version<="3.12" +setup_requires = setuptools diff --git a/python/setup.py b/python/setup.py deleted file mode 100644 index abb8053a9..000000000 --- a/python/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -import setuptools -from pathlib import Path -import re - -# https://www.python.org/dev/peps/pep-0440 -with open(Path(__file__).parent/'damask/VERSION') as f: - version = re.sub(r'(-([^-]*)).*$',r'.\2',re.sub(r'^v(\d+\.\d+(\.\d+)?)',r'\1',f.readline().strip())) - -setuptools.setup( - name='damask', - version=version, - author='The DAMASK team', - author_email='damask@mpie.de', - description='DAMASK processing tools', - long_description='Pre- and post-processing tools for DAMASK', - url='https://damask.mpie.de', - packages=setuptools.find_packages(), - include_package_data=True, - python_requires = '>=3.8', - install_requires = [ - 'pandas>=0.24', # requires numpy - 'numpy>=1.17', # needed for default_rng - 'scipy>=1.2', - 'h5py>=2.9', # requires numpy - 'vtk>=8.1', - 'matplotlib>=3.0', # requires numpy, pillow - 'pyyaml>=3.12' - ], - classifiers = [ - 'Intended Audience :: Science/Research', - 'Topic :: Scientific/Engineering', - 'Programming Language :: Python :: 3', - 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', - 'Operating System :: OS Independent', - ], -)