This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Convenience function for comparing Python system version

Installation

From the project root directory:

$ python setup.py install

Usage

Provides compare_python version so that you can check against the major, minor and micro version:

from versionutil import compare_python, PYTHON

# compare_python will return a boolean value against the current system version.
# PYTHON represents an instance of an object that is the current system version.

# It will check at the most significant value you signify. Default is equality check.
# True using 2.7.9:
PYTHON == '2'
PYTHON == '2.7'
PYTHON == '2.7.9'
compare_python('2')
compare_python('2.7')
compare_python('2.7.9')

# True using 3.4.4:
PYTHON == '3'
PYTHON == '3.4'
PYTHON == '3.4.4'
compare_python('3')
compare_python('3.4')
compare_python('3.4.4')

# False in 3.4.4:
PYTHON != '3.5'
PYTHON != '3.4.5'
compare_python('3.5')
compare_python('3.4.5')

# Works with ints and even floats:
PYTHON == 2.7
compare_python(2.7)

# Different comparisons exist, default comp='=='
PYTHON != 3
PYTHON < 3
PYTHON < 3.0
PYTHON > 2.6
PYTHON >= 2.7
PYTHON < 3.1
compare_python(3, '!=')
compare_python(3, '<')
compare_python(3.0, '<')
compare_python(2.6, '>')
compare_python(2.7, '>=')
compare_python(3.1, comp='<')

# To test against a custom system version (ignore sys.version_info):
compare_python(5.4, sysv=(5, 4, 5))
# or to create a PYTHON like object for 5.4.5:
from versionutil import PythonVersion
pv545 = PythonVersion(sysv=(5, 4, 5))
if pv545 == 5.4: # True...

# Useful for handling imports, where otherwise pyfuture and pasteurize might not have what you need.
if PYTHON < 3:
    from oldapi import OldAPI as API
elif PYTHON == 3.0 or PYTHON == 3.1:
    from newapi import OtherAPI as API
elif PYTHON >= 3.2:
    from newapi import NewAPI as API

Release Notes

0.1.2:Check is_instance(str) for 3.4 and basestring for <
0.1.1:Added PYTHON global and PythonVersion class for easier usage (PYTHON < 2.7)
0.1.0:Alpha finished, tested fully with tox
0.0.1:Project created
Release History

Release History

0.1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
versionutil-0.1.2.tar.gz (5.7 kB) Copy SHA256 Checksum SHA256 Source May 25, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting