setup.py 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # coding=utf-8
  2. # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. """Setup for pip package."""
  16. import os
  17. import sys
  18. import setuptools
  19. if sys.version_info < (3,):
  20. raise Exception("Python 2 is not supported by Megatron.")
  21. from megatron.package_info import (
  22. __description__,
  23. __contact_names__,
  24. __url__,
  25. __download_url__,
  26. __keywords__,
  27. __license__,
  28. __package_name__,
  29. __version__,
  30. )
  31. with open("README.md", "r") as fh:
  32. long_description = fh.read()
  33. ###############################################################################
  34. # Dependency Loading #
  35. # %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #
  36. def req_file(filename):
  37. with open(filename) as f:
  38. content = f.readlines()
  39. return [x.strip() for x in content]
  40. install_requires = req_file("requirements.txt")
  41. setuptools.setup(
  42. name=__package_name__,
  43. # Versions should comply with PEP440. For a discussion on single-sourcing
  44. # the version across setup.py and the project code, see
  45. # https://packaging.python.org/en/latest/single_source_version.html
  46. version=__version__,
  47. description=__description__,
  48. long_description=long_description,
  49. long_description_content_type="text/markdown",
  50. # The project's main homepage.
  51. url=__url__,
  52. author=__contact_names__,
  53. maintainer=__contact_names__,
  54. # The licence under which the project is released
  55. license=__license__,
  56. classifiers=[
  57. 'Intended Audience :: Developers',
  58. 'Intended Audience :: Science/Research',
  59. 'Intended Audience :: Information Technology',
  60. # Indicate what your project relates to
  61. 'Topic :: Scientific/Engineering :: Artificial Intelligence',
  62. 'Topic :: Software Development :: Libraries :: Python Modules',
  63. # Supported python versions
  64. 'Programming Language :: Python :: 3.6',
  65. 'Programming Language :: Python :: 3.7',
  66. 'Programming Language :: Python :: 3.8',
  67. # Additional Setting
  68. 'Environment :: Console',
  69. 'Natural Language :: English',
  70. 'Operating System :: OS Independent',
  71. ],
  72. python_requires='>=3.6',
  73. packages=setuptools.find_packages(),
  74. install_requires=install_requires,
  75. # Add in any packaged data.
  76. include_package_data=True,
  77. zip_safe=False,
  78. # PyPI package information.
  79. keywords=__keywords__
  80. )