-
Notifications
You must be signed in to change notification settings - Fork 360
/
setup.py
100 lines (86 loc) · 3.03 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import sys
from distutils.cmd import Command
from setuptools import find_packages, setup
import versioneer
if sys.version_info[0] < 3:
readme = None
else:
with open("README.md", encoding="utf8") as f:
readme = f.read()
class GenerateDataverseInstallationsFileCommand(Command):
description = "Generate Dataverse installations data map"
user_options = []
def initialize_options(self):
self.url = (
"https://services.dataverse.harvard.edu/miniverse/map/installations-json"
)
def finalize_options(self):
pass
def run(self):
import json
from urllib.request import urlopen
resp = urlopen(self.url, timeout=5)
resp_body = resp.read()
data = json.loads(resp_body.decode("utf-8"))
if "installations" not in data:
raise ValueError("Malformed installation map.")
def get_identifier(json):
return int(json["id"])
data["installations"].sort(key=get_identifier)
with open("repo2docker/contentproviders/dataverse.json", "w") as fp:
json.dump(data, fp, indent=4, sort_keys=True)
__cmdclass = versioneer.get_cmdclass()
__cmdclass["generate_dataverse_file"] = GenerateDataverseInstallationsFileCommand
setup(
name="jupyter-repo2docker",
version=versioneer.get_version(),
install_requires=[
"chardet",
"docker!=5.0.0",
"entrypoints",
"escapism",
"iso8601",
"jinja2",
"python-json-logger",
"requests",
"ruamel.yaml>=0.15",
"semver",
"toml",
"traitlets",
],
python_requires=">=3.6",
author="Project Jupyter Contributors",
author_email="[email protected]",
url="https://repo2docker.readthedocs.io/en/latest/",
project_urls={
"Documentation": "https://repo2docker.readthedocs.io",
"Funding": "https://jupyter.org/about",
"Source": "https://github.com/jupyterhub/repo2docker/",
"Tracker": "https://github.com/jupyterhub/repo2docker/issues",
},
# this should be a whitespace separated string of keywords, not a list
keywords="reproducible science environments docker",
description="Repo2docker: Turn code repositories into Jupyter enabled Docker Images",
long_description=readme,
long_description_content_type="text/markdown",
license="BSD",
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
],
packages=find_packages(),
include_package_data=True,
cmdclass=__cmdclass,
entry_points={
"console_scripts": [
"jupyter-repo2docker = repo2docker.__main__:main",
"repo2docker = repo2docker.__main__:main",
],
"repo2docker.engines": ["docker = repo2docker.docker:DockerEngine"],
},
)