From 1097c414d098f1cbb533fd4188369b58bfe43f18 Mon Sep 17 00:00:00 2001 From: Angel Ferran Pousa Date: Mon, 22 Feb 2021 22:50:10 +0100 Subject: [PATCH] Change to using setup.cfg and .toml file --- aptools/__init__.py | 2 +- aptools/__version__.py | 1 - pyproject.toml | 3 +++ requirements.txt | 4 ---- setup.cfg | 26 ++++++++++++++++++++++++++ setup.py | 37 +++---------------------------------- 6 files changed, 33 insertions(+), 40 deletions(-) delete mode 100644 aptools/__version__.py create mode 100644 pyproject.toml delete mode 100644 requirements.txt create mode 100644 setup.cfg diff --git a/aptools/__init__.py b/aptools/__init__.py index eb69b33..309f659 100644 --- a/aptools/__init__.py +++ b/aptools/__init__.py @@ -1,4 +1,4 @@ -from .__version__ import __version__ from .data_analysis import beam_diagnostics +__version__ = "0.1.17" __all__ = ['beam_diagnostics', '__version__'] diff --git a/aptools/__version__.py b/aptools/__version__.py deleted file mode 100644 index 86205cb..0000000 --- a/aptools/__version__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.1.17" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9787c3b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 275ac42..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -numpy -scipy -h5py -openpmd-api~=0.13.0 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..d2c6008 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,26 @@ +[metadata] +name = APtools +version = attr: aptools.__version__ +description = A collection of tools for accelerator physics +long_description = file: README.md +long_description_content_type = text/markdown; charset=UTF-8 +url = https://github.com/AngelFP/APtools +author = Angel Ferran Pousa +author_email = angel.ferran.pousa@desy.de, +license = GPLv3 +license_file = LICENSE +classifiers = + Development Status :: 3 - Alpha + Programming Language :: Python :: 3 + Intended Audience :: Science/Research + Topic :: Scientific/Engineering :: Physics + License :: OSI Approved :: GNU General Public License v3 (GPLv3) + Operating System :: OS Independent + +[options] +packages = find: +install_requires = + numpy + scipy + h5py + openpmd-api~=0.13.0 diff --git a/setup.py b/setup.py index 35b7c57..1abbd06 100644 --- a/setup.py +++ b/setup.py @@ -1,35 +1,4 @@ -from setuptools import setup, find_packages +import setuptools -from aptools.__version__ import __version__ - -# Read long description -with open("README.md", "r") as fh: - long_description = fh.read() - - -def read_requirements(): - with open('requirements.txt') as f: - return [line.strip() for line in f.readlines()] - - -# Main setup command -setup(name='APtools', - version=__version__, - author='Angel Ferran Pousa', - author_email="angel.ferran.pousa@desy.de", - description='A collection of tools for accelerator physics', - long_description=long_description, - long_description_content_type="text/markdown", - url='https://github.com/AngelFP/APtools', - license='GPLv3', - packages=find_packages('.'), - install_requires=read_requirements(), - platforms='any', - classifiers=( - "Development Status :: 3 - Alpha", - "Programming Language :: Python :: 3", - "Intended Audience :: Science/Research", - "Topic :: Scientific/Engineering :: Physics", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Operating System :: OS Independent"), - ) +if __name__ == "__main__": + setuptools.setup()