Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PyThemis installation instructions #317

Merged
merged 12 commits into from
Nov 30, 2023
23 changes: 13 additions & 10 deletions content/themis/languages/python/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ you can manually build and install the latest version of Themis from source code

2. Create a "wheel" package

<!-- FIXME: For some reason (missing install tools in venv?) the build fails when venv is activated,
resolve this or if that's not an issue, just remove this comment -->
Run this command outside of virtual environment:
```bash
make pythemis_make_wheel
```
Expand All @@ -92,15 +89,16 @@ you can manually build and install the latest version of Themis from source code
Result: src/wrappers/themis/python/dist/pythemis-0.14.0-py2.py3-none-any.whl
```

3. Install PyThemis in your virtual environment
3. Install PyThemis into virtual environment

Activate your virtual environment and run
```bash
pip install src/wrappers/themis/python/dist/pythemis-0.14.0-py2.py3-none-any.whl
make pythemis_install_wheel
```

If the virtual environment already contained PyThemis,
add `--force-reinstall` option to `pip install` to rewrite the previous version
Or run `pip install pythemis-...-none-any.whl` (the package file previously created).
If the virtual environment already contained PyThemis of the same version,
add `--force-reinstall` option to rewrite the previous package.

<!-- DRAFT FOR OS PACKAGES FOR PROPER GLOBAL INSTALLATION
To install PyThemis globally, you need to create a system package first:
Expand All @@ -122,8 +120,8 @@ For Debian/Ubuntu it's a `.deb` file, install with `sudo dpkg -i <filename>`.
[PEP 668](https://peps.python.org/pep-0668/) changed the way Python packages are managed.
It is now recommended to use `pip install` to only install packages into isolated virtual environments
while installing things system-wide should be done using OS package manager (like `apt` or `rpm`).
vixentael marked this conversation as resolved.
Show resolved Hide resolved
This means running `sudo make pythemis_install` is no longer recommended as it copies files
into system-managed Python directory that is no longer maintained by `pip`.
This means running `sudo make pythemis_old_install` is no longer recommended as it copies files
into system-managed Python directory (like `/usr/lib/python3.X/site-packages`) that is no longer maintained by `pip`.
Consider building a `.whl` and installing it into your venv instead.
{{< /hint >}}

Expand All @@ -133,7 +131,7 @@ Consider building a `.whl` and installing it into your venv instead.
2. Install PyThemis package from the source code:

```bash
make pythemis_install
sudo make pythemis_old_install
```

The package will be installed globally into the system.
Expand All @@ -143,3 +141,8 @@ Consider building a `.whl` and installing it into your venv instead.
```bash
make prepare_tests_all test_python
```

To remove PyThemis after using `pythemis_old_install`, run
```bash
sudo pip uninstall --break-system-packages pythemis
vixentael marked this conversation as resolved.
Show resolved Hide resolved
```