You can either fork Spooq and create a PR on github or get in contact with the authors to get access to the repo.
Spooq was built with extensibility in mind which results in clearly separated and independent modules and classes.
- python 3.8
- Java 8+ (jdk8-openjdk)
- pipenv
- Latex (for PDF documentation)
The requirements are stored in the file Pipfile
separated for production and development packages.
Run the following command to install the packages needed for development and testing:
$ pipenv install --dev
This will create a virtual environment in ~/.local/share/virtualenvs
.
If you want to have your virtual environment installed as a sub-folder (.venv) you have to set the environment variable PIPENV_VENV_IN_PROJECT
to 1.
To remove a virtual environment created with pipenv just change in the folder where you created it and execute pipenv --rm
.
$ pipenv shell
$ exit
# or close the shell
For more commands of pipenv call pipenv -h
or got to their documentation
Implementing new extractors, transformers, or loaders is fairly straightforward. Please refer to following descriptions and examples to get an idea:
custom_extractor
custom_transformer
custom_loader
The tests are implemented with the pytest framework.
$ pipenv shell
$ cd tests
$ pytest
Those are the most useful plugins automatically used:
$ pytest --html=report.html
Shuffles the order of execution for the tests to avoid / discover dependencies of the tests.
Randomization is set by a seed number. To re-test the same order of execution where you found an error, just set the seed value to the same as for the failing test. To temporarily disable this feature run with pytest -p no:random-order -v
Generates an HTML for the test coverage
$ pytest --cov-report term --cov=spooq
$ pytest --cov-report html:cov_html --cov=spooq
To use ipdb (IPython Debugger) add following code at your breakpoint:
>>> import ipdb
>>> ipdb.set_trace()
You have to start pytest with -s
if you want to use interactive debugger.
$ pytest -s
This project uses Sphinx for creating its documentation. Graphs and diagrams are produced with PlantUML.
The main documentation content is defined as docstrings within the source code. To view the current documentation open docs/build/html/index.html
or docs/build/latex/spooq.pdf
in your application of choice.
Although, if you are reading this, you have probably already found the documentation...
For generating the graphs and diagrams, you need a working plantuml installation on your computer! Please refer to sphinxcontrib-plantuml.
$ cd docs
$ make html
$ chromium build/html/index.html
For generating documentation in the PDF format you need to have a working (pdf)latex installation on your computer! Please refer to TexLive on how to install TeX Live - a compatible latex distribution. But beware, the download size is huge!
$ cd docs
$ make latexpdf
$ evince build/latex/Spooq.pdf
Themes, plugins, settings, ... are defined in docs/source/conf.py
.
Enables support for parsing docstrings in NumPy / Google Style
Allows linking to other projects’ documentation. E.g., PySpark, Python3 To add an external project, at the documentation link to intersphinx_mapping
in conf.py
This allows you to write CommonMark (Markdown) inside of Docutils & Sphinx projects instead of rst.
Allows for inline Plant UML code (uml directive) which is automatically rendered into an svg image and placed in the document. Allows also to source puml-files. for an example.
For any update on PyPi we need a new version number. You can manually edit the file spooq/_version.py to change the version number. This is reflected in the setup.py and consequently in the release version number.
Please don't forget to also update the documentation accordingly. This is either done directly in the source code as docstrings or for more overview-centered topics in the rst file under docs/source.
Please add your changes to the CHANGELOG.rst
The current Spooq version is automatically published on PyPi after a release on github is created.
$ python setup.py sdist bdist_wheel
$ pipenv shell
$ twine upload --repository-url https://test.pypi.org/legacy/ dist/
Your new version is available at https://test.pypi.org/project/Spooq/. Beware, that the test PyPi uses different credentials than the real PyPi. You can get the credentials from your favourite collaborator.
$ pipenv shell
$ twine upload dist/
Your new version is available at https://pypi.org/project/Spooq/. You can get the credentials from your favourite collaborator.