Skip to content
Snippets Groups Projects
Commit 7ffb8498 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Tweaks to readme, doc, requirements and setup.py

parent 39d5f1d7
No related branches found
No related tags found
No related merge requests found
...@@ -3,14 +3,35 @@ fslpy ...@@ -3,14 +3,35 @@ fslpy
The `fslpy` project is a [FSL](http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/) The `fslpy` project is a [FSL](http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/)
programming library written in Python. It is used by programming library written in Python. It is used by
[FSLeyes](https://git.fmrib.ox.ac.uk/paulmc/fsleyes/). [FSLeyes](https://git.fmrib.ox.ac.uk/paulmc/fsleyes/).
Dependencies
------------
All of the dependencies of `fslpy` are listed in the
[requirements.txt](requirements.txt) file. Some `fslpy` modules require
[wxPython](http://www.wxpython.org) 3.0.2.0.
Documentation 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:
python setup.py doc
The HTML documentation will be generated and saved in the `doc/html/` directory.
Tests
-----
To run the tests, install `pytest` and `coverage`, and then run:
python setup.py test --addopts="-v --niters=50 --cov=fsl --cov-report=html"
Take a look at the [Documentation for A code coverage report will be generated in `htmlcov/`.
developers](http://users.fmrib.ox.ac.uk/~paulmc/fslpy/index.html), and the
[requirements.txt file](requirements.txt) for details on
``fslpy`` dependencies, if you want to program with `fslpy`.
...@@ -55,7 +55,7 @@ master_doc = 'index' ...@@ -55,7 +55,7 @@ master_doc = 'index'
# General information about the project. # General information about the project.
project = u'fslpy' project = u'fslpy'
copyright = u'{}, Paul McCarthy, FMRIB Centre, University of Oxford'.format( copyright = u'{}, Paul McCarthy, University of Oxford, Oxford, UK'.format(
date.year) date.year)
# Links to other things # Links to other things
......
cython>=0.24 six>=1.10.0,<2.0
six>=1.10.0 numpy>=1.11.1,<2.0
numpy>=1.11.1 matplotlib>=1.5.1,<=2.0.0
matplotlib>=1.5.1 nibabel>=2.1,<3.0
nibabel>=2.1 indexed_gzip>=0.3.1,<0.4
sphinx>=1.4.1 wxPython==3.0.2.0
sphinx-rtd-theme>=0.1.9
indexed_gzip>=0.3.1
...@@ -5,15 +5,28 @@ ...@@ -5,15 +5,28 @@
# Author: Paul McCarthy <pauldmccarthy@gmail.com> # Author: Paul McCarthy <pauldmccarthy@gmail.com>
# #
import os.path as op
from __future__ import print_function
import os
import os.path as op
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
from setuptools import Command
# The directory in which this setup.py file is contained. # The directory in which this setup.py file is contained.
basedir = op.dirname(__file__) basedir = op.dirname(__file__)
# Dependencies are listed in requirements.txt
install_requires = open(op.join(basedir, 'requirements.txt'), 'rt').readlines()
packages = find_packages(
exclude=('doc', 'tests', 'dist', 'build', 'fslpy.egg-info'))
# Figure out the current fslpy version, as defined in fsl/version.py. We # Figure out the current fslpy version, as defined in fsl/version.py. We
# don't want to import the fsl package, as this may cause build problems. # don't want to import the fsl package, as this may cause build problems.
...@@ -26,10 +39,35 @@ with open(op.join(basedir, "fsl", "version.py")) as f: ...@@ -26,10 +39,35 @@ with open(op.join(basedir, "fsl", "version.py")) as f:
exec(line, version) exec(line, version)
break break
install_requires = open(op.join(basedir, 'requirements.txt'), 'rt').readlines()
dependency_links = [i for i in install_requires if i.startswith('git')] class doc(Command):
install_requires = [i for i in install_requires if not i.startswith('git')] """Build the API documentation. """
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
docdir = op.join(basedir, 'doc')
destdir = op.join(docdir, 'html')
if op.exists(destdir):
shutil.rmtree(destdir)
env = dict(os.environ)
ppath = [op.join(pkgutil.get_loader('fsl').filename, '..')]
env['PYTHONPATH'] = op.pathsep.join(ppath)
print('Building documentation [{}]'.format(destdir))
sp.call(['sphinx-build', docdir, destdir], env=env)
setup( setup(
...@@ -52,17 +90,19 @@ setup( ...@@ -52,17 +90,19 @@ setup(
'Intended Audience :: Developers', 'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License', 'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Topic :: Software Development :: Libraries :: Python Modules'], 'Topic :: Software Development :: Libraries :: Python Modules'],
packages=find_packages(exclude=('doc', 'tests')), packages=packages,
install_requires=install_requires, install_requires=install_requires,
dependency_links=dependency_links,
setup_requires=['pytest-runner'], setup_requires=['pytest-runner'],
tests_require=['pytest', 'pytest-runner'], tests_require=['pytest', 'pytest-runner'],
test_suite='tests', test_suite='tests',
cmdclass={'doc' : doc},
entry_points={ entry_points={
'console_scripts' : [ 'console_scripts' : [
'fslpy_imcp = fsl.scripts.imcp:main', 'fslpy_imcp = fsl.scripts.imcp: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