Commit 7ffb8498 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Tweaks to readme, doc, requirements and setup.py

parent 39d5f1d7
......@@ -3,14 +3,35 @@ fslpy
The `fslpy` project is a [FSL](http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/)
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
-------------
`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
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`.
A code coverage report will be generated in `htmlcov/`.
......@@ -55,7 +55,7 @@ master_doc = 'index'
# General information about the project.
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)
# Links to other things
......
cython>=0.24
six>=1.10.0
numpy>=1.11.1
matplotlib>=1.5.1
nibabel>=2.1
sphinx>=1.4.1
sphinx-rtd-theme>=0.1.9
indexed_gzip>=0.3.1
six>=1.10.0,<2.0
numpy>=1.11.1,<2.0
matplotlib>=1.5.1,<=2.0.0
nibabel>=2.1,<3.0
indexed_gzip>=0.3.1,<0.4
wxPython==3.0.2.0
......@@ -5,15 +5,28 @@
# 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 find_packages
from setuptools import Command
# The directory in which this setup.py file is contained.
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
# 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:
exec(line, version)
break
install_requires = open(op.join(basedir, 'requirements.txt'), 'rt').readlines()
dependency_links = [i for i in install_requires if i.startswith('git')]
install_requires = [i for i in install_requires if not i.startswith('git')]
class doc(Command):
"""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(
......@@ -52,17 +90,19 @@ setup(
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Topic :: Software Development :: Libraries :: Python Modules'],
packages=find_packages(exclude=('doc', 'tests')),
packages=packages,
install_requires=install_requires,
dependency_links=dependency_links,
setup_requires=['pytest-runner'],
tests_require=['pytest', 'pytest-runner'],
test_suite='tests',
cmdclass={'doc' : doc},
entry_points={
'console_scripts' : [
'fslpy_imcp = fsl.scripts.imcp: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