setup.py 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. from ipfml.iqa import fr as fr_iqa
  15. print("==============================")
  16. print("Runs test command...")
  17. doctest.testmod(processing)
  18. doctest.testmod(metrics)
  19. doctest.testmod(noise_filters)
  20. doctest.testmod(fr_iqa)
  21. # Run format code using ypaf
  22. try:
  23. print("==============================")
  24. print("Runs format code command...")
  25. self.spawn(['yapf', '-ir', '-vv', 'ipfml'])
  26. except RuntimeError:
  27. self.warn('Format pakcage code failed')
  28. setuptools.command.build_py.build_py.run(self)
  29. setup(
  30. name='ipfml',
  31. version='0.2.7',
  32. description='Image Processing For Machine Learning',
  33. long_description=readme(),
  34. classifiers=[
  35. 'Development Status :: 3 - Alpha',
  36. 'License :: OSI Approved :: MIT License',
  37. 'Programming Language :: Python :: 3.6',
  38. 'Topic :: Scientific/Engineering :: Artificial Intelligence'
  39. ],
  40. url='https://github.com/jbuisine/IPFML',
  41. author='Jérôme BUISINE',
  42. author_email='jerome.buisine@univ-littoral.fr',
  43. license='MIT',
  44. packages=['ipfml', 'ipfml/filters', 'ipfml/iqa'],
  45. install_requires=[
  46. 'matplotlib',
  47. 'numpy',
  48. 'Pillow',
  49. 'sklearn',
  50. 'scikit-image',
  51. 'scipy',
  52. 'opencv-python',
  53. 'scipy',
  54. 'yapf'
  55. ],
  56. cmdclass={
  57. 'build_py': BuildTestCommand,
  58. },
  59. zip_safe=False)