skip to navigation
skip to content

Not Logged In

markerlib 0.4

A compiler for PEP 345 environment markers.

Latest Version: 0.6.0

markerlib

Compile or interpret PEP 345 environment markers.

Usage:

>>> import markerlib
>>> marker = markerlib.compile("os.name == 'posix'")
>>> marker(environment=markerlib.default_environment(),
           override={'os.name':'posix'})
True
>>> marker(environment=markerlib.default_environment(),
           override={'os.name':'nt'})
False

The implementation uses the ast to compile environment markers as Python statements with a limited set of allowed node types.

0.4

  • Cache compiled marker functions with weakref.WeakValueDictionary
  • Rename markerlib.as_function to markerlib.compile

0.3

  • Might work on Python 2.5 (includes needed parts of the ast module from Python 2.6+)
  • Include 100% test coverage, tox config file

0.1

  • Initial version
 
File Type Py Version Uploaded on Size
markerlib-0.4.tar.gz (md5) Source 2012-07-24 5KB
  • Downloads (All Versions):
  • 15 downloads in the last day
  • 258 downloads in the last week
  • 939 downloads in the last month