move doc to docs as it is more consistent, use new features of edgy.project to generate setup.py with data files

This commit is contained in:
Romain Dorgueil
2016-12-26 11:44:46 +01:00
parent a6cc8ba6db
commit 31dbfd8a22
14 changed files with 46 additions and 49 deletions

2
.gitignore vendored
View File

@ -28,7 +28,7 @@
/coverage.xml /coverage.xml
/develop-eggs/ /develop-eggs/
/dist/ /dist/
/doc/_build/ /docs/_build/
/downloads/ /downloads/
/eggs/ /eggs/
/examples/private /examples/private

View File

@ -1,7 +1,7 @@
# This file has been auto-generated. # This file has been auto-generated.
# All changes will be lost, see Projectfile. # All changes will be lost, see Projectfile.
# #
# Updated at 2016-12-09 08:33:52.136641 # Updated at 2016-12-26 11:43:38.014112
PYTHON ?= $(shell which python) PYTHON ?= $(shell which python)
PYTHON_BASENAME ?= $(shell basename $(PYTHON)) PYTHON_BASENAME ?= $(shell basename $(PYTHON))
@ -14,10 +14,10 @@ PYTEST ?= $(VIRTUAL_ENV)/bin/pytest
PYTEST_OPTIONS ?= --capture=no --cov=bonobo --cov-report html PYTEST_OPTIONS ?= --capture=no --cov=bonobo --cov-report html
SPHINX_OPTS ?= SPHINX_OPTS ?=
SPHINX_BUILD ?= $(VIRTUAL_ENV)/bin/sphinx-build SPHINX_BUILD ?= $(VIRTUAL_ENV)/bin/sphinx-build
SPHINX_SOURCEDIR ?= doc SPHINX_SOURCEDIR ?= docs
SPHINX_BUILDDIR ?= $(SPHINX_SOURCEDIR)/_build SPHINX_BUILDDIR ?= $(SPHINX_SOURCEDIR)/_build
.PHONY: clean doc install install-dev lint test .PHONY: $(SPHINX_SOURCEDIR) clean install install-dev lint test
# Installs the local project dependencies. # Installs the local project dependencies.
install: $(VIRTUAL_ENV) install: $(VIRTUAL_ENV)
@ -48,5 +48,5 @@ lint: install-dev
test: install-dev test: install-dev
$(PYTEST) $(PYTEST_OPTIONS) tests $(PYTEST) $(PYTEST_OPTIONS) tests
doc: install-dev $(SPHINX_SOURCEDIR): install-dev
$(SPHINX_BUILD) -b html -D latex_paper_size=a4 $(SPHINX_OPTS) $(SPHINX_SOURCEDIR) $(SPHINX_BUILDDIR)/html $(SPHINX_BUILD) -b html -D latex_paper_size=a4 $(SPHINX_OPTS) $(SPHINX_SOURCEDIR) $(SPHINX_BUILDDIR)/html

View File

@ -4,8 +4,8 @@ name = 'bonobo'
description = 'Bonobo' description = 'Bonobo'
license = 'Apache License, Version 2.0' license = 'Apache License, Version 2.0'
url = 'https://github.com/hartym/bonobo' url = 'https://github.com/python-bonobo/bonobo'
download_url = 'https://github.com/hartym/bonobo' download_url = 'https://github.com/python-bonobo/bonobo/tarball/{version}'
author = 'Romain Dorgueil' author = 'Romain Dorgueil'
author_email = 'romain@dorgueil.net' author_email = 'romain@dorgueil.net'
@ -49,3 +49,8 @@ data_files = [
'bonobo/ext/jupyter/static/index.js.map', 'bonobo/ext/jupyter/static/index.js.map',
]), ]),
] ]
@listen('edgy.project.feature.make.on_generate', priority=10)
def on_make_generate_docker_targets(event):
event.makefile['SPHINX_SOURCEDIR'] = 'docs'

