setup.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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("Run 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("Run format code command...")
  23. self.spawn(['yapf', '-ir', '-vv', 'ipfml'])
  24. except RuntimeError:
  25. self.warn('format pakcage code failed')
  26. # Run update auto generated documentation
  27. try:
  28. print("==============================")
  29. print("Run update of auto generated documentation...")
  30. self.spawn(['bash', './build.sh'])
  31. except RuntimeError:
  32. self.warn('Error during documentation rendering')
  33. setuptools.command.build_py.build_py.run(self)
  34. setup(
  35. name='ipfml',
  36. version='0.2.0',
  37. description='Image Processing For Machine Learning',
  38. long_description=readme(),
  39. classifiers=[
  40. 'Development Status :: 3 - Alpha',
  41. 'License :: OSI Approved :: MIT License',
  42. 'Programming Language :: Python :: 3.6',
  43. 'Topic :: Scientific/Engineering :: Artificial Intelligence'
  44. ],
  45. url='https://gogs.univ-littoral.fr/jerome.buisine/IPFML',
  46. author='Jérôme BUISINE',
  47. author_email='jerome.buisine@univ-littoral.fr',
  48. license='MIT',
  49. packages=['ipfml'],
  50. install_requires=[
  51. 'matplotlib',
  52. 'numpy',
  53. 'Pillow',
  54. 'sklearn',
  55. 'scikit-image',
  56. 'scipy',
  57. 'opencv-python',
  58. 'scipy',
  59. 'yapf'
  60. ],
  61. cmdclass={
  62. 'build_py': BuildTestCommand,
  63. },
  64. zip_safe=False)