Introduction
This package implements a very minimal upgrade framework for use in Python applications. Its design consists of three parts:
context providers, which are responsible for setting up the context required for an upgrade step. For example establishing a connection to a SQL server or configuring SQLALchemy.
upgrade steps, which are functions that perform the actual upgrade steps.
a commandline tool to run the upgrade steps and required context providers.
In order to keep the framework minimal there are a few things which are deliberately not supported:
No versioning of the environment is done; the tool will always run all all upgrade steps. Each step must support being run multiple times without unexpected results.
Downgrades are not supported.
Depdendencies between upgrade steps are not supported.
Here is a basic context provider which configures SQLAlchemy:
@upgrade_context('sql')
def setup_sqlalchemy(options):
engine = create_engine('postgresql:///projectA')
return {'sql-engine': engine}
Here is an example upgrade step to add missing tables and indices in a project using SQLALchemy:
@upgrade_step(require=['sql'])
def add_missing_tables(environment):
meta.metadata.create_all(environment['sql-engline'])
And this is how you run the upgrade:
$ bin/upgrade --scan my.package
Metadata
Release files for s4u.upgrade 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| s4u.upgrade-1.3.tar.gz | 11.7 kB | Without provenance | Details for s4u.upgrade-1.3.tar.gz |
Release files / s4u.upgrade-1.3.tar.gz
| Download URL | s4u.upgrade-1.3.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8064f7724c93f35658c17103eae2d4be2159b3254a44c501a27d5f1e3c422d66
|
|
BLAKE2b-256 checksum How to use checksums |
e01f052a553d3192189bee513260d549a586c593c77eea602912033801efd78b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for s4u.upgrade 1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.