Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use stable 3.12 for CI jobs #5307

Merged
merged 8 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
UV_CACHE_DIR: .cache/uv
DEFAULT_PYTHON_VERSION: 3.12
strategy:
fail-fast: false
matrix:
Expand All @@ -34,10 +35,10 @@ jobs:
- macOS-latest
- windows-latest
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12-dev"
- "3.12"
# - "3.13-dev"
name: Test Python ${{ matrix.python-version }} ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -63,20 +64,20 @@ jobs:
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tmate_debug_enabled }}
timeout-minutes: 15
- 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
- name: Run tests
if: ${{ !startsWith(matrix.python-version, '3.11') }}
if: ${{ !startsWith(matrix.python-version, env.DEFAULT_PYTHON_VERSION) }}
run: |
python -m pip install . --no-deps
python -m xonsh run-tests.xsh test -- --timeout=240
- name: Run tests with coverage
if: ${{ startsWith(matrix.python-version, '3.11') }}
if: ${{ startsWith(matrix.python-version, env.DEFAULT_PYTHON_VERSION) }}
run: |
python -m pip install -e . --no-deps
python -m xonsh run-tests.xsh test --report-coverage -- --timeout=240
- 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
with:
verbose: true
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,6 @@ __pypackages__

# one can use pip or pdm during development
pdm.lock

# asv benchmarks
.asv/
2 changes: 1 addition & 1 deletion tests/completers/test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def wow(self):
("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):
result = complete_import(completer_obj.parse(command))
if isinstance(result, tuple):
Expand Down
2 changes: 1 addition & 1 deletion tests/procs/test_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_cmds_to_specs_capture_stdout_not_stderr(thread_subprocs, xonsh_session)
@pytest.mark.parametrize(
"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(
capfd, thread_subprocs, capture_always, alias_type, pipe, monkeypatch, xonsh_session
):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def _callme(args):

@skip_if_no_xonsh
@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):
script, exp_out, exp_rtn = case
out, err, rtn = run_xonsh(script)
Expand Down
2 changes: 0 additions & 2 deletions xonsh/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,6 @@ def xonsh_call(name, args, lineno=None, col=None):
func=load_attribute_chain(name, lineno=lineno, col=col),
args=args,
keywords=[],
starargs=None,
kwargs=None,
lineno=lineno,
col_offset=col,
)
Expand Down
14 changes: 1 addition & 13 deletions xonsh/parsers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ def call_split_lines(x, lineno=None, col=None):
),
args=[],
keywords=[],
starargs=None,
kwargs=None,
lineno=lineno,
col_offset=col,
)
Expand All @@ -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)],
keywords=[],
starargs=None,
kwargs=None,
lineno=lineno,
col_offset=col,
),
Expand Down Expand Up @@ -820,8 +816,6 @@ def p_decorator_call(self, p):
func=name,
args=[],
keywords=[],
starargs=None,
kwargs=None,
lineno=lineno,
col_offset=col,
)
Expand Down Expand Up @@ -2688,7 +2682,7 @@ def p_testlist_comp_many(self, p):

def p_trailer_lparen(self, p):
"""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):
"""
Expand Down Expand Up @@ -3027,8 +3021,6 @@ def p_classdef(self, p):
name=p[2],
bases=b,
keywords=kw,
starargs=None,
kwargs=None,
body=p[5],
decorator_list=[],
lineno=p1.lineno,
Expand Down Expand Up @@ -3171,8 +3163,6 @@ def _envvar_getter_by_name(self, var, lineno=None, col=None):
ast.const_str(s="", lineno=lineno, col_offset=col),
],
keywords=[],
starargs=None,
kwargs=None,
lineno=lineno,
col_offset=col,
)
Expand Down Expand Up @@ -3377,8 +3367,6 @@ def p_subproc_atom_pyenv_lookup(self, p):
func=func,
args=[p[2], ast.const_str(s="", lineno=lineno, col_offset=col)],
keywords=[],
starargs=None,
kwargs=None,
lineno=lineno,
col_offset=col,
)
Expand Down
19 changes: 4 additions & 15 deletions xonsh/pretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,6 @@ def _re_pattern_pprint(obj, p, cycle):
p.breakable()
done_one = False
for flag in (
"TEMPLATE",
"IGNORECASE",
"LOCALE",
"MULTILINE",
Expand Down Expand Up @@ -769,33 +768,23 @@ def _type_pprinters():
set: _set_pprinter_factory("{", "}", set),
frozenset: _set_pprinter_factory("frozenset({", "})", frozenset),
super: _super_pprint,
type(re.compile("")): _re_pattern_pprint,
re.Pattern: _re_pattern_pprint,
type: _type_pprint,
types.FunctionType: _function_pprint,
types.BuiltinFunctionType: _function_pprint,
types.MethodType: _repr_pprint,
datetime.datetime: _repr_pprint,
datetime.timedelta: _repr_pprint,
slice: _repr_pprint,
range: _repr_pprint,
bytes: _repr_pprint,
}
#: the exception base
try:
_exception_base = BaseException
except NameError:
_exception_base = Exception
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


Expand Down