From 5395f2d2c8be7be96f6a0f50139a09cb2a7cba71 Mon Sep 17 00:00:00 2001 From: Mateusz Bysiek Date: Wed, 12 Jun 2024 14:35:50 +0900 Subject: [PATCH 1/4] chore: adopt python 3.12 more consistently --- .github/workflows/python.yml | 3 +-- setup.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) 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/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', From 1d19ddde578e6764d25d9cc31dc194dd54a5de5f Mon Sep 17 00:00:00 2001 From: Mateusz Bysiek Date: Wed, 12 Jun 2024 14:46:17 +0900 Subject: [PATCH 2/4] chore: update copyright year --- NOTICE | 2 +- requirements.txt | 2 +- version_query/main.py | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) 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..57b0dc3 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 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( From 1fc1e4d0931b21201a4824dc67acb0d897135fda Mon Sep 17 00:00:00 2001 From: Mateusz Bysiek Date: Wed, 12 Jun 2024 14:58:48 +0900 Subject: [PATCH 3/4] feat: permit semver 3.0.* --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 57b0dc3..44debfe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ boilerplates[cli,logging] ~= 1.0 GitPython ~= 3.1 packaging >= 23.0 -semver ~= 2.13 +semver >= 2.13, < 3.1 From 6fec4591edffb91adcabb41176bf0d20a7e48fcf Mon Sep 17 00:00:00 2001 From: Mateusz Bysiek Date: Wed, 12 Jun 2024 15:34:10 +0900 Subject: [PATCH 4/4] build: update expected package filename --- Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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" ])