Skip to content

Commit 3dc9edb

Browse files
authored
Merge pull request #34 from mbdevpl/feature/pylint-4
update pylint, remove Python 3.9, add Python 3.14
2 parents ea33f33 + bae8823 commit 3dc9edb

13 files changed

Lines changed: 61 additions & 35 deletions

File tree

.github/workflows/python.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,10 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: [ubuntu-latest, macos-latest, windows-latest]
15-
python-version: ['3.9', 'pypy3.9', '3.10', 'pypy3.10', '3.11', '3.12', '3.13']
15+
python-version: ['3.10', '3.11', 'pypy3.11', '3.12', '3.13', '3.14']
1616
exclude:
1717
- os: macos-latest
18-
python-version: '3.9'
19-
- os: macos-latest
20-
python-version: 'pypy3.9'
21-
- os: macos-latest
22-
python-version: '3.10'
23-
- os: macos-latest
24-
python-version: 'pypy3.10'
25-
include:
26-
- os: macos-13
27-
python-version: '3.9'
28-
- os: macos-13
29-
python-version: 'pypy3.9'
30-
- os: macos-13
3118
python-version: '3.10'
32-
- os: macos-13
33-
python-version: 'pypy3.10'
3419
steps:
3520
- uses: actions/checkout@v5
3621
with:
@@ -65,7 +50,7 @@ jobs:
6550
fetch-depth: 0
6651
- uses: actions/setup-python@v6
6752
with:
68-
python-version: '3.13'
53+
python-version: '3.14'
6954
- run: pip install build~=1.2
7055
- run: python -m build
7156
- uses: pypa/gh-action-pypi-publish@release/v1

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PYTHON_VERSION="3.13"
1+
ARG PYTHON_VERSION="3.14"
22

33
FROM python:${PYTHON_VERSION}
44

NOTICE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version-query
2-
Copyright (c) 2017-2025 Mateusz Bysiek https://mbdevpl.github.io/
2+
Copyright (c) 2017-2026 Mateusz Bysiek https://mbdevpl.github.io/
33
Copyright (c) 2020 John Vandenberg https://github.com/jayvdb
44

55
Licensed under the Apache License, Version 2.0 (the "License");

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ using version-query without any issues.
517517
Requirements
518518
============
519519

520-
Python version 3.9 or later.
520+
Python version 3.10 or later.
521521

522522
Python libraries as specified in `<requirements.txt>`_.
523523

requirements_ci.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ coverage ~= 7.2
44
flake518 ~= 1.6
55
mypy ~= 1.5
66
pydocstyle ~= 6.3
7-
pylint ~= 3.1
7+
pylint ~= 3.3; python_version < '3.10'
8+
pylint ~= 4.0; python_version >= '3.10'
89
twine ~= 6.1
910
types-setuptools >= 67.4

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ class Package(boilerplates.setup.Package):
1919
'Operating System :: MacOS',
2020
'Operating System :: Microsoft :: Windows',
2121
'Operating System :: POSIX :: Linux',
22-
'Programming Language :: Python :: 3.9',
2322
'Programming Language :: Python :: 3.10',
2423
'Programming Language :: Python :: 3.11',
2524
'Programming Language :: Python :: 3.12',
2625
'Programming Language :: Python :: 3.13',
26+
'Programming Language :: Python :: 3.14',
2727
'Programming Language :: Python :: 3 :: Only',
2828
'Topic :: Software Development :: Version Control',
2929
'Topic :: Software Development :: Version Control :: Git',

test/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ class TestsLogging(Logging):
1212

1313

1414
TestsLogging.configure()
15+
logging.getLogger('version_query.git_query').setLevel(logging.INFO)
16+
logging.getLogger('version_query.parser').setLevel(logging.INFO)
17+
logging.getLogger('version_query.version').setLevel(logging.INFO)

test/test_cli.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import contextlib
44
import io
55
import logging
6+
import os
67
import runpy
78
import sys
89
import unittest
@@ -42,20 +43,29 @@ class Tests(unittest.TestCase):
4243
def test_not_as_main(self): # pylint: disable = no-self-use
4344
run_module('version_query', run_name='__not_main__')
4445

46+
@unittest.skipUnless(
47+
os.environ.get('TEST_CLI') or os.environ.get('CI'),
48+
'skipping CLI test which breaks test logging')
4549
def test_help(self):
4650
sio = io.StringIO()
4751
with contextlib.redirect_stderr(sio), preserve_logger_level('version_query'), \
4852
self.assertRaises(SystemExit):
4953
run_module('version_query')
5054
_LOG.info('%s', sio.getvalue())
5155

