Skip to main content

Work with environment markers (PEP-496)

Project description

travis appveyor MIT License

Work with environment markers (PEP-496).

Installation

Install from PyPI:

python3 -m pip install --user dephell_markers

Usage

from dephell_markers import Markers

m = Markers('os_name == "posix" and python_version >= "2.7"')

m.get_version(name='python_version')
# '>=2.7'

m.get_string(name='os_name')
# 'posix'

Markers('python_version >= "2.4" or python_version <= "2.7"').get_version(name='python_version')
'<=2.7 || >=2.4'

Markers('python_version >= "2.4" or python_version <= "2.7"').python_version
# RangeSpecifier(<=2.7 || >=2.4)


# Nothing better than lie:
Markers('python_version == "2.4" or os_name == "linux"').get_version(name='python_version')
# None

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

dephell_markers-0.2.5.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

dephell_markers-0.2.5-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file dephell_markers-0.2.5.tar.gz.

File metadata

  • Download URL: dephell_markers-0.2.5.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for dephell_markers-0.2.5.tar.gz
Algorithm Hash digest
SHA256 5de294d542d4f30757f4f3b3f2368343a67144fdeefb6654ce4bdb4d9ec93157
MD5 ca51b5e75b1daa34fbd33d72d2c2911c
BLAKE2b-256 91295c788ce9c0edea8e6132598ac70ec508c4f3649f36b55ab8d1794073e037

See more details on using hashes here.

File details

Details for the file dephell_markers-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: dephell_markers-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.0

File hashes

Hashes for dephell_markers-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a29a9962d34ce27806e77e74f79b39d0e49bea6722c63a9ccbf5f65fe0084814
MD5 b03678d49af58d2d868cf5472089c47d
BLAKE2b-256 4f96e45bb277704d9331a1eb968ff65a3541795f86817d26a502cf94474d638e

See more details on using hashes here.

Supported by

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