Skip to content

Commit

Permalink
Switch to using setuptools
Browse files Browse the repository at this point in the history
  • Loading branch information
jhamrick committed Apr 22, 2016
1 parent cc37a10 commit 48d6a0f
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,5 @@ nbgrader/formgrader/static/components/autosize/example

conda-bld
gh_api.sqlite
MANIFEST
README
13 changes: 1 addition & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
sqlalchemy
python-dateutil
jupyter
notebook>=4.2
nbconvert>=4.2
nbformat
traitlets
jupyter_core
jupyter_client
tornado
six
requests
-e .
4 changes: 0 additions & 4 deletions scripts/nbgrader

This file was deleted.

61 changes: 28 additions & 33 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Distributed under the terms of the Modified BSD License.

import os
from distutils.core import setup
from setuptools import setup, find_packages

# get paths to all the extension files
extension_files = []
Expand Down Expand Up @@ -48,15 +48,15 @@
exec(f.read(), {}, version_ns)

setup_args = dict(
name = name,
version = version_ns['__version__'],
description = 'A system for assigning and grading notebooks',
author = 'Jupyter Development Team',
author_email = '[email protected]',
license = 'BSD',
url = 'https://github.com/jupyter/nbgrader',
keywords = ['Notebooks', 'Grading', 'Homework'],
classifiers = [
name=name,
version=version_ns['__version__'],
description='A system for assigning and grading notebooks',
author='Jupyter Development Team',
author_email='[email protected]',
license='BSD',
url='https://github.com/jupyter/nbgrader',
keywords=['Notebooks', 'Grading', 'Homework'],
classifiers=[
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
Expand All @@ -65,20 +65,7 @@
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
packages=[
'nbgrader',
'nbgrader.apps',
'nbgrader.auth',
'nbgrader.formgrader',
'nbgrader.preprocessors',
'nbgrader.tests',
'nbgrader.tests.api',
'nbgrader.tests.apps',
'nbgrader.tests.formgrader',
'nbgrader.tests.nbextensions',
'nbgrader.tests.preprocessors',
'nbgrader.tests.utils'
],
packages=find_packages(),
package_data={
'nbgrader': extension_files + docs_files,
'nbgrader.formgrader': static_files,
Expand All @@ -88,15 +75,23 @@
'preprocessors/files/*'
]
},
scripts=['scripts/nbgrader']
entry_points={
'console_scripts': ['nbgrader=nbgrader.apps.nbgraderapp:main']
},
install_requires=[
"sqlalchemy",
"python-dateutil",
"jupyter",
"notebook>=4.2",
"nbconvert>=4.2",
"nbformat",
"traitlets",
"jupyter_core",
"jupyter_client",
"tornado",
"six",
"requests"
]
)

setup_args['install_requires'] = install_requires = []
with open('requirements.txt') as f:
for line in f.readlines():
req = line.strip()
if not req or req.startswith(('-e', '#')):
continue
install_requires.append(req)

setup(**setup_args)
27 changes: 27 additions & 0 deletions tools/release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python
"""Builds a python package sdist release for upload to pypi.
Usage:
python tools/release.py
"""

import subprocess as sp

# convert the README to rst
cmd = ["pandoc", "--from", "markdown", "--to", "rst", "README.md"]
print(" ".join(cmd))
proc = sp.Popen(cmd, stdout=sp.PIPE)
stdout = proc.communicate()[0].decode('utf-8')
if proc.wait() != 0:
raise RuntimeError("pandoc exited with non-zero exit code")

print("Writing README")
with open("README", "w") as fh:
fh.write(stdout)

# Build the source distribution package
cmd = ["python", "setup.py", "sdist"]
print(" ".join(cmd))
sp.call(cmd)

0 comments on commit 48d6a0f

Please sign in to comment.