Skip to main content

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

Project details


Download files

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

Source Distribution

markerlib-0.6.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

markerlib-0.6.0-py27-none-any.whl (4.8 kB view details)

Uploaded Python 2.7

File details

Details for the file markerlib-0.6.0.tar.gz.

File metadata

  • Download URL: markerlib-0.6.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for markerlib-0.6.0.tar.gz
Algorithm Hash digest
SHA256 2fdb3939441f5bf4f090b1979a34f84a11d33eed6c0e3995de88ae5c06b6e3ae
MD5 dc56a59074005dee9ceee5349ba99a89
BLAKE2b-256 d1bace29589707d8679b648517d936a2f08e3e18143d49822339d3cc35819c92

See more details on using hashes here.

File details

Details for the file markerlib-0.6.0-py27-none-any.whl.

File metadata

File hashes

Hashes for markerlib-0.6.0-py27-none-any.whl
Algorithm Hash digest
SHA256 fd234e1dc3bb0929fa8c7c608c6a39151e637026ae817a91ee8c2c5e48e63754
MD5 169e4da7e0e5c538e0a863d18d285395
BLAKE2b-256 b95aec9ed58ef44d33e6cf50c9c6c8edba07623ca7ce57e9423caef9ff0e8851

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page