diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 608717d6..d2919a9f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,18 +10,15 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: [3.6, 3.7, 3.8] - include: - - os: ubuntu-20.04 - python-version: 3.6 - exclude: - - os: ubuntu-latest - python-version: 3.6 + python-version: + - '3.8' + - '3.10' + - '3.12' runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 diff --git a/onlinejudge_command/subcommand/generate_input.py b/onlinejudge_command/subcommand/generate_input.py index 2aa47496..cbeea835 100644 --- a/onlinejudge_command/subcommand/generate_input.py +++ b/onlinejudge_command/subcommand/generate_input.py @@ -71,7 +71,7 @@ def submit(f, *args, **kwargs): def write_result(input_data: bytes, output_data: Optional[bytes], *, input_path: pathlib.Path, output_path: pathlib.Path, print_data: bool, lock: Optional[threading.Lock] = None) -> None: # acquire lock to print logs properly, if in parallel - nullcontext = contextlib.ExitStack() # TODO: use contextlib.nullcontext after Python 3.7 + nullcontext = contextlib.nullcontext() with lock or nullcontext: if not input_path.parent.is_dir(): @@ -125,7 +125,7 @@ def check_randomness_of_generator(input_data: bytes, *, name: str, lock: Optiona return None input_digest = hashlib.sha1(input_data).digest() - nullcontext = contextlib.ExitStack() # TODO: use contextlib.nullcontext after Python 3.7 + nullcontext = contextlib.nullcontext() with lock or nullcontext: if len(generated_input_hashes) < limit: if input_digest in generated_input_hashes: diff --git a/onlinejudge_command/subcommand/test.py b/onlinejudge_command/subcommand/test.py index 4945a7a7..e4587012 100644 --- a/onlinejudge_command/subcommand/test.py +++ b/onlinejudge_command/subcommand/test.py @@ -255,8 +255,8 @@ def test_single_case(test_name: str, test_input_path: pathlib.Path, test_output_ elapsed: float = info['elapsed'] memory: Optional[float] = info['memory'] - # lock is require to avoid mixing logs if in parallel - nullcontext = contextlib.ExitStack() # TODO: use contextlib.nullcontext() after updating Python to 3.7 + # lock is required to avoid mixing logs if in parallel + nullcontext = contextlib.nullcontext() with lock or nullcontext: if lock is not None: logger.info('') diff --git a/onlinejudge_command/utils.py b/onlinejudge_command/utils.py index 4f404011..24c420d6 100644 --- a/onlinejudge_command/utils.py +++ b/onlinejudge_command/utils.py @@ -190,10 +190,7 @@ def webbrowser_register_explorer_exe() -> None: if not is_windows_subsystem_for_linux(): return instance = webbrowser.GenericBrowser('explorer.exe') - if sys.version_info < (3, 7): - webbrowser.register('explorer', None, instance) # TODO: remove this after Python 3.6 supprot is finished - else: - webbrowser.register('explorer', None, instance, preferred=True) # `preferred=True` solves the issue that terminal logs are cleared on cmd.exe with stopping using wslview via www-browser. TODO: remove `preferred=True` after https://github.com/wslutilities/wslu/issues/199 is fixed. + webbrowser.register('explorer', None, instance, preferred=True) # `preferred=True` solves the issue that terminal logs are cleared on cmd.exe with stopping using wslview via www-browser. TODO: remove `preferred=True` after https://github.com/wslutilities/wslu/issues/199 is fixed. def get_default_command() -> str: diff --git a/setup.cfg b/setup.cfg index bcc72cea..2c6a3e84 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,8 +7,9 @@ classifiers = Intended Audience :: Developers License :: OSI Approved :: MIT License Operating System :: OS Independent - Programming Language :: Python :: 3.5 - Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.12 Topic :: Internet :: WWW/HTTP Topic :: Software Development Topic :: Text Processing :: Markup :: HTML diff --git a/setup.py b/setup.py index 37665f5d..e36d7049 100755 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ url=version.__url__, license=version.__license__, description=version.__description__, - python_requires='>=3.6', + python_requires='>=3.8', install_requires=[ 'online-judge-api-client >= 10.9.0, < 11', 'colorama >= 0.3, < 1',