Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A compiler for PEP 345 environment markers.

Project Description

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.6.0

  • Allow _ where . was previously used (‘os.name’ -> ‘os_name’)

0.5.2

  • Restore ‘as_function’ bw/compat synonym for ‘compile’

0.5.1

  • Include ‘empty marker’ heuristic in markerlib itself

0.5

  • One final release until it’s just a part of distribute

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
Release History

Release History

This version
History Node

0.6.0

History Node

0.5.2

History Node

0.5.1

History Node

0.5

History Node

0.4

History Node

0.3

History Node

0.2

History Node

0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
markerlib-0.6.0-py27-none-any.whl (4.8 kB) Copy SHA256 Checksum SHA256 2.7 Wheel May 7, 2013
markerlib-0.6.0.tar.gz (3.8 kB) Copy SHA256 Checksum SHA256 Source May 7, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS 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