setup.py 1.9 KB

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