View File

@ -7,4 +7,9 @@ PY35 = (sys.version_info >= (3, 5))
assert PY35, 'Python 3.5+ is required to use Bonobo.' assert PY35, 'Python 3.5+ is required to use Bonobo.'
__version__ = '0.0.0' # Version infos
try:
with open('../version.txt') as f:
__version__ = f.read().strip()
except:
__version__ = 'dev'

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@ -8,7 +8,6 @@ sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('_themes')) sys.path.insert(0, os.path.abspath('_themes'))
import bonobo import bonobo
from bonobo import __version__
# -- General configuration ------------------------------------------------ # -- General configuration ------------------------------------------------
@ -37,11 +36,8 @@ author = 'Romain Dorgueil'
# 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.
# version = bonobo.__version__
# The short X.Y version. release = bonobo.__version__
version = __version__
# The full version, including alpha/beta/rc tags.
release = __version__
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

View File

@ -5,34 +5,31 @@ from setuptools import setup, find_packages
tolines = lambda c: list(filter(None, map(lambda s: s.strip(), c.split('\n')))) tolines = lambda c: list(filter(None, map(lambda s: s.strip(), c.split('\n'))))
def read(filename, flt=None): def read(filename, flt=None):
with open(filename) as f: with open(filename) as f:
content = f.read().strip() content = f.read().strip()
return flt(content) if callable(flt) else content return flt(content) if callable(flt) else content
try: try:
version = read('version.txt') version = read('version.txt')
except: except:
version = 'dev' version = 'dev'
setup( setup(
name='bonobo',
description = 'Bonobo', description = 'Bonobo',
install_requires = ['blessings >=1.6,<1.7', 'psutil >=5.0,<5.1'],
license = 'Apache License, Version 2.0', license = 'Apache License, Version 2.0',
install_requires=[ name = 'bonobo',
'psutil >=5.0,<5.1',
'blessings >=1.6,<1.7',
],
version = version, version = version,
long_description = read('README.rst'), long_description = read('README.rst'),
classifiers = read('classifiers.txt', tolines), classifiers = read('classifiers.txt', tolines),
packages = find_packages(exclude=['ez_setup', 'example', 'test']), packages = find_packages(exclude=['ez_setup', 'example', 'test']),
include_package_data = True, include_package_data = True,
extras_require={ data_files = [('share/jupyter/nbextensions/bonobo-jupyter',
'dev': [ ['bonobo/ext/jupyter/static/extension.js',
'coverage >=4.2,<4.3', 'bonobo/ext/jupyter/static/index.js',
'bonobo/ext/jupyter/static/index.js.map'])],
extras_require = {'dev': ['coverage >=4.2,<4.3',
'mock >=2.0,<2.1', 'mock >=2.0,<2.1',
'nose >=1.3,<1.4', 'nose >=1.3,<1.4',
'pylint >=1.6,<1.7', 'pylint >=1.6,<1.7',
@ -40,14 +37,8 @@ setup(
'pytest-cov >=2.4,<2.5', 'pytest-cov >=2.4,<2.5',
'sphinx', 'sphinx',
'sphinx_rtd_theme', 'sphinx_rtd_theme',
'yapf', 'yapf'],
], 'jupyter': ['jupyter >=1.0,<1.1', 'ipywidgets >=6.0.0.beta5']},
'jupyter': ['ipywidgets >=6.0.0.beta5'] url = 'https://github.com/python-bonobo/bonobo',
}, download_url = 'https://github.com/python-bonobo/bonobo/tarball/{version}'.format(version=version),
data_files=[('share/jupyter/nbextensions/bonobo', [ )
'bonobo/ext/jupyter/static/extension.js',
'bonobo/ext/jupyter/static/index.js',
'bonobo/ext/jupyter/static/index.js.map',
]), ],
url='https://github.com/hartym/bonobo',
download_url='https://github.com/hartym/bonobo'.format(version=version), )