2020-08-18 21:12:49 +00:00
|
|
|
# import sys
|
2020-08-18 19:00:00 +00:00
|
|
|
import json
|
2019-03-27 15:40:00 +00:00
|
|
|
import setuptools
|
2020-08-18 19:00:00 +00:00
|
|
|
|
2020-06-26 01:30:29 +00:00
|
|
|
from pathlib import Path
|
2020-08-18 21:12:49 +00:00
|
|
|
# from subprocess import check_call
|
|
|
|
# from setuptools.command.install import install
|
|
|
|
# from setuptools.command.develop import develop
|
|
|
|
# from setuptools.command.egg_info import egg_info
|
2020-08-18 19:58:05 +00:00
|
|
|
|
2019-03-27 15:40:00 +00:00
|
|
|
|
2020-06-26 01:30:29 +00:00
|
|
|
PKG_NAME = "archivebox"
|
|
|
|
REPO_URL = "https://github.com/pirate/ArchiveBox"
|
2020-08-18 21:12:49 +00:00
|
|
|
REPO_DIR = Path(__file__).parent.resolve()
|
|
|
|
PYTHON_DIR = REPO_DIR / PKG_NAME
|
|
|
|
README = (PYTHON_DIR / "README.md").read_text()
|
|
|
|
VERSION = json.loads((PYTHON_DIR / "package.json").read_text().strip())['version']
|
|
|
|
|
|
|
|
# To see when setup.py gets called (uncomment for debugging):
|
2019-03-27 19:39:30 +00:00
|
|
|
|
2020-07-02 07:53:39 +00:00
|
|
|
# import sys
|
2020-08-18 21:12:49 +00:00
|
|
|
# print(PYTHON_DIR, f" (v{VERSION})")
|
2020-07-02 07:53:39 +00:00
|
|
|
# print('>', sys.executable, *sys.argv)
|
2020-08-18 19:00:00 +00:00
|
|
|
|
2020-08-18 21:12:49 +00:00
|
|
|
# Sketchy way to install npm dependencies as a pip post-install script
|
2019-03-27 19:39:30 +00:00
|
|
|
|
2020-08-18 21:12:49 +00:00
|
|
|
# def setup_js():
|
|
|
|
# if sys.platform.lower() not in ('darwin', 'linux'):
|
|
|
|
# sys.stderr.write('[!] Warning: ArchiveBox is not officially supported on this platform.\n')
|
2020-08-18 19:58:05 +00:00
|
|
|
|
2020-08-18 21:12:49 +00:00
|
|
|
# sys.stderr.write(f'[+] Installing ArchiveBox npm package (PYTHON_DIR={PYTHON_DIR})...\n')
|
|
|
|
# try:
|
|
|
|
# check_call(f'npm install -g "{REPO_DIR}"', shell=True)
|
|
|
|
# sys.stderr.write('[√] Automatically installed npm dependencies.\n')
|
|
|
|
# except Exception as err:
|
|
|
|
# sys.stderr.write(f'[!] Failed to auto-install npm dependencies: {err}\n')
|
|
|
|
# sys.stderr.write(' Install NPM/npm using your system package manager, then run:\n')
|
|
|
|
# sys.stderr.write(' npm install -g "git+https://github.com/pirate/ArchiveBox.git\n')
|
2020-08-18 19:58:05 +00:00
|
|
|
|
|
|
|
|
2020-08-18 21:12:49 +00:00
|
|
|
# class CustomInstallCommand(install):
|
|
|
|
# def run(self):
|
|
|
|
# super().run()
|
|
|
|
# setup_js()
|
2020-08-18 19:58:05 +00:00
|
|
|
|
2020-08-18 21:12:49 +00:00
|
|
|
# class CustomDevelopCommand(develop):
|
|
|
|
# def run(self):
|
|
|
|
# super().run()
|
|
|
|
# setup_js()
|
2020-08-18 19:58:05 +00:00
|
|
|
|
2020-08-18 21:12:49 +00:00
|
|
|
# class CustomEggInfoCommand(egg_info):
|
|
|
|
# def run(self):
|
|
|
|
# super().run()
|
|
|
|
# setup_js()
|
2020-08-18 19:58:05 +00:00
|
|
|
|
2019-03-27 15:40:00 +00:00
|
|
|
setuptools.setup(
|
2020-06-26 01:30:29 +00:00
|
|
|
name=PKG_NAME,
|
2019-05-02 19:30:42 +00:00
|
|
|
version=VERSION,
|
2020-06-26 01:30:29 +00:00
|
|
|
license="MIT",
|
2019-03-27 15:40:00 +00:00
|
|
|
author="Nick Sweeting",
|
|
|
|
author_email="git@nicksweeting.com",
|
|
|
|
description="The self-hosted internet archive.",
|
2019-05-02 19:39:55 +00:00
|
|
|
long_description=README,
|
2019-03-27 15:40:00 +00:00
|
|
|
long_description_content_type="text/markdown",
|
2020-06-26 01:30:29 +00:00
|
|
|
url=REPO_URL,
|
2019-03-27 19:39:30 +00:00
|
|
|
project_urls={
|
2020-06-26 01:30:29 +00:00
|
|
|
"Source": f"{REPO_URL}",
|
|
|
|
"Documentation": f"{REPO_URL}/wiki",
|
|
|
|
"Bug Tracker": f"{REPO_URL}/issues",
|
|
|
|
"Changelog": f"{REPO_URL}/wiki/Changelog",
|
|
|
|
"Roadmap": f"{REPO_URL}/wiki/Roadmap",
|
|
|
|
"Community": f"{REPO_URL}/wiki/Web-Archiving-Community",
|
|
|
|
"Donate": f"{REPO_URL}/wiki/Donations",
|
2019-03-27 19:39:30 +00:00
|
|
|
},
|
2020-06-26 01:30:29 +00:00
|
|
|
python_requires=">=3.7",
|
2019-03-27 19:39:30 +00:00
|
|
|
install_requires=[
|
2020-07-28 03:34:35 +00:00
|
|
|
"requests==2.24.0",
|
|
|
|
"atomicwrites==1.4.0",
|
2020-06-25 21:46:11 +00:00
|
|
|
"mypy-extensions==0.4.3",
|
2019-03-27 19:39:30 +00:00
|
|
|
"base32-crockford==0.3.0",
|
2020-07-28 03:34:35 +00:00
|
|
|
"django==3.0.8",
|
|
|
|
"django-extensions==3.0.3",
|
2020-09-21 16:50:26 +00:00
|
|
|
"django-taggit==1.3.0",
|
2019-04-19 01:09:54 +00:00
|
|
|
|
2020-07-16 23:35:13 +00:00
|
|
|
"dateparser",
|
2020-06-26 01:30:29 +00:00
|
|
|
"ipython",
|
|
|
|
"youtube-dl",
|
|
|
|
"python-crontab==2.5.1",
|
2020-08-18 05:59:04 +00:00
|
|
|
"croniter==0.3.34",
|
2020-07-22 15:34:57 +00:00
|
|
|
"w3lib==1.22.0",
|
2019-04-19 01:09:54 +00:00
|
|
|
# Some/all of these will likely be added in the future:
|
|
|
|
# wpull
|
|
|
|
# pywb
|
|
|
|
# pyppeteer
|
|
|
|
# archivenow
|
2019-03-27 19:39:30 +00:00
|
|
|
],
|
2020-06-26 01:30:29 +00:00
|
|
|
extras_require={
|
|
|
|
'dev': [
|
|
|
|
"setuptools",
|
2020-07-23 16:05:54 +00:00
|
|
|
"wheel",
|
2020-06-26 01:30:29 +00:00
|
|
|
"twine",
|
|
|
|
"flake8",
|
|
|
|
"ipdb",
|
|
|
|
"mypy",
|
|
|
|
"django-stubs",
|
|
|
|
"sphinx",
|
|
|
|
"sphinx-rtd-theme",
|
|
|
|
"recommonmark",
|
2020-07-03 18:13:59 +00:00
|
|
|
"pytest",
|
2020-07-07 19:46:45 +00:00
|
|
|
"bottle",
|
2020-06-26 01:30:29 +00:00
|
|
|
],
|
|
|
|
# 'redis': ['redis', 'django-redis'],
|
|
|
|
# 'pywb': ['pywb', 'redis'],
|
|
|
|
},
|
2020-08-18 21:12:49 +00:00
|
|
|
packages=['archivebox'],
|
|
|
|
include_package_data=True, # see MANIFEST.in
|
2019-03-27 19:39:30 +00:00
|
|
|
entry_points={
|
2020-06-26 01:30:29 +00:00
|
|
|
"console_scripts": [
|
2020-07-02 07:53:39 +00:00
|
|
|
f"{PKG_NAME} = {PKG_NAME}.cli:main",
|
2019-03-27 19:39:30 +00:00
|
|
|
],
|
|
|
|
},
|
2020-08-18 21:12:49 +00:00
|
|
|
# cmdclass={
|
|
|
|
# 'install': CustomInstallCommand,
|
|
|
|
# 'develop': CustomDevelopCommand,
|
|
|
|
# 'egg_info': CustomEggInfoCommand,
|
|
|
|
# },
|
2019-03-27 15:40:00 +00:00
|
|
|
classifiers=[
|
2020-06-26 01:30:29 +00:00
|
|
|
"License :: OSI Approved :: MIT License",
|
|
|
|
"Natural Language :: English",
|
|
|
|
"Operating System :: OS Independent",
|
2019-04-26 18:42:28 +00:00
|
|
|
"Development Status :: 4 - Beta",
|
|
|
|
|
|
|
|
"Topic :: Utilities",
|
|
|
|
"Topic :: System :: Archiving",
|
|
|
|
"Topic :: System :: Archiving :: Backup",
|
|
|
|
"Topic :: System :: Recovery Tools",
|
|
|
|
"Topic :: Sociology :: History",
|
|
|
|
"Topic :: Internet :: WWW/HTTP",
|
|
|
|
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
|
|
|
|
"Topic :: Internet :: WWW/HTTP :: WSGI",
|
|
|
|
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
|
|
|
|
"Topic :: Internet :: WWW/HTTP :: WSGI :: Server",
|
|
|
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
|
|
|
|
|
|
"Intended Audience :: Developers",
|
|
|
|
"Intended Audience :: Education",
|
|
|
|
"Intended Audience :: End Users/Desktop",
|
|
|
|
"Intended Audience :: Information Technology",
|
|
|
|
"Intended Audience :: Legal Industry",
|
|
|
|
"Intended Audience :: System Administrators",
|
|
|
|
|
|
|
|
"Environment :: Console",
|
|
|
|
"Environment :: Web Environment",
|
2019-03-27 15:40:00 +00:00
|
|
|
"Programming Language :: Python :: 3",
|
2019-04-26 18:42:28 +00:00
|
|
|
"Programming Language :: Python :: 3.7",
|
|
|
|
"Programming Language :: Python :: 3.8",
|
2020-06-26 01:30:29 +00:00
|
|
|
"Framework :: Django",
|
2019-04-26 18:42:28 +00:00
|
|
|
"Typing :: Typed",
|
2019-03-27 15:40:00 +00:00
|
|
|
],
|
|
|
|
)
|