diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index b538c2e..c70f8ab 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -67,8 +67,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-python@v5 with: - python-version: '3.11' - architecture: x64 + python-version: '3.12' - run: pip install build - run: python -m build - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/Jenkinsfile b/Jenkinsfile index 7d8a161..affeba9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline { } environment { - PYTHON_PACKAGE = 'version-query' + PYTHON_PACKAGE = 'version_query' } agent { @@ -24,7 +24,7 @@ pipeline { stage('Lint') { environment { - PYTHON_MODULES = "${env.PYTHON_PACKAGE.replace('-', '_')} test *.py" + PYTHON_MODULES = "${env.PYTHON_PACKAGE} test *.py" } steps { sh """#!/usr/bin/env bash @@ -93,7 +93,7 @@ pipeline { sh """#!/usr/bin/env bash set -Eeuxo pipefail python3 -m twine upload \ - dist/${PYTHON_PACKAGE.replace('-', '_')}-${VERSION}-py3-none-any.whl \ + dist/${PYTHON_PACKAGE}-${VERSION}-py3-none-any.whl \ dist/${PYTHON_PACKAGE}-${VERSION}.tar.gz \ dist/${PYTHON_PACKAGE}-${VERSION}.zip """ @@ -110,7 +110,7 @@ pipeline { steps { script { githubUtils.createRelease([ - "dist/${PYTHON_PACKAGE.replace('-', '_')}-${VERSION}-py3-none-any.whl", + "dist/${PYTHON_PACKAGE}-${VERSION}-py3-none-any.whl", "dist/${PYTHON_PACKAGE}-${VERSION}.tar.gz", "dist/${PYTHON_PACKAGE}-${VERSION}.zip" ]) diff --git a/NOTICE b/NOTICE index dcdd4de..86e39d7 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ version-query -Copyright (c) 2017-2023 Mateusz Bysiek https://mbdevpl.github.io/ +Copyright (c) 2017-2024 Mateusz Bysiek https://mbdevpl.github.io/ Copyright (c) 2020 John Vandenberg https://github.com/jayvdb Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/requirements.txt b/requirements.txt index 21d64a3..44debfe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -boilerplates[logging] ~= 1.0 +boilerplates[cli,logging] ~= 1.0 GitPython ~= 3.1 packaging >= 23.0 -semver ~= 2.13 +semver >= 2.13, < 3.1 diff --git a/setup.py b/setup.py index c646699..ae2283a 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,7 @@ class Package(boilerplates.setup.Package): 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3 :: Only', 'Topic :: Software Development :: Version Control', 'Topic :: Software Development :: Version Control :: Git', diff --git a/version_query/main.py b/version_query/main.py index 2d34e32..386ab18 100644 --- a/version_query/main.py +++ b/version_query/main.py @@ -2,7 +2,8 @@ import argparse import pathlib -import sys + +from boilerplates.cli import make_copyright_notice, add_version_option from ._version import VERSION from .version import VersionComponent @@ -18,17 +19,17 @@ def main(args=None, namespace=None) -> None: prog='version_query', description='''Tool for querying current versions of Python packages. Use LOGGING_LEVEL environment variable to adjust logging level.''', - epilog='''Copyright 2017-2023 by the contributors, Apache License 2.0, - https://github.com/mbdevpl/version-query''', + epilog=make_copyright_notice( + 2017, 2024, author='the contributors', url='https://github.com/mbdevpl/version-query'), formatter_class=argparse.ArgumentDefaultsHelpFormatter) + add_version_option(parser, VERSION) + parser.add_argument('-i', '--increment', action='store_true', help='''output version string for next patch release, i.e. if version is 1.0.3, output 1.0.4''') parser.add_argument('-p', '--predict', action='store_true', help='''operate in prediction mode, i.e. assume existence of git repository and infer current version from its tags, history and working tree status''') parser.add_argument('path', type=pathlib.Path) - parser.add_argument('--version', action='version', - version=f'{parser.prog} {VERSION},\nPython {sys.version}') parsed_args = parser.parse_args(args=args, namespace=namespace) if parsed_args.predict and parsed_args.increment: raise ValueError(