From 31dbfd8a229f55d079cb22c404483e838e98576c Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Mon, 26 Dec 2016 11:44:46 +0100 Subject: [PATCH] move doc to docs as it is more consistent, use new features of edgy.project to generate setup.py with data files --- .gitignore | 2 +- Makefile | 8 +-- Projectfile | 9 ++- bonobo/__init__.py | 7 ++- {doc => docs}/Makefile | 0 {doc => docs}/_static/bonobo.png | Bin {doc => docs}/_templates/index.html | 0 {doc => docs}/_templates/sidebarinfos.html | 0 {doc => docs}/_templates/sidebarlogo.html | 0 {doc => docs}/changelog.rst | 0 {doc => docs}/conf.py | 8 +-- {doc => docs}/index.rst | 0 {doc => docs}/make.bat | 0 setup.py | 61 +++++++++------------ 14 files changed, 46 insertions(+), 49 deletions(-) rename {doc => docs}/Makefile (100%) rename {doc => docs}/_static/bonobo.png (100%) rename {doc => docs}/_templates/index.html (100%) rename {doc => docs}/_templates/sidebarinfos.html (100%) rename {doc => docs}/_templates/sidebarlogo.html (100%) rename {doc => docs}/changelog.rst (100%) rename {doc => docs}/conf.py (97%) rename {doc => docs}/index.rst (100%) rename {doc => docs}/make.bat (100%) diff --git a/.gitignore b/.gitignore index a00ffb4..c731916 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,7 @@ /coverage.xml /develop-eggs/ /dist/ -/doc/_build/ +/docs/_build/ /downloads/ /eggs/ /examples/private diff --git a/Makefile b/Makefile index d066051..9eaca03 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # This file has been auto-generated. # 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_BASENAME ?= $(shell basename $(PYTHON)) @@ -14,10 +14,10 @@ PYTEST ?= $(VIRTUAL_ENV)/bin/pytest PYTEST_OPTIONS ?= --capture=no --cov=bonobo --cov-report html SPHINX_OPTS ?= SPHINX_BUILD ?= $(VIRTUAL_ENV)/bin/sphinx-build -SPHINX_SOURCEDIR ?= doc +SPHINX_SOURCEDIR ?= docs 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. install: $(VIRTUAL_ENV) @@ -48,5 +48,5 @@ lint: install-dev test: install-dev $(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 diff --git a/Projectfile b/Projectfile index 9a5fdee..4842e2c 100644 --- a/Projectfile +++ b/Projectfile @@ -4,8 +4,8 @@ name = 'bonobo' description = 'Bonobo' license = 'Apache License, Version 2.0' -url = 'https://github.com/hartym/bonobo' -download_url = 'https://github.com/hartym/bonobo' +url = 'https://github.com/python-bonobo/bonobo' +download_url = 'https://github.com/python-bonobo/bonobo/tarball/{version}' author = 'Romain Dorgueil' author_email = 'romain@dorgueil.net' @@ -49,3 +49,8 @@ data_files = [ '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' diff --git a/bonobo/__init__.py b/bonobo/__init__.py index fa88835..c77beda 100644 --- a/bonobo/__init__.py +++ b/bonobo/__init__.py @@ -7,4 +7,9 @@ PY35 = (sys.version_info >= (3, 5)) 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' diff --git a/doc/Makefile b/docs/Makefile similarity index 100% rename from doc/Makefile rename to docs/Makefile diff --git a/doc/_static/bonobo.png b/docs/_static/bonobo.png similarity index 100% rename from doc/_static/bonobo.png rename to docs/_static/bonobo.png diff --git a/doc/_templates/index.html b/docs/_templates/index.html similarity index 100% rename from doc/_templates/index.html rename to docs/_templates/index.html diff --git a/doc/_templates/sidebarinfos.html b/docs/_templates/sidebarinfos.html similarity index 100% rename from doc/_templates/sidebarinfos.html rename to docs/_templates/sidebarinfos.html diff --git a/doc/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html similarity index 100% rename from doc/_templates/sidebarlogo.html rename to docs/_templates/sidebarlogo.html diff --git a/doc/changelog.rst b/docs/changelog.rst similarity index 100% rename from doc/changelog.rst rename to docs/changelog.rst diff --git a/doc/conf.py b/docs/conf.py similarity index 97% rename from doc/conf.py rename to docs/conf.py index 40546a2..60636f6 100644 --- a/doc/conf.py +++ b/docs/conf.py @@ -8,7 +8,6 @@ sys.path.insert(0, os.path.abspath('..')) sys.path.insert(0, os.path.abspath('_themes')) import bonobo -from bonobo import __version__ # -- General configuration ------------------------------------------------ @@ -37,11 +36,8 @@ author = 'Romain Dorgueil' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. -# -# The short X.Y version. -version = __version__ -# The full version, including alpha/beta/rc tags. -release = __version__ +version = bonobo.__version__ +release = bonobo.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/index.rst b/docs/index.rst similarity index 100% rename from doc/index.rst rename to docs/index.rst diff --git a/doc/make.bat b/docs/make.bat similarity index 100% rename from doc/make.bat rename to docs/make.bat diff --git a/setup.py b/setup.py index 1f24fd0..d8c06d9 100644 --- a/setup.py +++ b/setup.py @@ -5,49 +5,40 @@ from setuptools import setup, find_packages tolines = lambda c: list(filter(None, map(lambda s: s.strip(), c.split('\n')))) - def read(filename, flt=None): with open(filename) as f: content = f.read().strip() return flt(content) if callable(flt) else content - try: version = read('version.txt') except: version = 'dev' setup( - name='bonobo', - description='Bonobo', - license='Apache License, Version 2.0', - install_requires=[ - 'psutil >=5.0,<5.1', - 'blessings >=1.6,<1.7', - ], - version=version, - long_description=read('README.rst'), - classifiers=read('classifiers.txt', tolines), - packages=find_packages(exclude=['ez_setup', 'example', 'test']), - include_package_data=True, - extras_require={ - 'dev': [ - 'coverage >=4.2,<4.3', - 'mock >=2.0,<2.1', - 'nose >=1.3,<1.4', - 'pylint >=1.6,<1.7', - 'pytest >=3,<4', - 'pytest-cov >=2.4,<2.5', - 'sphinx', - 'sphinx_rtd_theme', - 'yapf', - ], - 'jupyter': ['ipywidgets >=6.0.0.beta5'] - }, - 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), ) + description = 'Bonobo', + install_requires = ['blessings >=1.6,<1.7', 'psutil >=5.0,<5.1'], + license = 'Apache License, Version 2.0', + name = 'bonobo', + version = version, + long_description = read('README.rst'), + classifiers = read('classifiers.txt', tolines), + packages = find_packages(exclude=['ez_setup', 'example', 'test']), + include_package_data = True, + data_files = [('share/jupyter/nbextensions/bonobo-jupyter', + ['bonobo/ext/jupyter/static/extension.js', + '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', + 'nose >=1.3,<1.4', + 'pylint >=1.6,<1.7', + 'pytest >=3,<4', + 'pytest-cov >=2.4,<2.5', + 'sphinx', + 'sphinx_rtd_theme', + 'yapf'], + 'jupyter': ['jupyter >=1.0,<1.1', '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), +)