Merge branch 'master' into is_3622

This commit is contained in:
Bob Hyman 2020-09-01 18:27:18 -04:00
commit 92ee51a81e
8 changed files with 78 additions and 8 deletions

View file

@ -77,7 +77,16 @@
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: false,
fixedContentPos: false
fixedContentPos: false,
iframe: {
patterns: {
youtube_short: {
index: 'youtu.be/',
id: 'youtu.be/',
src: 'http://www.youtube.com/embed/%id%?autoplay=1'
}
}
}
});

24
news/docker-pytest.rst Normal file
View file

@ -0,0 +1,24 @@
**Added:**
* ``xonsh-in-docker.py`` script now has ``--pytest`` parameter,
that automates pytest installation into the Docker container.
**Changed:**
* <news item>
**Deprecated:**
* <news item>
**Removed:**
* <news item>
**Fixed:**
* <news item>
**Security:**
* <news item>

23
news/run-on-python39.rst Normal file
View file

@ -0,0 +1,23 @@
**Added:**
* Xonsh now runs in Python 3.9
**Changed:**
* <news item>
**Deprecated:**
* <news item>
**Removed:**
* <news item>
**Fixed:**
* <news item>
**Security:**
* <news item>

View file

@ -1,6 +1,6 @@
cloud_sptheme
numpydoc
Sphinx==2.4.4
Sphinx>=3.1
prompt_toolkit>=2.0
pygments>=2.2
psutil

View file

@ -15,6 +15,7 @@ parser.add_argument("--ptk", "-t", default="2.0.4", metavar="ptk_version")
parser.add_argument("--keep", action="store_true")
parser.add_argument("--build", action="store_true")
parser.add_argument("--command", "-c", default="xonsh", metavar="command")
parser.add_argument("--pytest", action="store_true")
args = parser.parse_args()
@ -22,13 +23,14 @@ docker_script = """
from python:{python_version}
RUN pip install --upgrade pip && pip install \\
prompt-toolkit=={ptk_version} \\
{pytest} \\
pygments
RUN mkdir /xonsh
WORKDIR /xonsh
ADD ./ ./
RUN python setup.py install
""".format(
python_version=args.python, ptk_version=args.ptk
python_version=args.python, ptk_version=args.ptk, pytest="pytest" if args.pytest else ""
)
if args.pypy:
@ -37,13 +39,14 @@ from pypy:{python_version}
RUN pypy3 -m ensurepip
RUN pip install --upgrade pip && pip install \\
prompt-toolkit=={ptk_version} \\
{pytest} \\
pygments
RUN mkdir /xonsh
WORKDIR /xonsh
ADD ./ ./
RUN pypy3 setup.py install
""".format(
python_version=args.pypy, ptk_version=args.ptk
python_version=args.pypy, ptk_version=args.ptk, pytest="pytest" if args.pytest else ""
)
print("Building and running Xonsh")

View file

@ -484,6 +484,9 @@ class Lexer(object):
@property
def tokens(self):
if self._tokens is None:
kwlist = kwmod.kwlist[:]
if PYTHON_VERSION_INFO >= (3, 9, 0) and PYTHON_VERSION_INFO < (3, 10):
kwlist.remove("__peg_parser__")
t = (
tuple(token_map.values())
+ (
@ -505,7 +508,7 @@ class Lexer(object):
"ATDOLLAR_LPAREN", # @$(
"ERRORTOKEN", # whoops!
)
+ tuple(i.upper() for i in kwmod.kwlist)
+ tuple(i.upper() for i in kwlist)
)
self._tokens = t
return self._tokens

View file

@ -2169,7 +2169,9 @@ class BaseParser(object):
return leader
p0 = leader
for trailer in trailers:
if isinstance(trailer, (ast.Index, ast.Slice, ast.ExtSlice)):
if isinstance(
trailer, (ast.Index, ast.Slice, ast.ExtSlice, ast.Constant, ast.Name)
):
p0 = ast.Subscript(
value=leader,
slice=trailer,

View file

@ -130,7 +130,10 @@ class Parser(BaseParser):
def p_argument_kwargs(self, p):
"""argument : POW test"""
p[0] = ast.keyword(arg=None, value=p[2])
p2 = p[2]
p[0] = ast.keyword(
arg=None, value=p2, lineno=p2.lineno, col_offset=p2.col_offset
)
def p_argument_args(self, p):
"""argument : TIMES test"""
@ -145,7 +148,10 @@ class Parser(BaseParser):
def p_argument_eq(self, p):
"""argument : test EQUALS test"""
p[0] = ast.keyword(arg=p[1].id, value=p[3])
p3 = p[3]
p[0] = ast.keyword(
arg=p[1].id, value=p3, lineno=p3.lineno, col_offset=p3.col_offset
)
def p_comp_for(self, p):
"""comp_for : FOR exprlist IN or_test comp_iter_opt"""