ineedpy2: Library to swap to newer python version on a multi-version system.
Find the latest Python 2 version installed on the system and if this program is not running on that version, re-invoke it with that version.
Background
One of the problems of a system administrator is that enterprise Linux distros which ship with, and often require, /usr/bin/python to be a fairly old versions. For example, Python 2.1. Applications can be very difficult to write such that they are happy on Python 2.1 and Python 2.7. Many of these distros include a newer Python, but it has to be invoked as “python2.6”, for example.
You can change the “#!” line in the script, but this makes packaging more difficult.
Examples
To make sure you are running on the absolutely latest installed Python 2 on the system:
import sys print ‘Version:’, sys.version_info import ineedpy2 ineedpy2.rerunonlatest()
If run on a system with the default Python version being 2.1, but python 2.6 also installed will display:
Version: (2, 1, 3, ‘final’, 0) Version: (2, 6, 5, ‘final’, 0)
NOTE: Anything run before the “runonlatestpy2” will be run once on the older version and once on the newer version.
You can also request the reinvocation only if the python minor version isn’t at least a specific value. In other words, “I know I need at least Python 2.4”:
from ineedpy2 import requireminor requireminor(4)
License
Copyright (c) 2011, Sean Reifschneider <jafo@tummy.com>, tummy.com, ltd. Released under the Python Software Foundation License For more information, see: http://docs.python.org/license.html
Metadata
Release files for ineedpy2 1.01
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 |
|---|---|---|---|---|
| ineedpy2-1.01.tar.gz | 2.3 kB | Without provenance | Details for ineedpy2-1.01.tar.gz |
Release files / ineedpy2-1.01.tar.gz
| Download URL | ineedpy2-1.01.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70dfcc3373fb32044295b038ef38a3bad999e7035b55888b2c6070b62043d612
|
|
BLAKE2b-256 checksum How to use checksums |
5ac14da9e2e8688e5b2b835a0c4d8d5d71a9fb4bc58a890a30743ae836fff59a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for ineedpy2 1.01
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.