PageRenderTime 137ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/Python/Product/Pyvot/Pyvot/setup.py

https://gitlab.com/SplatoonModdingHub/PTVS
Python | 95 lines | 58 code | 13 blank | 24 comment | 10 complexity | 16161a681742458a029344f91e8467ad MD5 | raw file
  1. # PyVot
  2. # Copyright(c) Microsoft Corporation
  3. # All rights reserved.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the License); you may not use
  6. # this file except in compliance with the License. You may obtain a copy of the
  7. # License at http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
  10. # OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
  11. # IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  12. # MERCHANTABLITY OR NON-INFRINGEMENT.
  13. #
  14. # See the Apache Version 2.0 License for specific language governing
  15. # permissions and limitations under the License.
  16. #
  17. # This file must work in both Python 2 and 3 as-is (without applying 2to3)
  18. #
  19. import sys
  20. # If setuptools available, we normally want to install dependencies. The --no-downloads flag
  21. # allows the PTVS installer to prevent this, to avoid network-related failure cases
  22. allow_downloads = True
  23. no_downloads_flag = '--no-downloads'
  24. if no_downloads_flag in sys.argv:
  25. sys.argv.remove(no_downloads_flag)
  26. allow_downloads = False
  27. try:
  28. from setuptools import setup, Distribution
  29. use_setuptools = True
  30. except ImportError:
  31. from distutils.core import setup, Distribution
  32. use_setuptools = False
  33. running_python3 = sys.version_info.major > 2
  34. # Sets __version__ as a global without importing xl's __init__. We might not have pywin32 yet.
  35. with open(r'.\xl\version.py') as version_file:
  36. exec(version_file.read(), globals())
  37. class PyvotDistribution(Distribution):
  38. def find_config_files(self):
  39. configs = Distribution.find_config_files(self)
  40. configs.append("setup.py3.cfg" if running_python3 else "setup.py2.cfg")
  41. return configs
  42. long_description = \
  43. """Pyvot connects familiar data-exploration and visualization tools in Excel with the powerful data analysis
  44. and transformation capabilities of Python, with an emphasis on tabular data. It provides a minimal and Pythonic
  45. interface to Excel, smoothing over the pain points in using the existing Excel object model as exposed via COM."""
  46. setup_options = dict(
  47. name="Pyvot",
  48. version=__version__,
  49. author="Microsoft Corporation",
  50. author_email="ptvshelp@microsoft.com",
  51. license="Apache License 2.0",
  52. description="Pythonic interface for data exploration in Excel",
  53. long_description=long_description,
  54. download_url="http://pypi.python.org/pypi/Pyvot",
  55. url="http://pytools.codeplex.com/wikipage?title=Pyvot",
  56. classifiers=[
  57. 'Development Status :: 4 - Beta',
  58. 'Environment :: Win32 (MS Windows)',
  59. 'Operating System :: Microsoft :: Windows',
  60. 'Programming Language :: Python',
  61. 'Programming Language :: Python :: 2',
  62. 'Programming Language :: Python :: 3',
  63. 'Topic :: Office/Business :: Financial :: Spreadsheet',
  64. 'License :: OSI Approved :: Apache Software License'],
  65. packages=['xl', 'xl._impl'],
  66. distclass=PyvotDistribution
  67. )
  68. if running_python3:
  69. use_2to3 = True
  70. from distutils.command.build_py import build_py_2to3
  71. setup_options.update(dict(
  72. cmdclass={'build_py': build_py_2to3}
  73. ))
  74. if use_setuptools:
  75. setup_options.update(dict(
  76. zip_safe=True
  77. ))
  78. if use_setuptools and allow_downloads:
  79. setup_options.update(dict(
  80. setup_requires=["Sphinx"],
  81. ))
  82. setup(**setup_options)