Development setup¶
Dependencies¶
This project requires running installations of Postgres and Elasticsearch. They are configured automatically during start up of the application if the connections are setup correctly in the settings.ini-file. Meaning tables and indexes are created automatically during start up. Therefore a database user with appropriate rights should be used.
This repository makes setting up a dev environment easy by providing a Docker Compose setup that is operated via pipenv. The setup tutorial uses this method.
Setup¶
Install docker and docker-compose.
- Install pipenv.You might want to set
export PIPENV_VENV_IN_PROJECT=1in your.bashrc/.zshrcfor local virtual environments. Thereby you are making sure that all dependencies for your application are stored in the same directory under the.venvfolder. Clone repository into preferred directory (or simply download the source code and rename the folder as you like):
git clone https://github.com/bockstaller/europarl-crawlerInstall packages:
cd europarl-crawler && pipenv install --devActivate virtual environment:
pipenv shellStart the needed external services:
pipenv run env_upSanity check the
settings.inifile. Especially the path configured in the[Downloader]section.Run the tests:
pipenv run testBuild the documentation by running
pipenv run docs_htmlorpipenv run docs_pdf. The resulting documentation is stored in./docs/_build/.... For PDF a localpdfTexinstallation is necessary.Install Git hooks. Installation and Activation are described here.
Use the CLI to run the crawler. Use
eurocli --helpto get guidance.
Note: To deactivate the environment again, run pipenv run env_down to tear down the elasticsearch and postgres services. An d run deactivate to leave the Python virtual environment.