From 31dbfd8a229f55d079cb22c404483e838e98576c Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Mon, 26 Dec 2016 11:44:46 +0100 Subject: [PATCH 1/7] 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), +) From 8a178ddfa8f69ff8145d55833986bd6fb812a0f7 Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Mon, 26 Dec 2016 11:52:43 +0100 Subject: [PATCH 2/7] update with latest edgy.project release reordering setup.py entries --- Makefile | 2 +- setup.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9eaca03..42f71a6 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-26 11:43:38.014112 +# Updated at 2016-12-26 11:52:20.154236 PYTHON ?= $(shell which python) PYTHON_BASENAME ?= $(shell basename $(PYTHON)) diff --git a/setup.py b/setup.py index d8c06d9..f2b3bb6 100644 --- a/setup.py +++ b/setup.py @@ -16,10 +16,10 @@ except: version = 'dev' setup( - description = 'Bonobo', - install_requires = ['blessings >=1.6,<1.7', 'psutil >=5.0,<5.1'], - license = 'Apache License, Version 2.0', name = 'bonobo', + description = 'Bonobo', + license = 'Apache License, Version 2.0', + install_requires = ['blessings >=1.6,<1.7', 'psutil >=5.0,<5.1'], version = version, long_description = read('README.rst'), classifiers = read('classifiers.txt', tolines), From 75188f9371a84347fe45a5346b7cf136dfe4d49f Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Mon, 26 Dec 2016 11:55:50 +0100 Subject: [PATCH 3/7] travis now knows the new docs location --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 146f0ec..e7f94ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,6 @@ install: - make install-dev - pip install coveralls script: - - make clean doc test + - make clean docs test after_success: - coveralls From 00692ed0767b6e2b47b397244265c5e72cf00d91 Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Mon, 26 Dec 2016 11:58:12 +0100 Subject: [PATCH 4/7] exception type --- bonobo/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bonobo/__init__.py b/bonobo/__init__.py index c77beda..9b14ef6 100644 --- a/bonobo/__init__.py +++ b/bonobo/__init__.py @@ -11,5 +11,5 @@ assert PY35, 'Python 3.5+ is required to use Bonobo.' try: with open('../version.txt') as f: __version__ = f.read().strip() -except: +except Exception as e: __version__ = 'dev' From bd3b410ce96b0fdf3f7fed833fe55da8947701a1 Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Mon, 26 Dec 2016 12:02:45 +0100 Subject: [PATCH 5/7] adds landscape config --- .landscape.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .landscape.yml diff --git a/.landscape.yml b/.landscape.yml new file mode 100644 index 0000000..5a100b8 --- /dev/null +++ b/.landscape.yml @@ -0,0 +1,7 @@ +doc-warnings: true +test-warnings: true +strictness: veryhigh +max-line-length: 120 +autodetect: true +python-targets: + - 3 From bcc578c335b2baebaa86183650c76f0b673451e4 Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Mon, 26 Dec 2016 12:14:04 +0100 Subject: [PATCH 6/7] update landscape config --- .landscape.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.landscape.yml b/.landscape.yml index 5a100b8..81996a4 100644 --- a/.landscape.yml +++ b/.landscape.yml @@ -5,3 +5,6 @@ max-line-length: 120 autodetect: true python-targets: - 3 +ignore-paths: + - docs + - examples From ac8251f859be7a31fbc1ea31c70bc2bc1cca7274 Mon Sep 17 00:00:00 2001 From: Romain Dorgueil Date: Mon, 26 Dec 2016 12:16:24 +0100 Subject: [PATCH 7/7] update readme --- README.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index d958c6a..9e89085 100644 --- a/README.rst +++ b/README.rst @@ -12,7 +12,10 @@ MIGRATION IN PROGRESS FROM RDC.ETL - PYTHON 3.5+ :target: https://travis-ci.org/python-bonobo/bonobo :alt: Continuous Integration -.. image:: :target: +.. image:: https://landscape.io/github/python-bonobo/bonobo/master/landscape.svg?style=flat + :target: https://landscape.io/github/python-bonobo/bonobo/master + :alt: Code Health + .. image:: https://img.shields.io/coveralls/python-bonobo/bonobo.svg :target: https://coveralls.io/github/python-bonobo/bonobo?branch=master :alt: Coverage