From 7a833e7124196ca0bbc9dc31d78b82e14f19e4f6 Mon Sep 17 00:00:00 2001 From: Vladyslav Krylasov Date: Mon, 3 May 2021 15:27:17 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20modern=20Python=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Python 3.5 has reached end-of-life, so this commit drops its support and makes the lib more feasible for modern Python versions. --- .github/workflows/main.yml | 2 +- plerr/cli.py | 8 +++----- setup.py | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6dfa067..b6c5e9c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/plerr/cli.py b/plerr/cli.py index 28af894..18d2d7d 100644 --- a/plerr/cli.py +++ b/plerr/cli.py @@ -29,21 +29,19 @@ def main(): '-v', '--version', action='version', - version='plerr v{}'.format(__version__) + version=f'plerr v{__version__}' ) args = parser.parse_args() root = pathlib.Path(__file__).resolve().parent try: - error = next(root.rglob('*{}.md'.format(args.code.upper()))) + error = next(root.rglob(f'*{args.code.upper()}.md')) content = error.read_bytes() print(highlight(content, MarkdownLexer(), TerminalFormatter())) sys.exit(0) except StopIteration: print( - 'Cannot find {} pylint error by such error code.'.format( - args.code - ), + f'Cannot find {args.code} pylint error by such error code.', file=sys.stderr ) sys.exit(1) diff --git a/setup.py b/setup.py index b952659..2c320cb 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ packages=setuptools.find_packages(), install_requires=['Pygments==2.8.1'], test_suite='plerr.tests.test_package', - python_requires='>=3.5', + python_requires='>=3.6', include_package_data=True, keywords=['pylint', 'errors', 'documentation'], entry_points={'console_scripts': ['plerr=plerr.cli:main']}, @@ -39,10 +39,10 @@ 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: Implementation :: CPython', 'Topic :: Software Development :: Documentation', 'Topic :: Software Development :: Libraries :: Python Modules',