Skip to content

Commit

Permalink
Merge pull request #112 from adrianjhpc/python311
Browse files Browse the repository at this point in the history
Fixing porting to Python 3.11
  • Loading branch information
Athanaseus authored Apr 10, 2024
2 parents 8c2e2f9 + 9336dca commit 295047e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Pyxis/Internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ def interpolate (arg,frame,depth=1,ignore=set(),skip=set(),convert_lists=False):
# RE pattern matching the [PREFIX<][NAMESPACES.]NAME[?DEFAULT][:BASE|DIR|FILE|BASEPATH][>SUFFIX] syntax
_substpattern = \
"(?i)((?P<prefix>[^{}]+)<)?(?P<name>[._a-z][._a-z0-9]*)(\\?(?P<defval>[^}\\$]*?))?(:(?P<command>BASE|DIR|FILE|BASEPATH))?(>(?P<suffix>[^{}]+))?"

class SmartTemplate (string.Template):
pattern = "(?P<escaped>\\$\\$)|(\\$(?P<named>[_a-z][_a-z0-9]*))|(\\${(?P<braced>%s)})|(?P<invalid>\\$)"%_substpattern;
pattern = "(?P<escaped>\\$\\$)|(\\$(?P<named>[_a-z][_a-z0-9]*))|(\\${{(?P<braced>%s)}})|(?P<invalid>\\$)".format(_substpattern);

class DictProxy (object):
itempattern = re.compile(_substpattern+"$");
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ installation
$ python setup.py install
```

For newer Python installs (i.e. 3.10 and beyond) this invocation of `setup.py` is deprecated. You can use this instead (in the same directory that `setup.py` is located in):

```shell
$ python -m pip install .
```

If you want to install in a non-default location, you can specify that using a prefix, i.e.:

```shell
$ python -m pip install --prefix /install/somewhere/else .
```

Documentation
-------------

Expand All @@ -23,4 +35,4 @@ Development
-----------


[![Build Status](https://travis-ci.org/ska-sa/pyxis.svg?branch=master)](https://travis-ci.org/ska-sa/pyxis)
[![Build Status](https://travis-ci.org/ska-sa/pyxis.svg?branch=master)](https://travis-ci.org/ska-sa/pyxis)

0 comments on commit 295047e

Please sign in to comment.