2020-08-18 19:00:00 +00:00
|
|
|
import json
|
2019-03-27 15:40:00 +00:00
|
|
|
import setuptools
|
2021-02-01 10:13:46 +00:00
|
|
|
from setuptools.command.test import test
|
2020-08-18 19:00:00 +00:00
|
|
|
|
2020-06-26 01:30:29 +00:00
|
|
|
from pathlib import Path
|
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"
|
2020-10-31 07:08:41 +00:00
|
|
|
DESCRIPTION = "The self-hosted internet archive."
|
|
|
|
LICENSE = "MIT"
|
|
|
|
AUTHOR = "Nick Sweeting"
|
|
|
|
AUTHOR_EMAIL="git@nicksweeting.com"
|
2020-11-23 07:04:39 +00:00
|
|
|
REPO_URL = "https://github.com/ArchiveBox/ArchiveBox"
|
2020-10-31 07:08:41 +00:00
|
|
|
PROJECT_URLS = {
|
|
|
|
"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",
|
|
|
|
}
|
|
|
|
|
|
|
|
ROOT_DIR = Path(__file__).parent.resolve()
|
|
|
|
PACKAGE_DIR = ROOT_DIR / PKG_NAME
|
|
|
|
|
2020-12-11 16:54:26 +00:00
|
|
|
README = (PACKAGE_DIR / "README.md").read_text(encoding='utf-8', errors='ignore')
|
2020-10-31 07:08:41 +00:00
|
|
|
VERSION = json.loads((PACKAGE_DIR / "package.json").read_text().strip())['version']
|
2020-08-18 21:12:49 +00:00
|
|
|
|
2021-02-15 19:51:32 +00:00
|
|
|
PYTHON_REQUIRES = ">=3.7"
|
|
|
|
SETUP_REQUIRES = ["wheel"]
|
|
|
|
INSTALL_REQUIRES = [
|
|
|
|
# only add things here that have corresponding apt python3-packages available
|
|
|
|
# anything added here also needs to be added to our package dependencies in
|
|
|
|
# stdeb.cfg (apt), archivebox.rb (brew), Dockerfile, etc.
|
|
|
|
# if there is no apt python3-package equivalent, then vendor it instead in
|
|
|
|
# ./archivebox/vendor/
|
|
|
|
"requests>=2.24.0",
|
|
|
|
"mypy-extensions>=0.4.3",
|
2021-04-10 10:22:07 +00:00
|
|
|
"django>=3.1.3,<3.2",
|
2021-02-15 19:51:32 +00:00
|
|
|
"django-extensions>=3.0.3",
|
|
|
|
"dateparser",
|
|
|
|
"ipython",
|
|
|
|
"youtube-dl",
|
|
|
|
"python-crontab>=2.5.1",
|
|
|
|
"croniter>=0.3.34",
|
|
|
|
"w3lib>=1.22.0",
|
|
|
|
]
|
|
|
|
EXTRAS_REQUIRE = {
|
|
|
|
'sonic': [
|
|
|
|
"sonic-client>=0.0.5",
|
|
|
|
],
|
|
|
|
'dev': [
|
|
|
|
"setuptools",
|
|
|
|
"twine",
|
|
|
|
"wheel",
|
|
|
|
"flake8",
|
|
|
|
"ipdb",
|
|
|
|
"mypy",
|
|
|
|
"django-stubs",
|
|
|
|
"sphinx",
|
|
|
|
"sphinx-rtd-theme",
|
|
|
|
"recommonmark",
|
|
|
|
"pytest",
|
|
|
|
"bottle",
|
|
|
|
"stdeb",
|
2021-02-16 07:50:05 +00:00
|
|
|
"django-debug-toolbar",
|
2021-02-16 20:50:39 +00:00
|
|
|
"djdt_flamegraph",
|
2021-02-15 19:51:32 +00:00
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2020-08-18 21:12:49 +00:00
|
|
|
# To see when setup.py gets called (uncomment for debugging):
|
2020-07-02 07:53:39 +00:00
|
|
|
# import sys
|
2020-10-31 07:08:41 +00:00
|
|
|
# print(PACKAGE_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 19:58:05 +00:00
|
|
|
|
2021-02-08 17:14:09 +00:00
|
|
|
class DisabledTestCommand(test):
|
2021-02-01 10:13:46 +00:00
|
|
|
def run(self):
|
|
|
|
# setup.py test is deprecated, disable it here by force so stdeb doesnt run it
|
2021-02-15 19:51:32 +00:00
|
|
|
print()
|
|
|
|
print('[X] Running tests via setup.py test is deprecated.')
|
|
|
|
print(' Hint: Use the ./bin/test.sh script or pytest instead')
|
2021-02-01 10:13:46 +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-10-31 07:08:41 +00:00
|
|
|
license=LICENSE,
|
|
|
|
author=AUTHOR,
|
|
|
|
author_email=AUTHOR_EMAIL,
|
|
|
|
description=DESCRIPTION,
|
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,
|
2020-10-31 07:08:41 +00:00
|
|
|
project_urls=PROJECT_URLS,
|
2021-02-15 19:51:32 +00:00
|
|
|
python_requires=PYTHON_REQUIRES,
|
|
|
|
setup_requires=SETUP_REQUIRES,
|
|
|
|
install_requires=INSTALL_REQUIRES,
|
|
|
|
extras_require=EXTRAS_REQUIRE,
|
2020-10-31 07:08:41 +00:00
|
|
|
packages=[PKG_NAME],
|
2020-08-18 21:12:49 +00:00
|
|
|
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
|
|
|
],
|
|
|
|
},
|
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 :: Application",
|
|
|
|
"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
|
|
|
],
|
2021-02-01 10:13:46 +00:00
|
|
|
cmdclass={
|
2021-02-08 17:14:09 +00:00
|
|
|
"test": DisabledTestCommand,
|
2021-02-01 10:13:46 +00:00
|
|
|
},
|
2019-03-27 15:40:00 +00:00
|
|
|
)
|