setup.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/usr/bin/env python
  2. """Setup script for packaging openpyxl.
  3. To build a package for distribution:
  4. python setup.py sdist
  5. and upload it to the PyPI with:
  6. python setup.py upload
  7. Install a link for development work:
  8. pip install -e .
  9. Thee manifest.in file is used for data files.
  10. """
  11. import os
  12. from setuptools import setup, find_packages
  13. here = os.path.abspath(os.path.dirname(__file__))
  14. try:
  15. with open(os.path.join(here, 'README.rst')) as f:
  16. README = f.read()
  17. except IOError:
  18. README = ''
  19. try:
  20. from importlib.util import module_from_spec, spec_from_file_location
  21. spec = spec_from_file_location("constants", "./openpyxl/_constants.py")
  22. constants = module_from_spec(spec)
  23. spec.loader.exec_module(constants)
  24. except ImportError:
  25. # python2.7
  26. import imp
  27. constants = imp.load_source("constants", "./openpyxl/_constants.py")
  28. __author__ = constants.__author__
  29. __author_email__ = constants.__author_email__
  30. __license__ = constants.__license__
  31. __maintainer_email__ = constants.__maintainer_email__
  32. __url__ = constants.__url__
  33. __version__ = constants.__version__
  34. setup(
  35. name='openpyxl',
  36. packages=find_packages(
  37. exclude=["*.tests", "*.test_.*", "test_.*", "tests", "develop"]
  38. ),
  39. package_dir={},
  40. # metadata
  41. version=__version__,
  42. description="A Python library to read/write Excel 2010 xlsx/xlsm files",
  43. long_description=README,
  44. author=__author__,
  45. author_email=__author_email__,
  46. url=__url__,
  47. license=__license__,
  48. python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
  49. install_requires=[
  50. 'jdcal', 'et_xmlfile',
  51. ],
  52. project_urls={
  53. 'Documentation': 'https://openpyxl.readthedocs.io/en/stable/',
  54. 'Source': 'https://bitbucket.org/openpyxl/openpyxl',
  55. 'Tracker': 'https://bitbucket.org/openpyxl/openpyxl/issues',
  56. },
  57. classifiers=[
  58. 'Development Status :: 5 - Production/Stable',
  59. 'Operating System :: MacOS :: MacOS X',
  60. 'Operating System :: Microsoft :: Windows',
  61. 'Operating System :: POSIX',
  62. 'License :: OSI Approved :: MIT License',
  63. 'Programming Language :: Python',
  64. 'Programming Language :: Python :: 2.7',
  65. 'Programming Language :: Python :: 3.5',
  66. 'Programming Language :: Python :: 3.6',
  67. 'Programming Language :: Python :: 3.7',
  68. ],
  69. )