setup.py 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. # filters folder
  12. from ipfml.filters import noise as noise_filters
  13. from ipfml.filters import kernels as kernels_filters
  14. from ipfml.filters import convolution as convolution_filters
  15. # iqa folder
  16. from ipfml.iqa import fr as fr_iqa
  17. # metrics folder
  18. from ipfml import metrics
  19. # processing folder
  20. from ipfml.processing import compression as compression_processing
  21. from ipfml.processing import movement as movement_processing
  22. from ipfml.processing import reconstruction as reconstruction_processing
  23. from ipfml.processing import segmentation as segmentation_processing
  24. from ipfml.processing import transform as transform_processing
  25. # utils
  26. from ipfml import utils
  27. print("==============================")
  28. print("Runs test command...")
  29. # noise folder
  30. doctest.testmod(noise_filters)
  31. doctest.testmod(kernels_filters)
  32. doctest.testmod(convolution_filters)
  33. # iqa folder
  34. doctest.testmod(fr_iqa)
  35. # metrics folder
  36. doctest.testmod(metrics)
  37. # processing folder
  38. doctest.testmod(compression_processing)
  39. doctest.testmod(movement_processing)
  40. doctest.testmod(reconstruction_processing)
  41. doctest.testmod(segmentation_processing)
  42. doctest.testmod(transform_processing)
  43. # utils
  44. doctest.testmod(utils)
  45. setuptools.command.build_py.build_py.run(self)
  46. setup(
  47. name='ipfml',
  48. version='0.4.6',
  49. description='Image Processing For Machine Learning',
  50. long_description=readme(),
  51. classifiers=[
  52. 'Development Status :: 4 - Beta',
  53. 'License :: OSI Approved :: MIT License',
  54. 'Programming Language :: Python :: 3.6',
  55. 'Topic :: Scientific/Engineering :: Artificial Intelligence'
  56. ],
  57. url='https://github.com/prise-3d/ipfml',
  58. author='Jérôme BUISINE',
  59. author_email='jerome.buisine@univ-littoral.fr',
  60. license='MIT',
  61. packages=['ipfml', 'ipfml/filters', 'ipfml/iqa', 'ipfml/processing'],
  62. install_requires=[
  63. 'numpy',
  64. 'Pillow',
  65. 'sklearn',
  66. 'scikit-image',
  67. 'scipy',
  68. 'opencv-python',
  69. 'scipy',
  70. ],
  71. cmdclass={
  72. 'build_py': BuildTestCommand,
  73. },
  74. zip_safe=False)