setup.py 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. # import sys
  2. import json
  3. import setuptools
  4. from pathlib import Path
  5. # from subprocess import check_call
  6. # from setuptools.command.install import install
  7. # from setuptools.command.develop import develop
  8. # from setuptools.command.egg_info import egg_info
  9. PKG_NAME = "archivebox"
  10. REPO_URL = "https://github.com/pirate/ArchiveBox"
  11. REPO_DIR = Path(__file__).parent.resolve()
  12. PYTHON_DIR = REPO_DIR / PKG_NAME
  13. README = (PYTHON_DIR / "README.md").read_text()
  14. VERSION = json.loads((PYTHON_DIR / "package.json").read_text().strip())['version']
  15. # To see when setup.py gets called (uncomment for debugging):
  16. # import sys
  17. # print(PYTHON_DIR, f" (v{VERSION})")
  18. # print('>', sys.executable, *sys.argv)
  19. # Sketchy way to install npm dependencies as a pip post-install script
  20. # def setup_js():
  21. # if sys.platform.lower() not in ('darwin', 'linux'):
  22. # sys.stderr.write('[!] Warning: ArchiveBox is not officially supported on this platform.\n')
  23. # sys.stderr.write(f'[+] Installing ArchiveBox npm package (PYTHON_DIR={PYTHON_DIR})...\n')
  24. # try:
  25. # check_call(f'npm install -g "{REPO_DIR}"', shell=True)
  26. # sys.stderr.write('[√] Automatically installed npm dependencies.\n')
  27. # except Exception as err:
  28. # sys.stderr.write(f'[!] Failed to auto-install npm dependencies: {err}\n')
  29. # sys.stderr.write(' Install NPM/npm using your system package manager, then run:\n')
  30. # sys.stderr.write(' npm install -g "git+https://github.com/pirate/ArchiveBox.git\n')
  31. # class CustomInstallCommand(install):
  32. # def run(self):
  33. # super().run()
  34. # setup_js()
  35. # class CustomDevelopCommand(develop):
  36. # def run(self):
  37. # super().run()
  38. # setup_js()
  39. # class CustomEggInfoCommand(egg_info):
  40. # def run(self):
  41. # super().run()
  42. # setup_js()
  43. setuptools.setup(
  44. name=PKG_NAME,
  45. version=VERSION,
  46. license="MIT",
  47. author="Nick Sweeting",
  48. author_email="[email protected]",
  49. description="The self-hosted internet archive.",
  50. long_description=README,
  51. long_description_content_type="text/markdown",
  52. url=REPO_URL,
  53. project_urls={
  54. "Source": f"{REPO_URL}",
  55. "Documentation": f"{REPO_URL}/wiki",
  56. "Bug Tracker": f"{REPO_URL}/issues",
  57. "Changelog": f"{REPO_URL}/wiki/Changelog",
  58. "Roadmap": f"{REPO_URL}/wiki/Roadmap",
  59. "Community": f"{REPO_URL}/wiki/Web-Archiving-Community",
  60. "Donate": f"{REPO_URL}/wiki/Donations",
  61. },
  62. python_requires=">=3.7",
  63. install_requires=[
  64. "requests==2.24.0",
  65. "atomicwrites==1.4.0",
  66. "mypy-extensions==0.4.3",
  67. "base32-crockford==0.3.0",
  68. "django==3.0.8",
  69. "django-extensions==3.0.3",
  70. "dateparser",
  71. "ipython",
  72. "youtube-dl",
  73. "python-crontab==2.5.1",
  74. "croniter==0.3.34",
  75. "w3lib==1.22.0",
  76. # Some/all of these will likely be added in the future:
  77. # wpull
  78. # pywb
  79. # pyppeteer
  80. # archivenow
  81. ],
  82. extras_require={
  83. 'dev': [
  84. "setuptools",
  85. "wheel",
  86. "twine",
  87. "flake8",
  88. "ipdb",
  89. "mypy",
  90. "django-stubs",
  91. "sphinx",
  92. "sphinx-rtd-theme",
  93. "recommonmark",
  94. "pytest",
  95. "bottle",
  96. ],
  97. # 'redis': ['redis', 'django-redis'],
  98. # 'pywb': ['pywb', 'redis'],
  99. },
  100. packages=['archivebox'],
  101. include_package_data=True, # see MANIFEST.in
  102. entry_points={
  103. "console_scripts": [
  104. f"{PKG_NAME} = {PKG_NAME}.cli:main",
  105. ],
  106. },
  107. # cmdclass={
  108. # 'install': CustomInstallCommand,
  109. # 'develop': CustomDevelopCommand,
  110. # 'egg_info': CustomEggInfoCommand,
  111. # },
  112. classifiers=[
  113. "License :: OSI Approved :: MIT License",
  114. "Natural Language :: English",
  115. "Operating System :: OS Independent",
  116. "Development Status :: 4 - Beta",
  117. "Topic :: Utilities",
  118. "Topic :: System :: Archiving",
  119. "Topic :: System :: Archiving :: Backup",
  120. "Topic :: System :: Recovery Tools",
  121. "Topic :: Sociology :: History",
  122. "Topic :: Internet :: WWW/HTTP",
  123. "Topic :: Internet :: WWW/HTTP :: Indexing/Search",
  124. "Topic :: Internet :: WWW/HTTP :: WSGI",
  125. "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
  126. "Topic :: Internet :: WWW/HTTP :: WSGI :: Server",
  127. "Topic :: Software Development :: Libraries :: Python Modules",
  128. "Intended Audience :: Developers",
  129. "Intended Audience :: Education",
  130. "Intended Audience :: End Users/Desktop",
  131. "Intended Audience :: Information Technology",
  132. "Intended Audience :: Legal Industry",
  133. "Intended Audience :: System Administrators",
  134. "Environment :: Console",
  135. "Environment :: Web Environment",
  136. "Programming Language :: Python :: 3",
  137. "Programming Language :: Python :: 3.7",
  138. "Programming Language :: Python :: 3.8",
  139. "Framework :: Django",
  140. "Typing :: Typed",
  141. ],
  142. )