diff --git a/README.md b/README.md index 5c68de5..26764ba 100644 --- a/README.md +++ b/README.md @@ -34,45 +34,38 @@ use the [pywikibot framework](https://www.mediawiki.org/wiki/Manual:Pywikibot). ## Setup -> **Note**: pywikitools base path refers to the directory where you can find -> `README.md`, `CONTRIBUTING.md`, and `requirements.txt`. - -1. Install required libraries within a `virtualenv`: +1. Install LibreOffice UNO (python bridge, on linux) + ```shell + $ sudo apt-get install python3-uno + ``` + > This is required for our LibreOffice module and scripts using it + > (`translateodt.py`), and to run the complete test suite. - > We strongly recommend you to use a virtual environment to manage your - Python dependencies. +2. Install required python packages + > We assume you're in the root directory ("base path") of `pywikitools`: + > the directory where you find `README.md` and `requirements.txt`. - * Install `virtualenv`: + * Set up a virtual environment ```shell - $ sudo python -m pip install virtualenv + $ python3 -m venv env --system-site-packages ``` - * Create a new virtual environment: - - ```shell - $ virtualenv new_venv_name - ``` + > You need `--system-site-packages` so that the `uno` package + > you just installed globally gets available * Activate the virtual environment: ```shell - $ source new_venv_name/bin/activate + $ source env/bin/activate ``` - * At the root directory of `pywikitools`, run: + * Install the necessary packages ```shell $ pip install -r requirements.txt ``` -2. Install LibreOffice UNO (python bridge, on linux) - ```shell - $ sudo apt-get install python3-uno - ``` - > This is required for our LibreOffice module and scripts using it - > (`translateodt.py`), and to run the complete test suite. - 3. Set up configuration in `config.ini`: ```shell $ cp config.example.ini config.ini @@ -85,14 +78,14 @@ use the [pywikibot framework](https://www.mediawiki.org/wiki/Manual:Pywikibot). * Configure all other necessary options like usernames and site (connect to `4training.net` / `test.4training.net` / [local docker-based server](https://github.com/4training/docker) `localhost:8082`) -4. You're ready to go! Look at the different scripts and how to invoke them and - try them out! To get to know everything and to understand what is going on, - set the logging level to INFO (default is WARN) by adding `-l info`. +You're ready to go! Look at the different scripts and how to invoke them and +try them out! To get to know everything and to understand what is going on, +set the logging level to INFO (default is WARN) by adding `-l info`. ## Run scripts ```shell -$ python3 path/to/script args +$ python path/to/script args ``` If you're not yet logged in, `pywikibot` will ask you for the password for the @@ -105,7 +98,7 @@ From your base pywikitools path, use the following command to run the test suite. ```shell -$ python3 -m unittest discover -s pywikitools/test +$ python -m unittest discover -s pywikitools/test ``` Also, run the next command to check for linting issues diff --git a/setup.cfg b/setup.cfg index 193c7eb..4759683 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,7 +15,7 @@ replace = __version__ = '{new_version}' universal = 1 [flake8] -exclude = docs,pywikitools/user-config.py,pywikitools/correctbot/user-config.py +exclude = env,docs,pywikitools/user-config.py,pywikitools/correctbot/user-config.py max-line-length = 120 # TODO enable E501 for generateodt.py some day per-file-ignores =