setup.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. from setuptools import setup
  2. import setuptools.command.build_py
  3. def readme():
  4. with open('README.rst') as f:
  5. return f.read()
  6. class BuildTestCommand(setuptools.command.build_py.build_py):
  7. """Custom build command."""
  8. def run(self):
  9. # run tests using doctest
  10. import doctest
  11. from ipfml import processing
  12. from ipfml import metrics
  13. from ipfml.filters import noise as noise_filters
  14. print("==============================")
  15. print("Runs test command...")
  16. doctest.testmod(processing)
  17. doctest.testmod(metrics)
  18. doctest.testmod(noise_filters)
  19. # Run format code using ypaf
  20. try:
  21. print("==============================")
  22. print("Runs format code command...")
  23. self.spawn(['yapf', '-ir', '-vv', 'ipfml'])
  24. except RuntimeError:
  25. self.warn('Format pakcage code failed')
  26. setuptools.command.build_py.build_py.run(self)
  27. setup(
  28. name='ipfml',
  29. version='0.2.5',
  30. description='Image Processing For Machine Learning',
  31. long_description=readme(),
  32. classifiers=[
  33. 'Development Status :: 3 - Alpha',
  34. 'License :: OSI Approved :: MIT License',
  35. 'Programming Language :: Python :: 3.6',
  36. 'Topic :: Scientific/Engineering :: Artificial Intelligence'
  37. ],
  38. url='https://gogs.univ-littoral.fr/jerome.buisine/IPFML',
  39. author='Jérôme BUISINE',
  40. author_email='jerome.buisine@univ-littoral.fr',
  41. license='MIT',
  42. packages=['ipfml', 'ipfml/filters'],
  43. install_requires=[
  44. 'matplotlib',
  45. 'numpy',
  46. 'Pillow',
  47. 'sklearn',
  48. 'scikit-image',
  49. 'scipy',
  50. 'opencv-python',
  51. 'scipy',
  52. 'yapf'
  53. ],
  54. cmdclass={
  55. 'build_py': BuildTestCommand,
  56. },
  57. zip_safe=False)