Skip to content

Commit

Permalink
Use setup.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
t20100 committed May 24, 2023
1 parent 3dd5120 commit 6d6ea0d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 83 deletions.
60 changes: 60 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[metadata]
name = silx
version = attr: silx._version.strictversion
url = http://www.silx.org/
author = data analysis unit
author_email = [email protected]
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
84 changes: 1 addition & 83 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 #
# ############## #
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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="[email protected]",
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,
)


Expand Down

0 comments on commit 6d6ea0d

Please sign in to comment.