mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
chore: use stable 3.12 for CI jobs (#5307)
This commit is contained in:
parent
614ddebc59
commit
51a14c989d
8 changed files with 18 additions and 39 deletions
13
.github/workflows/test.yml
vendored
13
.github/workflows/test.yml
vendored
|
@ -26,6 +26,7 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
UV_CACHE_DIR: .cache/uv
|
UV_CACHE_DIR: .cache/uv
|
||||||
|
DEFAULT_PYTHON_VERSION: 3.12
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -34,10 +35,10 @@ jobs:
|
||||||
- macOS-latest
|
- macOS-latest
|
||||||
- windows-latest
|
- windows-latest
|
||||||
python-version:
|
python-version:
|
||||||
- "3.9"
|
|
||||||
- "3.10"
|
- "3.10"
|
||||||
- "3.11"
|
- "3.11"
|
||||||
- "3.12-dev"
|
- "3.12"
|
||||||
|
# - "3.13-dev"
|
||||||
name: Test Python ${{ matrix.python-version }} ${{ matrix.os }}
|
name: Test Python ${{ matrix.python-version }} ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -63,20 +64,20 @@ jobs:
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tmate_debug_enabled }}
|
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tmate_debug_enabled }}
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
- name: Run QA Checks
|
- name: Run QA Checks
|
||||||
if: ${{ startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python-version, '3.11') }}
|
if: ${{ startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python-version, env.DEFAULT_PYTHON_VERSION) }}
|
||||||
run: python -m xonsh run-tests.xsh validate-news-items
|
run: python -m xonsh run-tests.xsh validate-news-items
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
if: ${{ !startsWith(matrix.python-version, '3.11') }}
|
if: ${{ !startsWith(matrix.python-version, env.DEFAULT_PYTHON_VERSION) }}
|
||||||
run: |
|
run: |
|
||||||
python -m pip install . --no-deps
|
python -m pip install . --no-deps
|
||||||
python -m xonsh run-tests.xsh test -- --timeout=240
|
python -m xonsh run-tests.xsh test -- --timeout=240
|
||||||
- name: Run tests with coverage
|
- name: Run tests with coverage
|
||||||
if: ${{ startsWith(matrix.python-version, '3.11') }}
|
if: ${{ startsWith(matrix.python-version, env.DEFAULT_PYTHON_VERSION) }}
|
||||||
run: |
|
run: |
|
||||||
python -m pip install -e . --no-deps
|
python -m pip install -e . --no-deps
|
||||||
python -m xonsh run-tests.xsh test --report-coverage -- --timeout=240
|
python -m xonsh run-tests.xsh test --report-coverage -- --timeout=240
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
if: ${{ startsWith(matrix.python-version, '3.11') }}
|
if: ${{ startsWith(matrix.python-version, env.DEFAULT_PYTHON_VERSION) }}
|
||||||
uses: codecov/codecov-action@v4
|
uses: codecov/codecov-action@v4
|
||||||
with:
|
with:
|
||||||
verbose: true
|
verbose: true
|
||||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -97,3 +97,6 @@ __pypackages__
|
||||||
|
|
||||||
# one can use pip or pdm during development
|
# one can use pip or pdm during development
|
||||||
pdm.lock
|
pdm.lock
|
||||||
|
|
||||||
|
# asv benchmarks
|
||||||
|
.asv/
|
||||||
|
|
|
@ -104,7 +104,7 @@ def test_complete_python_ctx():
|
||||||
("from pathlib import PosixPath PurePa", {"PurePath"}),
|
("from pathlib import PosixPath PurePa", {"PurePath"}),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@pytest.mark.flaky(reruns=5, reruns_delay=2)
|
@pytest.mark.flaky(reruns=2, reruns_delay=2)
|
||||||
def test_complete_import(command, exp, completer_obj):
|
def test_complete_import(command, exp, completer_obj):
|
||||||
result = complete_import(completer_obj.parse(command))
|
result = complete_import(completer_obj.parse(command))
|
||||||
if isinstance(result, tuple):
|
if isinstance(result, tuple):
|
||||||
|
|
|
@ -72,7 +72,7 @@ def test_cmds_to_specs_capture_stdout_not_stderr(thread_subprocs, xonsh_session)
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"thread_subprocs, capture_always", list(itertools.product((True, False), repeat=2))
|
"thread_subprocs, capture_always", list(itertools.product((True, False), repeat=2))
|
||||||
)
|
)
|
||||||
@pytest.mark.flaky(reruns=5, reruns_delay=2)
|
@pytest.mark.flaky(reruns=3, reruns_delay=2)
|
||||||
def test_capture_always(
|
def test_capture_always(
|
||||||
capfd, thread_subprocs, capture_always, alias_type, pipe, monkeypatch, xonsh_session
|
capfd, thread_subprocs, capture_always, alias_type, pipe, monkeypatch, xonsh_session
|
||||||
):
|
):
|
||||||
|
|
|
@ -659,7 +659,7 @@ if not ON_WINDOWS:
|
||||||
|
|
||||||
@skip_if_no_xonsh
|
@skip_if_no_xonsh
|
||||||
@pytest.mark.parametrize("case", ALL_PLATFORMS)
|
@pytest.mark.parametrize("case", ALL_PLATFORMS)
|
||||||
@pytest.mark.flaky(reruns=5, reruns_delay=2)
|
@pytest.mark.flaky(reruns=3, reruns_delay=2)
|
||||||
def test_script(case):
|
def test_script(case):
|
||||||
script, exp_out, exp_rtn = case
|
script, exp_out, exp_rtn = case
|
||||||
out, err, rtn = run_xonsh(script)
|
out, err, rtn = run_xonsh(script)
|
||||||
|
|
|
@ -312,8 +312,6 @@ def xonsh_call(name, args, lineno=None, col=None):
|
||||||
func=load_attribute_chain(name, lineno=lineno, col=col),
|
func=load_attribute_chain(name, lineno=lineno, col=col),
|
||||||
args=args,
|
args=args,
|
||||||
keywords=[],
|
keywords=[],
|
||||||
starargs=None,
|
|
||||||
kwargs=None,
|
|
||||||
lineno=lineno,
|
lineno=lineno,
|
||||||
col_offset=col,
|
col_offset=col,
|
||||||
)
|
)
|
||||||
|
|
|
@ -83,8 +83,6 @@ def call_split_lines(x, lineno=None, col=None):
|
||||||
),
|
),
|
||||||
args=[],
|
args=[],
|
||||||
keywords=[],
|
keywords=[],
|
||||||
starargs=None,
|
|
||||||
kwargs=None,
|
|
||||||
lineno=lineno,
|
lineno=lineno,
|
||||||
col_offset=col,
|
col_offset=col,
|
||||||
)
|
)
|
||||||
|
@ -104,8 +102,6 @@ def ensure_list_from_str_or_list(x, lineno=None, col=None):
|
||||||
),
|
),
|
||||||
args=[x, ast.Name(id="str", ctx=ast.Load(), lineno=lineno, col_offset=col)],
|
args=[x, ast.Name(id="str", ctx=ast.Load(), lineno=lineno, col_offset=col)],
|
||||||
keywords=[],
|
keywords=[],
|
||||||
starargs=None,
|
|
||||||
kwargs=None,
|
|
||||||
lineno=lineno,
|
lineno=lineno,
|
||||||
col_offset=col,
|
col_offset=col,
|
||||||
),
|
),
|
||||||
|
@ -820,8 +816,6 @@ class BaseParser:
|
||||||
func=name,
|
func=name,
|
||||||
args=[],
|
args=[],
|
||||||
keywords=[],
|
keywords=[],
|
||||||
starargs=None,
|
|
||||||
kwargs=None,
|
|
||||||
lineno=lineno,
|
lineno=lineno,
|
||||||
col_offset=col,
|
col_offset=col,
|
||||||
)
|
)
|
||||||
|
@ -2688,7 +2682,7 @@ class BaseParser:
|
||||||
|
|
||||||
def p_trailer_lparen(self, p):
|
def p_trailer_lparen(self, p):
|
||||||
"""trailer : LPAREN arglist_opt RPAREN"""
|
"""trailer : LPAREN arglist_opt RPAREN"""
|
||||||
p[0] = [p[2] or dict(args=[], keywords=[], starargs=None, kwargs=None)]
|
p[0] = [p[2] or dict(args=[], keywords=[])]
|
||||||
|
|
||||||
def p_trailer_bang_lparen(self, p):
|
def p_trailer_bang_lparen(self, p):
|
||||||
"""
|
"""
|
||||||
|
@ -3027,8 +3021,6 @@ class BaseParser:
|
||||||
name=p[2],
|
name=p[2],
|
||||||
bases=b,
|
bases=b,
|
||||||
keywords=kw,
|
keywords=kw,
|
||||||
starargs=None,
|
|
||||||
kwargs=None,
|
|
||||||
body=p[5],
|
body=p[5],
|
||||||
decorator_list=[],
|
decorator_list=[],
|
||||||
lineno=p1.lineno,
|
lineno=p1.lineno,
|
||||||
|
@ -3171,8 +3163,6 @@ class BaseParser:
|
||||||
ast.const_str(s="", lineno=lineno, col_offset=col),
|
ast.const_str(s="", lineno=lineno, col_offset=col),
|
||||||
],
|
],
|
||||||
keywords=[],
|
keywords=[],
|
||||||
starargs=None,
|
|
||||||
kwargs=None,
|
|
||||||
lineno=lineno,
|
lineno=lineno,
|
||||||
col_offset=col,
|
col_offset=col,
|
||||||
)
|
)
|
||||||
|
@ -3377,8 +3367,6 @@ class BaseParser:
|
||||||
func=func,
|
func=func,
|
||||||
args=[p[2], ast.const_str(s="", lineno=lineno, col_offset=col)],
|
args=[p[2], ast.const_str(s="", lineno=lineno, col_offset=col)],
|
||||||
keywords=[],
|
keywords=[],
|
||||||
starargs=None,
|
|
||||||
kwargs=None,
|
|
||||||
lineno=lineno,
|
lineno=lineno,
|
||||||
col_offset=col,
|
col_offset=col,
|
||||||
)
|
)
|
||||||
|
|
|
@ -677,7 +677,6 @@ def _re_pattern_pprint(obj, p, cycle):
|
||||||
p.breakable()
|
p.breakable()
|
||||||
done_one = False
|
done_one = False
|
||||||
for flag in (
|
for flag in (
|
||||||
"TEMPLATE",
|
|
||||||
"IGNORECASE",
|
"IGNORECASE",
|
||||||
"LOCALE",
|
"LOCALE",
|
||||||
"MULTILINE",
|
"MULTILINE",
|
||||||
|
@ -769,13 +768,16 @@ def _type_pprinters():
|
||||||
set: _set_pprinter_factory("{", "}", set),
|
set: _set_pprinter_factory("{", "}", set),
|
||||||
frozenset: _set_pprinter_factory("frozenset({", "})", frozenset),
|
frozenset: _set_pprinter_factory("frozenset({", "})", frozenset),
|
||||||
super: _super_pprint,
|
super: _super_pprint,
|
||||||
type(re.compile("")): _re_pattern_pprint,
|
re.Pattern: _re_pattern_pprint,
|
||||||
type: _type_pprint,
|
type: _type_pprint,
|
||||||
types.FunctionType: _function_pprint,
|
types.FunctionType: _function_pprint,
|
||||||
types.BuiltinFunctionType: _function_pprint,
|
types.BuiltinFunctionType: _function_pprint,
|
||||||
types.MethodType: _repr_pprint,
|
types.MethodType: _repr_pprint,
|
||||||
datetime.datetime: _repr_pprint,
|
datetime.datetime: _repr_pprint,
|
||||||
datetime.timedelta: _repr_pprint,
|
datetime.timedelta: _repr_pprint,
|
||||||
|
slice: _repr_pprint,
|
||||||
|
range: _repr_pprint,
|
||||||
|
bytes: _repr_pprint,
|
||||||
}
|
}
|
||||||
#: the exception base
|
#: the exception base
|
||||||
try:
|
try:
|
||||||
|
@ -783,19 +785,6 @@ def _type_pprinters():
|
||||||
except NameError:
|
except NameError:
|
||||||
_exception_base = Exception
|
_exception_base = Exception
|
||||||
tp[_exception_base] = _exception_pprint
|
tp[_exception_base] = _exception_pprint
|
||||||
try:
|
|
||||||
tp[types.DictProxyType] = _dict_pprinter_factory("<dictproxy {", "}>")
|
|
||||||
tp[types.ClassType] = _type_pprint
|
|
||||||
tp[types.SliceType] = _repr_pprint
|
|
||||||
except AttributeError: # Python 3
|
|
||||||
tp[slice] = _repr_pprint
|
|
||||||
try:
|
|
||||||
tp[xrange] = _repr_pprint
|
|
||||||
tp[long] = _repr_pprint
|
|
||||||
tp[unicode] = _repr_pprint
|
|
||||||
except NameError:
|
|
||||||
tp[range] = _repr_pprint
|
|
||||||
tp[bytes] = _repr_pprint
|
|
||||||
return tp
|
return tp
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue