Skip to content
Snippets Groups Projects
Commit b67d65d4 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Merge branch 'master' into 'master'

Make ready for public release

See merge request !18
parents c50ace78 76789c43
No related branches found
No related tags found
No related merge requests found
...@@ -2,5 +2,7 @@ include LICENSE ...@@ -2,5 +2,7 @@ include LICENSE
include COPYRIGHT include COPYRIGHT
include README.md include README.md
include requirements.txt include requirements.txt
recursive-include doc * include pytest.ini
recursive-include tests * recursive-include doc *
recursive-exclude doc/html *
recursive-include tests *
...@@ -20,8 +20,7 @@ Documentation ...@@ -20,8 +20,7 @@ Documentation
------------- -------------
`fslpy` is documented using [sphinx](http://http://sphinx-doc.org/). You can `fslpy` is documented using [sphinx](http://http://sphinx-doc.org/). You can
build the API documentation by installing `sphinx` and `sphinx-rtd-theme`, and build the API documentation by running:
running:
python setup.py doc python setup.py doc
...@@ -35,8 +34,7 @@ guide](doc/contributing.rst). ...@@ -35,8 +34,7 @@ guide](doc/contributing.rst).
Tests Tests
----- -----
To run the tests, install `mock`, `pytest`, `pytest-runner`, `pytest-html`, Run the test suite via:
and `pytest-cov`, and then run:
python setup.py test python setup.py test
......
...@@ -32,7 +32,7 @@ which roughly obeys the Semantic Versioning conventions (http://semver.org/): ...@@ -32,7 +32,7 @@ which roughly obeys the Semantic Versioning conventions (http://semver.org/):
import string import string
__version__ = '1.0.0' __version__ = 'dev'
"""Current version number, as a string. """ """Current version number, as a string. """
...@@ -44,6 +44,9 @@ def parseVersionString(versionString): ...@@ -44,6 +44,9 @@ def parseVersionString(versionString):
An error is raised if the ``versionString`` is invalid. An error is raised if the ``versionString`` is invalid.
""" """
if versionString == 'dev':
return 9999, 9999, 9999
components = versionString.split('.') components = versionString.split('.')
# Major, minor, and point # Major, minor, and point
......
[aliases] [aliases]
test=pytest test=pytest
[bdist_wheel]
universal=1
\ No newline at end of file
...@@ -8,11 +8,8 @@ ...@@ -8,11 +8,8 @@
from __future__ import print_function from __future__ import print_function
import os import os.path as op
import os.path as op import shutil
import subprocess as sp
import shutil
import pkgutil
from setuptools import setup from setuptools import setup
from setuptools import find_packages from setuptools import find_packages
...@@ -38,6 +35,7 @@ with open(op.join(basedir, "fsl", "version.py")) as f: ...@@ -38,6 +35,7 @@ with open(op.join(basedir, "fsl", "version.py")) as f:
if line.startswith('__version__'): if line.startswith('__version__'):
exec(line, version) exec(line, version)
break break
version = version['__version__']
with open(op.join(basedir, 'README.md'), 'rt') as f: with open(op.join(basedir, 'README.md'), 'rt') as f:
readme = f.read() readme = f.read()
...@@ -62,34 +60,37 @@ class doc(Command): ...@@ -62,34 +60,37 @@ class doc(Command):
if op.exists(destdir): if op.exists(destdir):
shutil.rmtree(destdir) shutil.rmtree(destdir)
env = dict(os.environ) print('Building documentation [{}]'.format(destdir))
dirname = pkgutil.get_loader('fsl').get_filename()
dirname = op.dirname(dirname)
dirname = op.abspath(op.join(dirname, '..'))
ppath = [dirname]
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', description='FSL Python library',
long_description=readme, long_description=readme,
url='https://git.fmrib.ox.ac.uk/fsl/fslpy', url='https://git.fmrib.ox.ac.uk/fsl/fslpy',
author='Paul McCarthy', author='Paul McCarthy',
author_email='pauldmccarthy@gmail.com', author_email='pauldmccarthy@gmail.com',
license='Apache License Version 2.0', license='Apache License Version 2.0',
classifiers=[ classifiers=[
...@@ -101,10 +102,9 @@ setup( ...@@ -101,10 +102,9 @@ setup(
'Topic :: Software Development :: Libraries :: Python Modules'], 'Topic :: Software Development :: Libraries :: Python Modules'],
packages=packages, packages=packages,
install_requires=install_requires, install_requires=install_requires,
setup_requires=['pytest-runner', 'sphinx', 'sphinx-rtd-theme', 'mock'],
setup_requires=['pytest-runner'],
tests_require=['mock', tests_require=['mock',
'pytest-cov', 'pytest-cov',
'pytest-html', 'pytest-html',
...@@ -113,11 +113,4 @@ setup( ...@@ -113,11 +113,4 @@ setup(
test_suite='tests', test_suite='tests',
cmdclass={'doc' : doc}, cmdclass={'doc' : doc},
entry_points={
'console_scripts' : [
'fslpy_imcp = fsl.scripts.imcp:main',
'fslpy_immv = fsl.scripts.immv:main'
]
}
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment