@@ -34,45 +34,38 @@ use the [pywikibot framework](https://www.mediawiki.org/wiki/Manual:Pywikibot).
3434
3535## Setup
3636
37- > ** Note** : pywikitools base path refers to the directory where you can find
38- > ` README.md ` , ` CONTRIBUTING.md ` , and ` requirements.txt ` .
39-
40- 1 . Install required libraries within a ` virtualenv ` :
37+ 1 . Install LibreOffice UNO (python bridge, on linux)
38+ ``` shell
39+ $ sudo apt-get install python3-uno
40+ ```
41+ > This is required for our LibreOffice module and scripts using it
42+ > (` translateodt.py ` ), and to run the complete test suite.
4143
42- > We strongly recommend you to use a virtual environment to manage your
43- Python dependencies.
44+ 2 . Install required python packages
45+ > We assume you're in the root directory ("base path") of ` pywikitools ` :
46+ > the directory where you find ` README.md ` and ` requirements.txt ` .
4447
45- * Install ` virtualenv ` :
48+ * Set up a virtual environment
4649
4750 ``` shell
48- $ sudo python -m pip install virtualenv
51+ $ python3 -m venv env --system-site-packages
4952 ```
5053
51- * Create a new virtual environment:
52-
53- ` ` ` shell
54- $ virtualenv new_venv_name
55- ` ` `
54+ > You need ` --system-site-packages` so that the ` uno` package
55+ > you just installed globally gets available
5656
5757 * Activate the virtual environment:
5858
5959 ` ` ` shell
60- $ source new_venv_name /bin/activate
60+ $ source env /bin/activate
6161 ` ` `
6262
63- * At the root directory of ` pywikitools ` , run:
63+ * Install the necessary packages
6464
6565 ` ` ` shell
6666 $ pip install -r requirements.txt
6767 ` ` `
6868
69- 2. Install LibreOffice UNO (python bridge, on linux)
70- ` ` ` shell
71- $ sudo apt-get install python3-uno
72- ` ` `
73- > This is required for our LibreOffice module and scripts using it
74- > (` translateodt.py` ), and to run the complete test suite.
75-
76693. Set up configuration in ` config.ini` :
7770 ` ` ` shell
7871 $ cp config.example.ini config.ini
@@ -85,14 +78,14 @@ use the [pywikibot framework](https://www.mediawiki.org/wiki/Manual:Pywikibot).
8578 * Configure all other necessary options like usernames and site (connect to
8679 ` 4training.net` / ` test.4training.net` / [local docker-based server](https://github.com/4training/docker) ` localhost:8082` )
8780
88- 4. You' re ready to go! Look at the different scripts and how to invoke them and
89- try them out! To get to know everything and to understand what is going on,
90- set the logging level to INFO (default is WARN) by adding `-l info`.
81+ You' re ready to go! Look at the different scripts and how to invoke them and
82+ try them out! To get to know everything and to understand what is going on,
83+ set the logging level to INFO (default is WARN) by adding `-l info`.
9184
9285## Run scripts
9386
9487```shell
95- $ python3 path/to/script args
88+ $ python path/to/script args
9689```
9790
9891If 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
10598suite.
10699
107100```shell
108- $ python3 -m unittest discover -s pywikitools/test
101+ $ python -m unittest discover -s pywikitools/test
109102```
110103
111104Also, run the next command to check for linting issues
0 commit comments