Skip to main content

Tiamat Pip

Pip handling for tiamat projects

Setup

In order to be able to pip install packages which can be used with your tiamat packaged application you need to add tiamat-pip as a dependency and your run.py should look similar to:

#!/usr/bin/env python3

import sys
import multiprocessing

import tiamatpip.cli
import tiamatpip.configure

import mainapp

# Configure the path where to install the new packages
tiamatpip.configure.set_user_site_packages_path("THIS SHOULD BE A HARDCODED PATH")


def main(argv):
    # Let's see if we should be handling pip related stuff
    if tiamatpip.cli.should_redirect_argv(argv):
        tiamatpip.cli.process_pip_argv(argv)
        # You can choose to `return` but there's really no need since the pip command
        # interceptions will trigger a `sys.exit` with the appropriate exit code.

    # If we reached this far, it means we're not handling pip stuff
    # Your application logic can resume

    mainapp.main(argv)
    sys.exit(0)


if __name__ == "__main__":
    if sys.platform.startswith("win"):
        multiprocessing.freeze_support()
    main(sys.argv)

Usage

When your package is compiled with tiamat and includes tiamat-pip, the pip commands get intercepted and the code logic runs within your packaged binary python runtime.

All pip commands and their respective CLI flags are supported.

Showing the pip usage and help

your-project-binary pip --help
your-project-binary pip install --help

Installing a python package

your-project-binary pip install foo
your-project-binary pip install foo>=2.1.0

Listing installed packages

your-project-binary pip list

This will list all of the python packages that were installed using pip, which, are not included in the binary.

Listing packages shipped with the binary

If you want to know which packages, and their respective versions, were shipped with the tiamat binary, issue the following command:

your-project-binary pip frozen

This command is not supported by pip. We intercept the call and get the package listing from the right place. The CLI flags for this command are the same as for pip list.

Uninstalling a package

your-project-binary pip uninstall foo

ATTENTION: Only the packages installed by pip can be uninstalled. The packages that were shipped with the binary cannot be uninstalled.

Known Issues

  • Getting the version of an upgraded package using pkg_resources.get_distribution(pkgname).version returns the version of the package that was shipped with the tiamat binary and not the upgraded package version. See #11 for more information.

Metadata

Release files for tiamat-pip 1.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tiamat-pip 1.11.0
File Size Uploaded
tiamat-pip-1.11.0.tar.gz 36.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tiamat-pip 1.11.0
File Interpreter ABI Platform
tiamat_pip-1.11.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.2 MB

Release files / tiamat-pip-1.11.0.tar.gz

Download URL tiamat-pip-1.11.0.tar.gz
Size 36.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a8ed5f2b8dde6f19c8421db14c850dcde2ba9e850e984d12d1f5ee658ab22cb9
BLAKE2b-256 checksum
How to use checksums
5ade92a3cc3e5ffcd94edfe6da640516316c378efbe658e2ecef69ff33824cb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.12

Release files / tiamat_pip-1.11.0-py3-none-any.whl

Download URL tiamat_pip-1.11.0-py3-none-any.whl
Size 2.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0e5b3d9b021eaf83c63697cc5ae53c73a5ab2341b0154fc8977c93578f97eaae
BLAKE2b-256 checksum
How to use checksums
2d73db8444bd1bd1faa52712df33dfd1231c8f85d638ff7671a242d74ee50a92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.12

Release history Release notifications | RSS feed

This release

1.11.0 This release

2 release files

1.10.1

2 release files

1.10.0

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.9.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page