Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added long description to setuptools for new pypi page #874

Merged
merged 2 commits into from
Sep 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import os
import setuptools
import io

from setuptools.command.bdist_egg import bdist_egg

Expand Down Expand Up @@ -74,10 +75,10 @@ class FetchCSS(Command):
user_options = []
def initialize_options(self):
pass

def finalize_options(self):
pass

def _download(self):
try:
return urlopen(css_url).read()
Expand All @@ -92,7 +93,7 @@ def _download(self):
print("Failed, trying again with PycURL to avoid outdated SSL.", file=sys.stderr)
return self._download_pycurl()
raise e

def _download_pycurl(self):
"""Download CSS with pycurl, in case of old SSL (e.g. Python < 2.7.9)."""
import pycurl
Expand All @@ -102,7 +103,7 @@ def _download_pycurl(self):
c.setopt(c.WRITEDATA, buf)
c.perform()
return buf.getvalue()

def run(self):
dest = os.path.join('nbconvert', 'resources', 'style.min.css')
if not os.path.exists('.git') and os.path.exists(dest):
Expand All @@ -119,7 +120,7 @@ def run(self):
else:
raise OSError("Need Notebook CSS to proceed: %s" % dest)
return

with open(dest, 'wb') as f:
f.write(css)
print("Downloaded Notebook CSS to %s" % dest)
Expand All @@ -128,7 +129,7 @@ def run(self):

class bdist_egg_disabled(bdist_egg):
"""Disabled version of bdist_egg

Prevents setup.py install performing setuptools' default easy_install,
which it should never ever do.
"""
Expand Down Expand Up @@ -156,10 +157,14 @@ def run(self):
with open(pjoin(here, name, '_version.py')) as f:
exec(f.read(), {}, version_ns)

with io.open(pjoin(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

setup_args = dict(
name = name,
description = "Converting Jupyter Notebooks",
long_description = long_description,
long_description_content_type = 'text/markdown',
version = version_ns['__version__'],
scripts = glob(pjoin('scripts', '*')),
packages = packages,
Expand Down Expand Up @@ -206,9 +211,9 @@ def run(self):
'test': ['pytest', 'pytest-cov', 'ipykernel', jupyter_client_req],
'serve': ['tornado>=4.0'],
'execute': [jupyter_client_req],
'docs': ['sphinx>=1.5.1',
'docs': ['sphinx>=1.5.1',
'sphinx_rtd_theme',
'nbsphinx>=0.2.12',
'nbsphinx>=0.2.12',
'sphinxcontrib_github_alt',
'ipython',
jupyter_client_req,
Expand Down Expand Up @@ -237,7 +242,7 @@ def run(self):
'rst=nbconvert.exporters:RSTExporter',
'notebook=nbconvert.exporters:NotebookExporter',
'asciidoc=nbconvert.exporters:ASCIIDocExporter',
'script=nbconvert.exporters:ScriptExporter']
'script=nbconvert.exporters:ScriptExporter']
}
setup_args.pop('scripts', None)

Expand Down