New bag implementation improves a lot how bonobo works, even if this is highly backward incompatible (sorry, that's needed, and better sooner than later). * New implementation uses the same approach as python's namedtuple, by dynamically creating the python type's code. This has drawbacks, as it feels like not the right way, but also a lot of benefits that cannot be achieved using a regular approach, especially the constructor parameter order, hardcoded. * Memory usage is now much more efficient. The "keys" memory space will be used only once per "io type", being spent in the underlying type definition instead of in the actual instances. * Transformations now needs to use tuples as output, which will be bound to its "output type". The output type can be infered from the tuple length, or explicitely set by the user using either `context.set_output_type(...)` or `context.set_output_fields(...)` (to build a bag type from a list of field names). Jupyter/Graphviz integration is more tight, allowing to easily display graphs in a notebook, or displaying the live transformation status in an html table instead of a simple <div>. For now, context processors were hacked to stay working as before but the current API is not satisfactory, and should be replaced. This new big change being unreasonable without some time to work on it properly, it is postponed for next versions (0.7, 0.8, ...). Maybe the best idea is to have some kind of "local services", that would use the same dependency injection mechanism as the execution-wide services. Services are now passed by keywoerd arguments only, to avoid confusion with data-arguments.
60 lines
1.9 KiB
Makefile
60 lines
1.9 KiB
Makefile
# Generated by Medikit 0.4.2 on 2017-11-26.
|
|
# All changes will be overriden.
|
|
|
|
PACKAGE ?= bonobo
|
|
PYTHON ?= $(shell which python)
|
|
PYTHON_BASENAME ?= $(shell basename $(PYTHON))
|
|
PYTHON_DIRNAME ?= $(shell dirname $(PYTHON))
|
|
PYTHON_REQUIREMENTS_FILE ?= requirements.txt
|
|
PYTHON_REQUIREMENTS_DEV_FILE ?= requirements-dev.txt
|
|
QUICK ?=
|
|
PIP ?= $(PYTHON_DIRNAME)/pip
|
|
PIP_INSTALL_OPTIONS ?=
|
|
VERSION ?= $(shell git describe 2>/dev/null || git rev-parse --short HEAD)
|
|
PYTEST ?= $(PYTHON_DIRNAME)/pytest
|
|
PYTEST_OPTIONS ?= --capture=no --cov=$(PACKAGE) --cov-report html
|
|
SPHINX_BUILD ?= $(PYTHON_DIRNAME)/sphinx-build
|
|
SPHINX_OPTIONS ?=
|
|
SPHINX_SOURCEDIR ?= docs
|
|
SPHINX_BUILDDIR ?= $(SPHINX_SOURCEDIR)/_build
|
|
YAPF ?= $(PYTHON) -m yapf
|
|
YAPF_OPTIONS ?= -rip
|
|
|
|
.PHONY: $(SPHINX_SOURCEDIR) clean format install install-dev test update update-requirements
|
|
|
|
# Installs the local project dependencies.
|
|
install:
|
|
if [ -z "$(QUICK)" ]; then \
|
|
$(PIP) install -U pip wheel $(PIP_INSTALL_OPTIONS) -r $(PYTHON_REQUIREMENTS_FILE) ; \
|
|
fi
|
|
|
|
# Installs the local project dependencies, including development-only libraries.
|
|
install-dev:
|
|
if [ -z "$(QUICK)" ]; then \
|
|
$(PIP) install -U pip wheel $(PIP_INSTALL_OPTIONS) -r $(PYTHON_REQUIREMENTS_DEV_FILE) ; \
|
|
fi
|
|
|
|
# Cleans up the local mess.
|
|
clean:
|
|
rm -rf build dist *.egg-info
|
|
|
|
# Update project artifacts using medikit, after installing it eventually.
|
|
update:
|
|
python -c 'import medikit; print(medikit.__version__)' || pip install medikit;
|
|
$(PYTHON) -m medikit update
|
|
|
|
# Remove requirements files and update project artifacts using medikit, after installing it eventually.
|
|
update-requirements:
|
|
rm -rf requirements*.txt
|
|
$(MAKE) update
|
|
|
|
test: install-dev
|
|
$(PYTEST) $(PYTEST_OPTIONS) tests
|
|
|
|
$(SPHINX_SOURCEDIR): install-dev
|
|
$(SPHINX_BUILD) -b html -D latex_paper_size=a4 $(SPHINX_OPTIONS) $(SPHINX_SOURCEDIR) $(SPHINX_BUILDDIR)/html
|
|
|
|
format: install-dev
|
|
$(YAPF) $(YAPF_OPTIONS) .
|
|
$(YAPF) $(YAPF_OPTIONS) Projectfile
|