diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000000..c4bec230f7 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,60 @@ +[metadata] +name = silx +version = attr: silx._version.strictversion +url = http://www.silx.org/ +author = data analysis unit +author_email = silx@esrf.fr +description = Software library for X-ray data analysis +long_description = file: README.rst +license = MIT +classifiers = + Development Status :: 5 - Production/Stable + Environment :: Console + Environment :: MacOS X + Environment :: Win32 (MS Windows) + Environment :: X11 Applications :: Qt + Intended Audience :: Education + Intended Audience :: Science/Research + License :: OSI Approved :: MIT License + Natural Language :: English + Operating System :: MacOS + Operating System :: Microsoft :: Windows + Operating System :: POSIX + Programming Language :: Cython + Programming Language :: Python :: 3 + Programming Language :: Python :: Implementation :: CPython + Topic :: Scientific/Engineering :: Physics + Topic :: Software Development :: Libraries :: Python Modules + +[options] +zip_safe = False +python_requires = >=3.7 +packages = find: +package_dir = + =src + silx.examples = examples + +[options.entry_points] +console_scripts = + silx = silx.__main__:main + +[options.packages.find] +where = src +include = silx* + +[options.package_data] +# Resources files for silx +silx.resources = + gui/logo/*.png + gui/logo/*.svg + gui/icons/*.png + gui/icons/*.svg + gui/icons/*.mng + gui/icons/*.gif + gui/icons/*/*.png + opencl/*.cl + opencl/image/*.cl + opencl/sift/*.cl + opencl/codec/*.cl + gui/colormaps/*.npy +silx.examples = *.png diff --git a/setup.py b/setup.py index b87baad7c0..a1666ab247 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ logger = logging.getLogger("silx.setup") -from setuptools import Extension, find_packages +from setuptools import Extension from setuptools.command.build_ext import build_ext try: @@ -60,45 +60,6 @@ """) -def get_version(): - """Returns current version number from _version.py file""" - dirname = os.path.join( - os.path.dirname(os.path.abspath(__file__)), "src", PROJECT) - sys.path.insert(0, dirname) - import _version - sys.path = sys.path[1:] - return _version.strictversion - - -def get_readme(): - """Returns content of README.rst file""" - dirname = os.path.dirname(os.path.abspath(__file__)) - filename = os.path.join(dirname, "README.rst") - with open(filename, "r", encoding="utf-8") as fp: - long_description = fp.read() - return long_description - - -classifiers = ["Development Status :: 5 - Production/Stable", - "Environment :: Console", - "Environment :: MacOS X", - "Environment :: Win32 (MS Windows)", - "Environment :: X11 Applications :: Qt", - "Intended Audience :: Education", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Operating System :: MacOS", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX", - "Programming Language :: Cython", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: Implementation :: CPython", - "Topic :: Scientific/Engineering :: Physics", - "Topic :: Software Development :: Libraries :: Python Modules", - ] - - # ############## # # Compiler flags # # ############## # @@ -251,31 +212,6 @@ def get_project_configuration(): for package_name in install_requires_strip.split(','): install_requires.remove(package_name) - - package_data = { - # Resources files for silx - 'silx.resources': [ - 'gui/logo/*.png', - 'gui/logo/*.svg', - 'gui/icons/*.png', - 'gui/icons/*.svg', - 'gui/icons/*.mng', - 'gui/icons/*.gif', - 'gui/icons/*/*.png', - 'opencl/*.cl', - 'opencl/image/*.cl', - 'opencl/sift/*.cl', - 'opencl/codec/*.cl', - 'gui/colormaps/*.npy'], - 'silx.examples': ['*.png'], - } - - entry_points = { - 'console_scripts': ['silx = silx.__main__:main'], - # 'gui_scripts': [], - } - - def silx_io_specfile_define_macros(): # Locale and platform management if sys.platform == "win32": @@ -449,28 +385,10 @@ def silx_io_specfile_define_macros(): ] return dict( - name=PROJECT, - version=get_version(), - license="MIT", - url="http://www.silx.org/", - author="data analysis unit", - author_email="silx@esrf.fr", - classifiers=classifiers, - description="Software library for X-ray data analysis", - long_description=get_readme(), install_requires=install_requires, extras_require=extras_require, - python_requires='>=3.7', cmdclass=dict(build_ext=BuildExt), - zip_safe=False, - entry_points=entry_points, - packages=find_packages(where='src', include=['silx*']) + ['silx.examples'], - package_dir={ - "": "src", - "silx.examples": "examples", - }, ext_modules=ext_modules, - package_data=package_data, )