wickman / pystachio

type-checked dictionary templating library for python
MIT License
91 stars 22 forks source link

Extend Ref to allow some special characters #26

Closed shanmugh closed 8 years ago

shanmugh commented 8 years ago

Today Ref object only allows alphanumeric values and starting with alphabets for DEREF and alphanumeric values and '-' for INDEX, which is too restrictive.

_DEREF_RE = r'[^\d\W]\w*' _INDEX_RE = r'[\w-]+' _REF_RE = re.compile(r'(.' + _DEREF_RE + r'|[' + _INDEX_RE + r'])')

We are looking to use Pystachio's binding to create a Docker binding helper that would resolve 'name:tag' combinations to 'name@digest' to create a concrete identifier. Where the 'name' can contain '/' and 'tag' can contain '.'.

We would like to extend the allowed characters for DEREF and INDEX to accommodate Docker image name and tag values. See https://github.com/docker/distribution/blob/master/reference/reference.go for full definition of docker image references.

shanmugh commented 8 years ago

https://github.com/wickman/pystachio/pull/27

jsirois commented 8 years ago

I'll leave this open until I cut a pypi release here ~presently.

jsirois commented 8 years ago

Released here: https://pypi.python.org/pypi/pystachio/0.8.3

Thanks @shanmugh!