[pm] Moving project artifact management to next edgy.project version.
This commit is contained in:
8
Makefile
8
Makefile
@ -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 2017-05-22 19:54:27.969596
|
# Updated at 2017-05-27 16:06:39.394642
|
||||||
|
|
||||||
PACKAGE ?= bonobo
|
PACKAGE ?= bonobo
|
||||||
PYTHON ?= $(shell which python)
|
PYTHON ?= $(shell which python)
|
||||||
@ -20,8 +20,9 @@ SPHINX_SOURCEDIR ?= docs
|
|||||||
SPHINX_BUILDDIR ?= $(SPHINX_SOURCEDIR)/_build
|
SPHINX_BUILDDIR ?= $(SPHINX_SOURCEDIR)/_build
|
||||||
YAPF ?= $(PYTHON_DIRNAME)/yapf
|
YAPF ?= $(PYTHON_DIRNAME)/yapf
|
||||||
YAPF_OPTIONS ?= -rip
|
YAPF_OPTIONS ?= -rip
|
||||||
|
VERSION ?= $(shell git describe 2>/dev/null || echo dev)
|
||||||
|
|
||||||
.PHONY: $(SPHINX_SOURCEDIR) clean format install install-dev lint test
|
.PHONY: $(SPHINX_SOURCEDIR) clean format install install-dev test
|
||||||
|
|
||||||
# Installs the local project dependencies.
|
# Installs the local project dependencies.
|
||||||
install:
|
install:
|
||||||
@ -39,9 +40,6 @@ install-dev:
|
|||||||
clean:
|
clean:
|
||||||
rm -rf build dist *.egg-info
|
rm -rf build dist *.egg-info
|
||||||
|
|
||||||
lint: install-dev
|
|
||||||
$(PYTHON_DIRNAME)/pylint --py3k $(PACKAGE) -f html > pylint.html
|
|
||||||
|
|
||||||
test: install-dev
|
test: install-dev
|
||||||
$(PYTEST) $(PYTEST_OPTIONS) tests
|
$(PYTEST) $(PYTEST_OPTIONS) tests
|
||||||
|
|
||||||
|
|||||||
93
Projectfile
93
Projectfile
@ -1,69 +1,52 @@
|
|||||||
# bonobo (see github.com/python-edgy/project)
|
# bonobo (see github.com/python-edgy/project)
|
||||||
|
|
||||||
name = 'bonobo'
|
from edgy.project import require
|
||||||
description = 'Bonobo, a simple, modern and atomic extract-transform-load toolkit for python 3.5+.'
|
|
||||||
license = 'Apache License, Version 2.0'
|
|
||||||
|
|
||||||
url = 'https://www.bonobo-project.org/'
|
pytest = require('pytest')
|
||||||
download_url = 'https://github.com/python-bonobo/bonobo/tarball/{version}'
|
python = require('python')
|
||||||
|
sphinx = require('sphinx')
|
||||||
|
yapf = require('yapf')
|
||||||
|
|
||||||
author = 'Romain Dorgueil'
|
python.setup(
|
||||||
author_email = 'romain@dorgueil.net'
|
name='bonobo',
|
||||||
|
description='Bonobo, a simple, modern and atomic extract-transform-load toolkit for python 3.5+.',
|
||||||
|
license='Apache License, Version 2.0',
|
||||||
|
url='https://www.bonobo-project.org/',
|
||||||
|
download_url='https://github.com/python-bonobo/bonobo/tarball/{version}',
|
||||||
|
author='Romain Dorgueil',
|
||||||
|
author_email='romain@dorgueil.net',
|
||||||
|
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',
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
|
||||||
enable_features = {
|
entry_points={
|
||||||
'make',
|
'console_scripts': [
|
||||||
'sphinx', # should install sphinx
|
'bonobo = bonobo.commands:entrypoint',
|
||||||
'pytest', # should install pytest/pytest-cov/coverage
|
],
|
||||||
'git',
|
'bonobo.commands': [
|
||||||
'pylint',
|
'init = bonobo.commands.init:register',
|
||||||
'python',
|
'run = bonobo.commands.run:register',
|
||||||
'yapf', # should install yapf
|
'version = bonobo.commands.version:register',
|
||||||
}
|
],
|
||||||
|
}
|
||||||
|
|
||||||
# stricts deendencies in requirements.txt
|
)
|
||||||
install_requires = [
|
|
||||||
|
python.add_requirements(
|
||||||
'colorama >=0.3,<1.0',
|
'colorama >=0.3,<1.0',
|
||||||
'fs >=2.0,<3.0',
|
'fs >=2.0,<3.0',
|
||||||
'psutil >=5.2,<6.0',
|
'psutil >=5.2,<6.0',
|
||||||
'requests >=2.0,<3.0',
|
'requests >=2.0,<3.0',
|
||||||
'stevedore >=1.21,<2.0',
|
'stevedore >=1.21,<2.0',
|
||||||
]
|
dev=[
|
||||||
|
|
||||||
extras_require = {
|
|
||||||
'dev': [
|
|
||||||
'coverage >=4,<5',
|
|
||||||
'pylint >=1,<2',
|
|
||||||
'pytest >=3,<4',
|
|
||||||
'pytest-cov >=2,<3',
|
|
||||||
'pytest-timeout >=1,<2',
|
'pytest-timeout >=1,<2',
|
||||||
'sphinx',
|
|
||||||
'yapf',
|
|
||||||
],
|
],
|
||||||
'jupyter': [
|
jupyter=[
|
||||||
'jupyter >=1.0,<1.1',
|
'jupyter >=1.0,<1.1',
|
||||||
'ipywidgets >=6.0.0.beta5'
|
'ipywidgets >=6.0.0.beta5',
|
||||||
],
|
]
|
||||||
}
|
)
|
||||||
|
|
||||||
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',
|
|
||||||
]),
|
|
||||||
]
|
|
||||||
|
|
||||||
entry_points = {
|
|
||||||
'console_scripts': [
|
|
||||||
'bonobo = bonobo.commands:entrypoint',
|
|
||||||
],
|
|
||||||
'bonobo.commands': [
|
|
||||||
'init = bonobo.commands.init:register',
|
|
||||||
'run = bonobo.commands.run:register',
|
|
||||||
'version = bonobo.commands.version:register',
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
@listen('edgy.project.feature.make.on_generate', priority=10)
|
|
||||||
def on_make_generate_docker_targets(event):
|
|
||||||
event.makefile['SPHINX_SOURCEDIR'] = 'docs'
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@ from bonobo.util.objects import get_name
|
|||||||
|
|
||||||
__all__ = []
|
__all__ = []
|
||||||
|
|
||||||
|
|
||||||
def register_api(x, __all__=__all__):
|
def register_api(x, __all__=__all__):
|
||||||
__all__.append(get_name(x))
|
__all__.append(get_name(x))
|
||||||
return x
|
return x
|
||||||
|
|||||||
@ -9,7 +9,9 @@ def execute(name):
|
|||||||
'You must install "cookiecutter" to use this command.\n\n $ pip install edgy.project\n'
|
'You must install "cookiecutter" to use this command.\n\n $ pip install edgy.project\n'
|
||||||
) from exc
|
) from exc
|
||||||
|
|
||||||
return cookiecutter('https://github.com/python-bonobo/cookiecutter-bonobo.git', extra_context={'name': name}, no_input=True)
|
return cookiecutter(
|
||||||
|
'https://github.com/python-bonobo/cookiecutter-bonobo.git', extra_context={'name': name}, no_input=True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def register(parser):
|
def register(parser):
|
||||||
|
|||||||
@ -4,9 +4,7 @@ from bonobo.util.pkgs import bonobo_packages
|
|||||||
|
|
||||||
def format_version(mod, *, name=None, quiet=False):
|
def format_version(mod, *, name=None, quiet=False):
|
||||||
return ('{name} {version}' if quiet else '{name} v.{version} (in {location})').format(
|
return ('{name} {version}' if quiet else '{name} v.{version} (in {location})').format(
|
||||||
name=name or mod.__name__,
|
name=name or mod.__name__, version=mod.__version__, location=bonobo_packages[name or mod.__name__].location
|
||||||
version=mod.__version__,
|
|
||||||
location=bonobo_packages[name or mod.__name__].location
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,9 @@ import os
|
|||||||
def cleanse_sms(row):
|
def cleanse_sms(row):
|
||||||
|
|
||||||
if row['category'] == 'spam':
|
if row['category'] == 'spam':
|
||||||
row['sms_clean'] = '**MARKED AS SPAM** ' + row['sms'][0:50] + ('...' if len(row['sms']) > 50 else '')
|
row['sms_clean'] = '**MARKED AS SPAM** ' + row['sms'][0:50] + (
|
||||||
|
'...' if len(row['sms']) > 50 else ''
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
row['sms_clean'] = row['sms']
|
row['sms_clean'] = row['sms']
|
||||||
|
|
||||||
@ -14,14 +16,13 @@ def cleanse_sms(row):
|
|||||||
|
|
||||||
|
|
||||||
graph = bonobo.Graph(
|
graph = bonobo.Graph(
|
||||||
bonobo.PickleReader('spam.pkl'), # spam.pkl is within the gzipped tarball
|
bonobo.PickleReader('spam.pkl'
|
||||||
|
), # spam.pkl is within the gzipped tarball
|
||||||
cleanse_sms,
|
cleanse_sms,
|
||||||
print
|
print
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
'''
|
'''
|
||||||
This example shows how a different file system service can be injected
|
This example shows how a different file system service can be injected
|
||||||
into a transformation (as compressing pickled objects often makes sense
|
into a transformation (as compressing pickled objects often makes sense
|
||||||
@ -51,8 +52,10 @@ if __name__ == '__main__':
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
'fs': TarFS(
|
'fs':
|
||||||
os.path.join(bonobo.get_examples_path(), 'datasets', 'spam.tgz')
|
TarFS(
|
||||||
|
os.path.
|
||||||
|
join(bonobo.get_examples_path(), 'datasets', 'spam.tgz')
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
bonobo.run(graph, services=services)
|
bonobo.run(graph, services=services)
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import bonobo
|
import bonobo
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
from bonobo.constants import NOT_MODIFIED
|
from bonobo.constants import NOT_MODIFIED
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,8 @@ class ConsoleOutputPlugin(Plugin):
|
|||||||
' `-> ', ' '.join('{}{}{}: {}'.format(Style.BRIGHT, k, Style.RESET_ALL, v)
|
' `-> ', ' '.join('{}{}{}: {}'.format(Style.BRIGHT, k, Style.RESET_ALL, v)
|
||||||
for k, v in append), CLEAR_EOL
|
for k, v in append), CLEAR_EOL
|
||||||
)
|
)
|
||||||
), file=sys.stderr
|
),
|
||||||
|
file=sys.stderr
|
||||||
)
|
)
|
||||||
t_cnt += 1
|
t_cnt += 1
|
||||||
|
|
||||||
@ -116,4 +117,4 @@ class ConsoleOutputPlugin(Plugin):
|
|||||||
def memory_usage():
|
def memory_usage():
|
||||||
import os, psutil
|
import os, psutil
|
||||||
process = psutil.Process(os.getpid())
|
process = psutil.Process(os.getpid())
|
||||||
return process.memory_info()[0] / float(2 ** 20)
|
return process.memory_info()[0] / float(2**20)
|
||||||
|
|||||||
@ -82,7 +82,9 @@ class PrettyPrinter(Configurable):
|
|||||||
return ' '.join(((' ' if i else '-'), str(item), ':', str(value).strip()))
|
return ' '.join(((' ' if i else '-'), str(item), ':', str(value).strip()))
|
||||||
|
|
||||||
def _format_console(self, i, item, value):
|
def _format_console(self, i, item, value):
|
||||||
return ' '.join(((' ' if i else '•'), str(item), '=', str(value).strip().replace('\n', '\n' + CLEAR_EOL), CLEAR_EOL))
|
return ' '.join(
|
||||||
|
((' ' if i else '•'), str(item), '=', str(value).strip().replace('\n', '\n' + CLEAR_EOL), CLEAR_EOL)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
pprint = PrettyPrinter()
|
pprint = PrettyPrinter()
|
||||||
|
|||||||
@ -1,27 +1,24 @@
|
|||||||
-e .[dev]
|
-e .[dev]
|
||||||
|
|
||||||
alabaster==0.7.10
|
alabaster==0.7.10
|
||||||
astroid==1.5.2
|
|
||||||
babel==2.4.0
|
babel==2.4.0
|
||||||
coverage==4.3.4
|
certifi==2017.4.17
|
||||||
|
chardet==3.0.3
|
||||||
|
coverage==4.4.1
|
||||||
docutils==0.13.1
|
docutils==0.13.1
|
||||||
|
idna==2.5
|
||||||
imagesize==0.7.1
|
imagesize==0.7.1
|
||||||
isort==4.2.5
|
|
||||||
jinja2==2.9.6
|
jinja2==2.9.6
|
||||||
lazy-object-proxy==1.2.2
|
|
||||||
markupsafe==1.0
|
markupsafe==1.0
|
||||||
mccabe==0.6.1
|
|
||||||
py==1.4.33
|
py==1.4.33
|
||||||
pygments==2.2.0
|
pygments==2.2.0
|
||||||
pylint==1.7.1
|
pytest-cov==2.5.1
|
||||||
pytest-cov==2.4.0
|
|
||||||
pytest-timeout==1.2.0
|
pytest-timeout==1.2.0
|
||||||
pytest==3.0.7
|
pytest==3.1.0
|
||||||
pytz==2017.2
|
pytz==2017.2
|
||||||
requests==2.13.0
|
requests==2.16.1
|
||||||
six==1.10.0
|
six==1.10.0
|
||||||
snowballstemmer==1.2.1
|
snowballstemmer==1.2.1
|
||||||
sphinx-rtd-theme==0.2.4
|
sphinx==1.6.1
|
||||||
sphinx==1.5.5
|
sphinxcontrib-websupport==1.0.1
|
||||||
wrapt==1.10.10
|
typing==3.6.1
|
||||||
yapf==0.16.1
|
urllib3==1.21.1
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
-e .[jupyter]
|
-e .[jupyter]
|
||||||
|
|
||||||
appnope==0.1.0
|
appnope==0.1.0
|
||||||
bleach==2.0.0
|
bleach==2.0.0
|
||||||
decorator==4.0.11
|
decorator==4.0.11
|
||||||
@ -18,7 +17,7 @@ jupyter-core==4.3.0
|
|||||||
jupyter==1.0.0
|
jupyter==1.0.0
|
||||||
markupsafe==1.0
|
markupsafe==1.0
|
||||||
mistune==0.7.4
|
mistune==0.7.4
|
||||||
nbconvert==5.1.1
|
nbconvert==5.2.1
|
||||||
nbformat==4.3.0
|
nbformat==4.3.0
|
||||||
notebook==5.0.0
|
notebook==5.0.0
|
||||||
pandocfilters==1.4.1
|
pandocfilters==1.4.1
|
||||||
@ -33,7 +32,7 @@ qtconsole==4.3.0
|
|||||||
simplegeneric==0.8.1
|
simplegeneric==0.8.1
|
||||||
six==1.10.0
|
six==1.10.0
|
||||||
terminado==0.6
|
terminado==0.6
|
||||||
testpath==0.3
|
testpath==0.3.1
|
||||||
tornado==4.5.1
|
tornado==4.5.1
|
||||||
traitlets==4.3.2
|
traitlets==4.3.2
|
||||||
wcwidth==0.1.7
|
wcwidth==0.1.7
|
||||||
|
|||||||
@ -1,12 +1,15 @@
|
|||||||
-e .
|
-e .
|
||||||
|
|
||||||
appdirs==1.4.3
|
appdirs==1.4.3
|
||||||
|
certifi==2017.4.17
|
||||||
|
chardet==3.0.3
|
||||||
colorama==0.3.9
|
colorama==0.3.9
|
||||||
enum34==1.1.6
|
enum34==1.1.6
|
||||||
fs==2.0.3
|
fs==2.0.3
|
||||||
pbr==3.0.0
|
idna==2.5
|
||||||
|
pbr==3.0.1
|
||||||
psutil==5.2.2
|
psutil==5.2.2
|
||||||
pytz==2017.2
|
pytz==2017.2
|
||||||
requests==2.13.0
|
requests==2.16.1
|
||||||
six==1.10.0
|
six==1.10.0
|
||||||
stevedore==1.21.0
|
stevedore==1.21.0
|
||||||
|
urllib3==1.21.1
|
||||||
|
|||||||
27
setup.py
27
setup.py
@ -41,41 +41,34 @@ else:
|
|||||||
version = version_ns.get('__version__', 'dev')
|
version = version_ns.get('__version__', 'dev')
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='bonobo',
|
author='Romain Dorgueil',
|
||||||
|
author_email='romain@dorgueil.net',
|
||||||
description=('Bonobo, a simple, modern and atomic extract-transform-load toolkit for '
|
description=('Bonobo, a simple, modern and atomic extract-transform-load toolkit for '
|
||||||
'python 3.5+.'),
|
'python 3.5+.'),
|
||||||
license='Apache License, Version 2.0',
|
license='Apache License, Version 2.0',
|
||||||
install_requires=[
|
name='bonobo',
|
||||||
'colorama >=0.3,<1.0', 'fs >=2.0,<3.0', 'psutil >=5.2,<6.0', 'requests >=2.0,<3.0', 'stevedore >=1.21,<2.0'
|
|
||||||
],
|
|
||||||
version=version,
|
version=version,
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
classifiers=classifiers,
|
classifiers=classifiers,
|
||||||
packages=find_packages(exclude=['ez_setup', 'example', 'test']),
|
packages=find_packages(exclude=['ez_setup', 'example', 'test']),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
data_files=[
|
install_requires=[
|
||||||
(
|
'colorama (>= 0.3, < 1.0)', 'fs (>= 2.0, < 3.0)', 'psutil (>= 5.2, < 6.0)', 'requests (>= 2.0, < 3.0)',
|
||||||
'share/jupyter/nbextensions/bonobo-jupyter', [
|
'stevedore (>= 1.21, < 2.0)'
|
||||||
'bonobo/ext/jupyter/static/extension.js', 'bonobo/ext/jupyter/static/index.js',
|
|
||||||
'bonobo/ext/jupyter/static/index.js.map'
|
|
||||||
]
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
extras_require={
|
extras_require={
|
||||||
'dev': [
|
'dev': [
|
||||||
'coverage >=4,<5', 'pylint >=1,<2', 'pytest >=3,<4', 'pytest-cov >=2,<3', 'pytest-timeout >=1,<2', 'sphinx',
|
'coverage (>= 4.4, < 5.0)', 'pytest (>= 3.1, < 4.0)', 'pytest-cov (>= 2.5, < 3.0)',
|
||||||
'sphinx_rtd_theme', 'yapf'
|
'pytest-timeout (>= 1, < 2)', 'sphinx (>= 1.6, < 2.0)'
|
||||||
],
|
],
|
||||||
'jupyter': ['jupyter >=1.0,<1.1', 'ipywidgets >=6.0.0.beta5']
|
'jupyter': ['ipywidgets (>= 6.0.0.beta5)', 'jupyter (>= 1.0, < 1.1)']
|
||||||
},
|
},
|
||||||
entry_points={
|
entry_points={
|
||||||
'bonobo.commands': [
|
'bonobo.commands': [
|
||||||
'init = bonobo.commands.init:register', 'run = bonobo.commands.run:register',
|
'init = bonobo.commands.init:register', 'run = bonobo.commands.run:register',
|
||||||
'version = bonobo.commands.version:register'
|
'version = bonobo.commands.version:register'
|
||||||
],
|
],
|
||||||
'console_scripts': ['bonobo = bonobo.commands:entrypoint'],
|
'console_scripts': ['bonobo = bonobo.commands:entrypoint']
|
||||||
'edgy.project.features': ['bonobo = '
|
|
||||||
'bonobo.ext.edgy.project.feature:BonoboFeature']
|
|
||||||
},
|
},
|
||||||
url='https://www.bonobo-project.org/',
|
url='https://www.bonobo-project.org/',
|
||||||
download_url='https://github.com/python-bonobo/bonobo/tarball/{version}'.format(version=version),
|
download_url='https://github.com/python-bonobo/bonobo/tarball/{version}'.format(version=version),
|
||||||
|
|||||||
@ -28,9 +28,8 @@ def test_write_pickled_dict_to_file(tmpdir):
|
|||||||
|
|
||||||
def test_read_pickled_list_from_file(tmpdir):
|
def test_read_pickled_list_from_file(tmpdir):
|
||||||
fs, filename = open_fs(tmpdir), 'input.pkl'
|
fs, filename = open_fs(tmpdir), 'input.pkl'
|
||||||
fs.open(filename, 'wb').write(pickle.dumps([
|
fs.open(filename,
|
||||||
['a', 'b', 'c'], ['a foo', 'b foo', 'c foo'], ['a bar', 'b bar', 'c bar']
|
'wb').write(pickle.dumps([['a', 'b', 'c'], ['a foo', 'b foo', 'c foo'], ['a bar', 'b bar', 'c bar']]))
|
||||||
]))
|
|
||||||
|
|
||||||
reader = PickleReader(path=filename)
|
reader = PickleReader(path=filename)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user