-
Notifications
You must be signed in to change notification settings - Fork 574
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
Create entrypoints #352
Create entrypoints #352
Changes from all commits
51ef789
a331ae6
b3f50c4
a6ac46d
abfdc76
fb8d45d
26f50e3
fcd4f9f
3cbd2ed
3786e63
d949687
454d513
b2611b3
a18e417
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,10 @@ | |
#----------------------------------------------------------------------------- | ||
|
||
import os | ||
import setuptools | ||
|
||
from setuptools.command.bdist_egg import bdist_egg | ||
|
||
from glob import glob | ||
from io import BytesIO | ||
try: | ||
|
@@ -122,6 +126,16 @@ def run(self): | |
|
||
cmdclass = {'css': FetchCSS} | ||
|
||
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. | ||
""" | ||
def run(self): | ||
sys.exit("Aborting implicit building of eggs. Use `pip install .` to install from source.") | ||
|
||
|
||
def css_first(command): | ||
class CSSFirst(command): | ||
def run(self): | ||
|
@@ -131,6 +145,7 @@ def run(self): | |
|
||
cmdclass['build'] = css_first(build) | ||
cmdclass['sdist'] = css_first(sdist) | ||
cmdclass['bdist_egg'] = bdist_egg if 'bdist_egg' in sys.argv else bdist_egg_disabled | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @minrk - just noticed that this and Jupyterlab both have a conditional to allow explicit building of eggs. Is there a reason that's important, or are we just anticipating the possibility that someone may want it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To paraphrase one of the PyPA folks, I was avoiding being "hostile to particular workflows". If it's important to someone to build an egg, it's fine by me, I just want to avoid the implicit egg caused by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I support the manual inclusion too. Presumably people who explicitly want an egg know why they want it, and we're more likely to get complaints for restricting it than we are to get issues from people who "accidentally" manually built an egg and accordingly ran into problems. |
||
|
||
for d, _, _ in os.walk(pjoin(pkg_root, 'templates')): | ||
g = pjoin(d[len(pkg_root)+1:], '*.*') | ||
|
@@ -168,9 +183,6 @@ def run(self): | |
], | ||
) | ||
|
||
if 'develop' in sys.argv or any(a.startswith('bdist') for a in sys.argv): | ||
import setuptools | ||
|
||
setuptools_args = {} | ||
install_requires = setuptools_args['install_requires'] = [ | ||
'mistune!=0.6', | ||
|
@@ -197,7 +209,18 @@ def run(self): | |
setup_args['entry_points'] = { | ||
'console_scripts': [ | ||
'jupyter-nbconvert = nbconvert.nbconvertapp:main', | ||
] | ||
], | ||
"nbconvert.exporters" : [ | ||
'custom=nbconvert.exporters:TemplateExporter', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes and no. The custom exporter is configurable in regular config-files. So you can just use |
||
'html=nbconvert.exporters:HTMLExporter', | ||
'slides=nbconvert.exporters:SlidesExporter', | ||
'latex=nbconvert.exporters:LatexExporter', | ||
'pdf=nbconvert.exporters:PDFExporter', | ||
'markdown=nbconvert.exporters:MarkdownExporter', | ||
'python=nbconvert.exporters:PythonExporter', | ||
'rst=nbconvert.exporters:RSTExporter', | ||
'notebook=nbconvert.exporters:NotebookExporter', | ||
'script=nbconvert.exporters:ScriptExporter'] | ||
} | ||
setup_args.pop('scripts', None) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring should indicate that this is deprecated as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cf40f27 addresses this