Compare commits

..

No commits in common. "98887d246a711f612de77e197d7a7508e31625e3" and "89afdb37d74c64569e60c11ac2a9fdbb8a1fc0ff" have entirely different histories.

7 changed files with 21 additions and 36 deletions

View file

@ -6,14 +6,14 @@ on:
- pull_request - pull_request
env: env:
DEFAULT_PYTHON: '3.12' DEFAULT_PYTHON: '3.11'
jobs: jobs:
tests: tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4

View file

@ -20,7 +20,7 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: '3.12' python-version: '3.11'
- name: Build - name: Build
run: | run: |

9
Jenkinsfile vendored
View file

@ -1,10 +1,9 @@
def pys = [ def pys = [
[name: 'Python 3.12', docker: '3.12-bookworm', tox:'py312,flake8', main: true], [name: 'Python 3.11', docker: '3.11-bookworm', tox:'py311,flake8', main: true],
[name: 'Python 3.11', docker: '3.11-bookworm', tox:'py311', main: false],
[name: 'Python 3.10', docker: '3.10-bookworm', tox:'py310', main: false], [name: 'Python 3.10', docker: '3.10-bookworm', tox:'py310', main: false],
[name: 'Python 3.9', docker: '3.9-bookworm', tox:'py39', main: false], [name: 'Python 3.9', docker: '3.9-bookworm', tox:'py39', main: false],
[name: 'Python 3.8', docker: '3.8-bookworm', tox:'py38', main: false], [name: 'Python 3.8', docker: '3.8-bookworm', tox:'py38', main: false],
[name: 'Python 3.7', docker: '3.7-bookworm', tox:'py37', main: false], [name: 'Python 3.7', docker: '3.7-bookworm', tox:'py37', main: false],
] ]
properties([ properties([

View file

@ -2,15 +2,9 @@
# SPDX-FileCopyrightText: © 2004 Tristan Seligmann and Jonathan Jacobs # SPDX-FileCopyrightText: © 2004 Tristan Seligmann and Jonathan Jacobs
# SPDX-FileCopyrightText: © 2012 Bastian Kleineidam # SPDX-FileCopyrightText: © 2012 Bastian Kleineidam
# SPDX-FileCopyrightText: © 2015 Tobias Gruetzmacher # SPDX-FileCopyrightText: © 2015 Tobias Gruetzmacher
# PYTHON_ARGCOMPLETE_OK
from __future__ import annotations
import argparse import argparse
import contextlib
import importlib
import os import os
import platform import platform
from collections.abc import Iterable
from platformdirs import PlatformDirs from platformdirs import PlatformDirs
@ -24,7 +18,7 @@ from .util import internal_error, strlimit
class ArgumentParser(argparse.ArgumentParser): class ArgumentParser(argparse.ArgumentParser):
"""Custom argument parser.""" """Custom argument parser."""
def print_help(self, file=None) -> None: def print_help(self, file=None):
"""Paginate help message on TTYs.""" """Paginate help message on TTYs."""
with out.pager(): with out.pager():
out.info(self.format_help()) out.info(self.format_help())
@ -52,7 +46,7 @@ User plugin directory: {user_plugin_path}
""" """
def setup_options() -> ArgumentParser: def setup_options():
"""Construct option parser. """Construct option parser.
@return: new option parser @return: new option parser
@rtype argparse.ArgumentParser @rtype argparse.ArgumentParser
@ -71,8 +65,8 @@ def setup_options() -> ArgumentParser:
help='traverse and retrieve all comic strips') help='traverse and retrieve all comic strips')
parser.add_argument('-c', '--continue', action='store_true', dest='cont', parser.add_argument('-c', '--continue', action='store_true', dest='cont',
help='traverse and retrieve comic strips until an existing one is found') help='traverse and retrieve comic strips until an existing one is found')
basepath_opt = parser.add_argument('-b', '--basepath', action='store', parser.add_argument('-b', '--basepath', action='store', default='Comics',
default='Comics', metavar='PATH', metavar='PATH',
help='set the path to create invidivual comic directories in, default is Comics') help='set the path to create invidivual comic directories in, default is Comics')
parser.add_argument('--baseurl', action='store', metavar='PATH', parser.add_argument('--baseurl', action='store', metavar='PATH',
help='the base URL of your comics directory (for RSS, HTML, etc.);' help='the base URL of your comics directory (for RSS, HTML, etc.);'
@ -109,22 +103,16 @@ def setup_options() -> ArgumentParser:
# are not "real" (moved & removed) # are not "real" (moved & removed)
parser.add_argument('--list-all', action='store_true', parser.add_argument('--list-all', action='store_true',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
comic_arg = parser.add_argument('comic', nargs='*', parser.add_argument('comic', nargs='*',
help='comic module name (including case insensitive substrings)') help='comic module name (including case insensitive substrings)')
comic_arg.completer = scraper_completion try:
with contextlib.suppress(ImportError): import argcomplete
completers = importlib.import_module('argcomplete.completers') argcomplete.autocomplete(parser)
basepath_opt.completer = completers.DirectoriesCompleter() except ImportError:
importlib.import_module('argcomplete').autocomplete(parser) pass
return parser return parser
def scraper_completion(**kwargs) -> Iterable[str]:
"""Completion helper for argcomplete."""
scrapercache.adddir(user_plugin_path)
return (comic.name for comic in scrapercache.all())
def display_version(verbose): def display_version(verbose):
"""Display application name, version, copyright and license.""" """Display application name, version, copyright and license."""
print(configuration.App) print(configuration.App)

View file

@ -1,5 +1,5 @@
[build-system] [build-system]
requires = ["setuptools>=66.0", "setuptools_scm>=7.1"] requires = ["setuptools>=61.2", "setuptools_scm>=6.2"]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
[project] [project]
@ -22,7 +22,6 @@ classifiers = [
"Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP",
"Topic :: Multimedia :: Graphics", "Topic :: Multimedia :: Graphics",
] ]

View file

@ -9,7 +9,7 @@ node {
stage ('Run tests') { stage ('Run tests') {
timeout(time: 12, unit: 'HOURS') { timeout(time: 12, unit: 'HOURS') {
withCredentials([string(credentialsId: 'proxymap', variable: 'PROXYMAP')]) { withCredentials([string(credentialsId: 'proxymap', variable: 'PROXYMAP')]) {
sh 'podman run --rm -v $PWD:/work --userns=keep-id docker.io/python:3.12-bookworm /work/tests/modules/testall.sh' sh 'podman run --rm -v $PWD:/work --userns=keep-id docker.io/python:3.11-bookworm /work/tests/modules/testall.sh'
} }
} }
} }

View file

@ -1,5 +1,5 @@
[tox] [tox]
envlist = py37, py38, py39, py310, py311, py312, flake8 envlist = py37, py38, py39, py310, py311, flake8
isolated_build = True isolated_build = True
[gh-actions] [gh-actions]
@ -8,8 +8,7 @@ python =
3.8: py38 3.8: py38
3.9: py39 3.9: py39
3.10: py310 3.10: py310
3.11: py311 3.11: py311, flake8
3.12: py312, flake8
[testenv] [testenv]
commands = commands =