Commit 5a3f244b authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

Tweaks to setup.py and associates.

parent c50ace78
......@@ -2,5 +2,7 @@ include LICENSE
include COPYRIGHT
include README.md
include requirements.txt
recursive-include doc *
recursive-include tests *
include pytest.ini
recursive-include doc *
recursive-exclude doc/html *
recursive-include tests *
......@@ -20,8 +20,7 @@ Documentation
-------------
`fslpy` is documented using [sphinx](http://http://sphinx-doc.org/). You can
build the API documentation by installing `sphinx` and `sphinx-rtd-theme`, and
running:
build the API documentation by running:
python setup.py doc
......@@ -35,8 +34,7 @@ guide](doc/contributing.rst).
Tests
-----
To run the tests, install `mock`, `pytest`, `pytest-runner`, `pytest-html`,
and `pytest-cov`, and then run:
Run the test suite via:
python setup.py test
......
......@@ -32,7 +32,7 @@ which roughly obeys the Semantic Versioning conventions (http://semver.org/):
import string
__version__ = '1.0.0'
__version__ = '1.0.1'
"""Current version number, as a string. """
......
[aliases]
test=pytest
[bdist_wheel]
universal=1
\ No newline at end of file
......@@ -38,6 +38,7 @@ with open(op.join(basedir, "fsl", "version.py")) as f:
if line.startswith('__version__'):
exec(line, version)
break
version = version['__version__']
with open(op.join(basedir, 'README.md'), 'rt') as f:
readme = f.read()
......@@ -62,34 +63,37 @@ class doc(Command):
if op.exists(destdir):
shutil.rmtree(destdir)
env = dict(os.environ)
dirname = pkgutil.get_loader('fsl').get_filename()
dirname = op.dirname(dirname)
dirname = op.abspath(op.join(dirname, '..'))
ppath = [dirname]
print('Building documentation [{}]'.format(destdir))
env['PYTHONPATH'] = op.pathsep.join(ppath)
import sphinx
print('Building documentation [{}]'.format(destdir))
try:
import unittest.mock as mock
except:
import mock
sp.call(['sphinx-build', docdir, destdir], env=env)
mockedModules = [
'nibabel',
'nibabel.fileslice',
'numpy',
'numpy.linalg']
mockobj = mock.MagicMock()
mockedModules = { m : mockobj for m in mockedModules}
setup(
with mock.patch.dict('sys.modules', **mockedModules):
sphinx.main(['sphinx-build', docdir, destdir])
name='fslpy',
version=version['__version__'],
setup(
name='fslpy',
version=version,
description='FSL Python library',
long_description=readme,
url='https://git.fmrib.ox.ac.uk/fsl/fslpy',
author='Paul McCarthy',
author_email='pauldmccarthy@gmail.com',
license='Apache License Version 2.0',
classifiers=[
......@@ -101,10 +105,9 @@ setup(
'Topic :: Software Development :: Libraries :: Python Modules'],
packages=packages,
install_requires=install_requires,
setup_requires=['pytest-runner', 'sphinx', 'sphinx-rtd-theme', 'mock'],
setup_requires=['pytest-runner'],
tests_require=['mock',
'pytest-cov',
'pytest-html',
......@@ -113,11 +116,4 @@ setup(
test_suite='tests',
cmdclass={'doc' : doc},
entry_points={
'console_scripts' : [
'fslpy_imcp = fsl.scripts.imcp:main',
'fslpy_immv = fsl.scripts.immv:main'
]
}
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment