File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,13 @@ jobs:
5050
5151 - name : Upload to Codecov
5252 if : matrix.os == 'ubuntu-latest' && matrix.python-version == 3.11
53- uses : codecov/codecov-action@v4
53+ uses : codecov/codecov-action@v5
5454 with :
55- name : pytests-py3.11
56- flags : pytests
57- file : ./coverage.xml
5855 fail_ci_if_error : true
59- env :
60- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
56+ files : ./coverage.xml
57+ flags : pytests
58+ name : pytests-py3.11
59+ token : ${{ secrets.CODECOV_TOKEN }}
6160
6261 pre-commit-hook :
6362 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 11"""Main plugin module."""
22
3- import functools
43import pathlib
54import sys
65from typing import MutableMapping , Optional , Sequence , Union
1413else :
1514 import tomli as tomllib
1615
16+ if sys .version_info >= (3 , 9 ):
17+ from functools import cache
18+ else :
19+ from functools import lru_cache
20+
21+ cache = lru_cache ()
22+
1723
1824_ConfigOptions = MutableMapping [str , Union [int , str , Sequence [str ]]]
1925
2026
21- @functools . lru_cache ()
27+ @cache
2228def _find_pyproject_toml_path (search_path : str ) -> Optional [pathlib .Path ]:
2329 """Find the pyproject.toml file that corresponds to the search path.
2430
@@ -41,7 +47,7 @@ def _find_pyproject_toml_path(search_path: str) -> Optional[pathlib.Path]:
4147 return None
4248
4349
44- @functools . lru_cache ()
50+ @cache
4551def _parse_pyproject (pyproject_path : pathlib .Path ) -> Optional [_ConfigOptions ]:
4652 """Extract and validate the mdformat options from the pyproject.toml file.
4753
@@ -57,7 +63,7 @@ def _parse_pyproject(pyproject_path: pathlib.Path) -> Optional[_ConfigOptions]:
5763 return options
5864
5965
60- @functools . lru_cache ()
66+ @cache
6167def _reload_cli_opts () -> _ConfigOptions :
6268 """Re-parse the sys.argv array to deduce which arguments were used in the CLI.
6369
You can’t perform that action at this time.
0 commit comments