|
1 | | - |
2 | 1 | =========== |
3 | 2 | Usage Guide |
4 | 3 | =========== |
@@ -30,56 +29,64 @@ Requirements |
30 | 29 | ------------ |
31 | 30 |
|
32 | 31 | 1. Requires Python_ 3.8 or newer. |
33 | | -2. Requires `pip` installer. You may check it's availability from command line with:: |
| 32 | +2. Requires pytest_ 7.4 or newer. |
| 33 | +3. If you want to develop the Firebird QA plugin itself, you'll also need Hatch_ 1.9 or newer. |
| 34 | +4. It's **recommended** to use the pipx_ tool to install and manage `firebird-qa` and `hatch`, |
| 35 | + or at least use the separate Python virtual environment to install and run the QA suite, |
| 36 | + especially on Linux where Python `site-packages` are managed by Linux distribution package |
| 37 | + manager. |
34 | 38 |
|
35 | | - > pip --help |
| 39 | +Installing pipx |
| 40 | +--------------- |
36 | 41 |
|
37 | | - If `pip` is not installed, you may install it with:: |
| 42 | +You can install `pipx` using `pip` in command prompt / terminal with:: |
38 | 43 |
|
39 | | - > python -m ensurepip |
| 44 | + python -m pip install pipx |
40 | 45 |
|
41 | | -3. It's **recommended** to create separate Python virtual environment to install and run |
42 | | - the QA suite, especially on Linux where Python `site-packages` are managed by Linux |
43 | | - distribution package manager. |
| 46 | +or by using other suitable method listed at pipx_ website. |
44 | 47 |
|
45 | | - There are multiple ways how to create and manage Python virtual environments, but we |
46 | | - recommend to use virtualenv_, together with virtualenvwrapper_ (for Linux) or |
47 | | - virtualenvwrapper-win_ (for Windows). |
| 48 | +.. note:: |
48 | 49 |
|
49 | | - On Linux, the `virtualenv` and `virtualenvwrapper` are typically available for installation |
50 | | - from ditribution repository via package manager, which is also the preferred way to |
51 | | - install them on this platform. |
| 50 | + Don't forget to run:: |
52 | 51 |
|
53 | | - On Windows, you should install `virtualenv` and `virtualenvwrapper-win` via `pip`. |
| 52 | + pipx ensurepath |
54 | 53 |
|
55 | | -Installation |
56 | | ------------- |
| 54 | + once after installation to ensure that tools installed via `pipx` will be available on |
| 55 | + search path. |
| 56 | + |
| 57 | +Installing QA tools for regular use |
| 58 | +----------------------------------- |
| 59 | + |
| 60 | +From command prompt / terminal execute:: |
| 61 | + |
| 62 | + pipx install --include-deps firebird-qa |
| 63 | + |
| 64 | +If you want to install specific version, you can use version specification. For example:: |
57 | 65 |
|
58 | | -1. Open the command prompt / terminal. |
| 66 | + pipx install --include-deps firebird-qa==0.19.0 |
59 | 67 |
|
60 | | -2. Clone the firebird-qa repository:: |
| 68 | +will install `firebird-qa` version 0.19.0. |
61 | 69 |
|
62 | | - > git clone https://github.com/FirebirdSQL/firebird-qa.git |
| 70 | +Installing QA tools for plugin development |
| 71 | +------------------------------------------ |
63 | 72 |
|
64 | | -3. Activate the Python virtual environment you created for QA, or skip this step if you |
65 | | - want to install everything into main site-packages. |
| 73 | +Open the command prompt / terminal, switch to QA root directory and execute:: |
66 | 74 |
|
67 | | -4. Switch to directory with cloned `firebird-qa` repository. |
| 75 | + pipx install --include-deps -e . |
68 | 76 |
|
69 | | - .. note:: |
70 | 77 |
|
71 | | - We'll refer to this directory as `QA root directory`. |
| 78 | +Upgrading QA tools |
| 79 | +------------------ |
72 | 80 |
|
73 | | -5. Install the plugin with pip, running:: |
| 81 | +You can upgrade your installation to latest published version using:: |
74 | 82 |
|
75 | | - > pip install -e . |
| 83 | + pipx upgrade firebird-qa |
76 | 84 |
|
77 | | - This will install Firebird QA plugin for `pytest`, along with required dependencies. |
| 85 | +Alternativelly, you can reinstall it using:: |
78 | 86 |
|
79 | | - .. important:: |
| 87 | + pipx reinstall firebird-qa |
80 | 88 |
|
81 | | - You must re-install the plugin every time you see that `git pull` updated |
82 | | - the `setup.cfg` file! |
| 89 | +The reinstallation will also upgrade all dependencies. |
83 | 90 |
|
84 | 91 |
|
85 | 92 | Configuration |
@@ -150,7 +157,8 @@ Basics |
150 | 157 |
|
151 | 158 | 1. Open the terminal / command-line. |
152 | 159 |
|
153 | | -2. If you installed Firebird QA in Python virtual environment, **activate it**. |
| 160 | +2. If you DID NOT USED `pipx`, but installed Firebird QA in Python virtual environment you |
| 161 | + created manually, **activate it**. |
154 | 162 |
|
155 | 163 | 3. Switch to QA root directory. |
156 | 164 |
|
@@ -189,17 +197,20 @@ Example:: |
189 | 197 |
|
190 | 198 | > pytest |
191 | 199 | ====================================================== test session starts ======================================================= |
192 | | - platform linux -- Python 3.8.12, pytest-7.0.0, pluggy-1.0.0 -- /home/job/python/envs/qa/bin/python |
| 200 | + platform linux -- Python 3.11.8, pytest-8.0.1, pluggy-1.4.0 -- /home/pcisar/.local/pipx/venvs/firebird-qa/bin/python |
193 | 201 | cachedir: .pytest_cache |
194 | 202 | System: |
195 | 203 | encodings: sys:utf-8 locale:UTF-8 filesystem:utf-8 |
196 | 204 | Firebird: |
197 | | - server: local [v3.0.9.33562, SuperServer, Firebird/Linux/AMD/Intel/x64] |
| 205 | + configuration: firebird-driver.conf |
| 206 | + ODS: 13.1 |
| 207 | + server: local [v5.0.0.1306, SuperServer, Firebird/Linux/AMD/Intel/x64] |
198 | 208 | home: /opt/firebird |
199 | 209 | bin: /opt/firebird/bin |
200 | 210 | client library: libfbclient.so.2 |
201 | | - rootdir: /home/job/python/projects/firebird-qa, configfile: pytest.ini, testpaths: tests |
202 | | - plugins: firebird-qa-0.12.1 |
| 211 | + rootdir: /home/job/python/projects/firebird-qa |
| 212 | + configfile: pytest.ini |
| 213 | + plugins: firebird-qa-0.19.2 |
203 | 214 | collected 2385 items / 475 deselected / 1910 selected |
204 | 215 |
|
205 | 216 | issue.full-join-push-where-predicate PASSED [ 1/1910] |
@@ -928,3 +939,6 @@ How to use temporary files |
928 | 939 | .. _Python package: https://docs.python.org/3/tutorial/modules.html#packages |
929 | 940 | .. _module: https://docs.python.org/3/tutorial/modules.html |
930 | 941 | .. _docstring: https://docs.python.org/3/glossary.html#term-docstring |
| 942 | +.. _pipx: https://pipx.pypa.io |
| 943 | +.. _venv: https://docs.python.org/3/library/venv.html |
| 944 | +.. _hatch: https://hatch.pypa.io |
0 commit comments