56+
@unittest.skipUnless(
57+
os.environ.get('TEST_CLI') or os.environ.get('CI'),
58+
'skipping CLI test which breaks test logging')
5259
def test_bad_usage(self):
5360
sio = io.StringIO()
5461
with contextlib.redirect_stderr(sio), preserve_logger_level('version_query'), \
5562
self.assertRaises(ValueError):
5663
run_module('version_query', '-p', '-i', '.')
5764
_LOG.info('%s', sio.getvalue())
5865

66+
@unittest.skipUnless(
67+
os.environ.get('TEST_CLI') or os.environ.get('CI'),
68+
'skipping CLI test which breaks test logging')
5969
def test_here(self):
6070
sio = io.StringIO()
6171
with temporarily_set_logger_level('version_query', logging.ERROR), \
@@ -64,6 +74,9 @@ def test_here(self):
6474
self.assertEqual(sio.getvalue().rstrip(), query_caller().to_str())
6575
self.assertEqual(sio.getvalue().rstrip(), query_version_str())
6676

77+
@unittest.skipUnless(
78+
os.environ.get('TEST_CLI') or os.environ.get('CI'),
79+
'skipping CLI test which breaks test logging')
6780
def test_increment_here(self):
6881
sio = io.StringIO()
6982
with temporarily_set_logger_level('version_query', logging.ERROR), \
@@ -72,6 +85,9 @@ def test_increment_here(self):
7285
self.assertEqual(sio.getvalue().rstrip(),
7386
query_caller().increment(VersionComponent.Patch).to_str())
7487

88+
@unittest.skipUnless(
89+
os.environ.get('TEST_CLI') or os.environ.get('CI'),
90+
'skipping CLI test which breaks test logging')
7591
def test_predict_here(self):
7692
sio = io.StringIO()
7793
with temporarily_set_logger_level('version_query', logging.ERROR), \

test/test_git.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import itertools
44
import logging
5+
import os
56
import platform
67
import unittest
78

@@ -79,6 +80,19 @@ def test_nonversion_tags(self):
7980
version.local = (f'git{self.repo_head_hexsha}',)
8081
self.assertEqual(version, upcoming_version)
8182

83+
def test_too_short_version_tag(self):
84+
self.git_commit_new_file()
85+
self.repo.create_tag('v1.0')
86+
self.git_commit_new_file()
87+
self.repo.create_tag('v')
88+
self.git_commit_new_file()
89+
self.repo.create_tag('ver')
90+
current_version = query_git_repo(self.repo_path)
91+
_LOG.debug('current version is %s', current_version)
92+
self.assertEqual(current_version.to_str(), '1.0')
93+
94+
@unittest.skipUnless(
95+
os.environ.get('TEST_LONG') or os.environ.get('CI'), 'skipping long test')
8296
def test_too_long_no_tag(self):
8397
self.git_commit_new_file()
8498
self.repo.create_tag('v4.0.0')

test/test_query.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ def _query_test_case(self, paths, query_function):
6060
else:
6161
_LOG.debug('%s: %s', path, version)
6262

63+
@unittest.skipUnless(
64+
os.environ.get('TEST_LONG') or os.environ.get('CI'), 'skipping long test')
6365
def test_query_git_repo(self):
6466
self._check_examples_count('git repo', GIT_REPO_EXAMPLES)
67+
_LOG.debug('testing query_git_repo() on %i repositories', len(GIT_REPO_EXAMPLES))
6568
self._query_test_case(GIT_REPO_EXAMPLES, query_git_repo)
6669

6770
def test_predict_caller_bad(self):
@@ -81,7 +84,10 @@ def test_predict_caller_bad(self):
8184
_LOG.warning('removed %s from sys.path', project_path_str)
8285
project_file_path.unlink()
8386

87+
@unittest.skipUnless(
88+
os.environ.get('TEST_LONG') or os.environ.get('CI'), 'skipping long test')
8489
def test_predict_git_repo(self):
90+
_LOG.debug('testing predict_git_repo() on %i repositories', len(GIT_REPO_EXAMPLES))
8591
self._query_test_case(GIT_REPO_EXAMPLES, predict_git_repo)
8692

8793
@unittest.skipIf(not METADATA_JSON_EXAMPLE_PATHS, 'no "metadata.json" files found')

0 commit comments

Comments
 (0)