Skip to main content

Declarative external resources with implicit deployment

Project description

Declarative resources with implicit deployment

This package provide classes that allow to setup external resources (utilities, python packages, executables etc.) that will be deployed as they are used. In most cases data should be on the web and it will be deployed and cached locally on only first usage.

There are several examples in test/ folder and getpack.library module already defined and useable. But main intention is to provide framework for declarative setup of any resource and work with it without care of deployment.

from getpack.resource import WebResource
class Example(WebResource):
    version = '0.1'
    archive_url = 'https://example.com/example-0.1.zip'

then it would be used:

import subprocess
subprocess.call(Example()().path / 'example.exe')

Second round braces required to actually make an effect from resource and first round braces used to initialize resource class, that would produce resource descriptions on the fly like follows:

Example(version='0.2', archive_url='https://Example.com/example-0.2.zip')

You may experiment with following working snippet and try to change PySide2 version:

python -c "import getpack.library;getpack.library.PySide2(version='5.14.1')(); import PySide2.QtWidgets; app=PySide2.QtWidgets.QApplication(); w=PySide2.QtWidgets.QPushButton(PySide2.__version__); w.clicked.connect(w.close); w.show(); app.exec_()"

TODO

  • Utilize requirements.txt to reproduce both development and production environments.

Testings

For linux testing with Docker, run: docker build -t test . && docker run -it --rm test pytest .

Environs

  • GETPACK_RETRIES - int, number of general retries, used for renaming and removing temporary folders
  • GETPACK_BACKOFF - float, delay between retires
  • GETPACK_ROOT - str, default root folder for all resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

getpack-0.5.1.tar.gz (12.5 kB view details)

Uploaded Source

File details

Details for the file getpack-0.5.1.tar.gz.

File metadata

  • Download URL: getpack-0.5.1.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for getpack-0.5.1.tar.gz
Algorithm Hash digest
SHA256 a7a22391f72c600228fec57245a952fdf862e57f2721a85484ebc74eef9aec81
MD5 3a179e7121a8b59d7215389aa1292670
BLAKE2b-256 9f2145722bdca73cff1315f7cb50d8ae7998bd7304270a9056a75780474c8bec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page