Added message that setup.py develop is required to build the docs
This commit is contained in:
parent
9983e84742
commit
1ffa295d93
1 changed files with 11 additions and 3 deletions
14
docs/conf.py
14
docs/conf.py
|
|
@ -43,12 +43,20 @@ master_doc = 'index'
|
||||||
project = u'Flask'
|
project = u'Flask'
|
||||||
copyright = u'2010, Armin Ronacher'
|
copyright = u'2010, Armin Ronacher'
|
||||||
|
|
||||||
import pkg_resources
|
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
# built documents.
|
# built documents.
|
||||||
release = __import__('pkg_resources').get_distribution('Flask').version
|
import pkg_resources
|
||||||
|
try:
|
||||||
|
release = pkg_resources.get_distribution('Flask').version
|
||||||
|
except pkg_resources.DistributionNotFound:
|
||||||
|
print 'To build the documentation, The distribution information of Flask'
|
||||||
|
print 'Has to be available. Either install the package into your'
|
||||||
|
print 'development environment or run "setup.py develop" to setup the'
|
||||||
|
print 'metadata. A virtualenv is recommended!'
|
||||||
|
sys.exit(1)
|
||||||
|
del pkg_resources
|
||||||
|
|
||||||
if 'dev' in release:
|
if 'dev' in release:
|
||||||
release = release.split('dev')[0] + 'dev'
|
release = release.split('dev')[0] + 'dev'
|
||||||
version = '.'.join(release.split('.')[:2])
|
version = '.'.join(release.split('.')[:2])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue