repo2docker/setup.py

101 wiersze
3.0 KiB
Python

import sys
from distutils.cmd import Command
from setuptools import find_packages, setup
2018-07-02 20:03:53 +00:00
import versioneer
2017-05-09 08:46:26 +00:00
if sys.version_info[0] < 3:
readme = None
else:
with open("README.md", encoding="utf8") as f:
readme = f.read()
2018-09-09 05:50:37 +00:00
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
2017-05-09 08:46:26 +00:00
setup(
name="jupyter-repo2docker",
2018-07-02 20:03:53 +00:00
version=versioneer.get_version(),
2017-05-09 08:46:26 +00:00
install_requires=[
2021-07-14 17:18:23 +00:00
"chardet",
2021-07-28 11:58:08 +00:00
"docker!=5.0.0",
"entrypoints",
"escapism",
"iso8601",
"jinja2",
"python-json-logger",
"requests",
"ruamel.yaml>=0.15",
"semver",
"toml",
"traitlets",
2017-05-09 08:46:26 +00:00
],
python_requires=">=3.6",
author="Project Jupyter Contributors",
author_email="jupyter@googlegroups.com",
url="https://repo2docker.readthedocs.io/en/latest/",
2019-05-21 16:55:51 +00:00
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",
2018-09-09 05:50:37 +00:00
},
2018-09-09 07:13:06 +00:00
# this should be a whitespace separated string of keywords, not a list
keywords="reproducible science environments docker",
2019-05-21 16:55:51 +00:00
description="Repo2docker: Turn code repositories into Jupyter enabled Docker Images",
long_description=readme,
long_description_content_type="text/markdown",
license="BSD",
2019-05-21 16:55:51 +00:00
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",
2018-09-09 05:50:37 +00:00
],
2017-05-09 08:46:26 +00:00
packages=find_packages(),
include_package_data=True,
cmdclass=__cmdclass,
2017-05-23 03:39:12 +00:00
entry_points={
"console_scripts": [
"jupyter-repo2docker = repo2docker.__main__:main",
"repo2docker = repo2docker.__main__:main",
],
"repo2docker.engines": ["docker = repo2docker.docker:DockerEngine"],
2017-05-23 03:39:12 +00:00
},
2017-05-09 08:46:26 +00:00
)