mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-28 23:26:08 +08:00
adac822ee9
≈ Fix setup to allow installing from PyPi Another attempt at fixing the setuptools problem Fix pip incantation Fix typo Try updating setuptools too Try upgrading pip and setuptools after venv install Rule out install_requires as the source of the problem Try just requiring the ones that can be built from source Use explicit install_requires and move version checks to after setup runs Clean up installation for PyPI compatiblity Dead end commit Fix travis to match new installation procedure Put build_versions check after install Fix travis syntax Switch to lower-case cython in version check Another attempt Another fix Fix syntax error Make header executable Build inplace on py27 Fix finding of source code version in sphinx Fix travis syntax Import setuptools after install Fix the version check in sphinx Work around setuptools bug in 2.7 Fix handling of Cython requirement and update release notes Switch to one Appveyor build and update build method Add cython back to install_requires Remove debug lines Another try for appveyor install Another attempt at setuptools and Appveyor Do not let intermittent apt-get failures crash the build Fix typo Another appveyor attempt More fixes for setuptools and Appveyor Yet another setuptools/appveyor attempt Put requirements.txt back in order Fix typo Fix readlines function call Try not using a venv for python 2.7 Fix syntax Try the provided venv for py27 Remove --user Remove debug info Another try for python27 fix Try again Do not use install_requires with numpy/scipy Try just avoiding scipy Try removing scipy (numpy was before) Avoid both scipy and numpy Fix qt install on 27 Fix qt install on 27 agin Revert the scripts to their previous condition Revert file permission changes Undo changes to requirements.txt
59 lines
1.8 KiB
Python
59 lines
1.8 KiB
Python
#!/usr/bin/env python
|
|
"""Script to auto-generate our API docs.
|
|
"""
|
|
# stdlib imports
|
|
import os, sys
|
|
|
|
# local imports
|
|
from apigen import ApiDocWriter
|
|
|
|
# version comparison
|
|
from distutils.version import LooseVersion as V
|
|
|
|
#*****************************************************************************
|
|
|
|
def abort(error):
|
|
print('*WARNING* API documentation not generated: %s' % error)
|
|
exit()
|
|
|
|
if __name__ == '__main__':
|
|
package = 'skimage'
|
|
|
|
# Check that the 'image' package is available. If not, the API
|
|
# documentation is not (re)generated and existing API documentation
|
|
# sources will be used.
|
|
|
|
try:
|
|
__import__(package)
|
|
except ImportError as e:
|
|
abort("Can not import skimage")
|
|
|
|
module = sys.modules[package]
|
|
|
|
# Check that the source version is equal to the installed
|
|
# version. If the versions mismatch the API documentation sources
|
|
# are not (re)generated. This avoids automatic generation of documentation
|
|
# for older or newer versions if such versions are installed on the system.
|
|
|
|
installed_version = V(module.__version__)
|
|
|
|
source_lines = open('../skimage/__init__.py').readlines()
|
|
version = 'vUndefined'
|
|
for l in source_lines:
|
|
if l.startswith('__version__'):
|
|
source_version = V(l.split("'")[1])
|
|
break
|
|
|
|
if source_version != installed_version:
|
|
abort("Installed version does not match source version")
|
|
|
|
outdir = 'source/api'
|
|
docwriter = ApiDocWriter(package)
|
|
docwriter.package_skip_patterns += [r'\.fixes$',
|
|
r'\.externals$',
|
|
r'filter$',
|
|
]
|
|
docwriter.write_api_docs(outdir)
|
|
docwriter.write_index(outdir, 'api', relative_to='source/api')
|
|
print('%d files written' % len(docwriter.written_modules))
|