Skip to content

Commit 2251170

Browse files
authored
Merge pull request #21 from mbdevpl/feature/refresh-packaging
refresh packaging
2 parents 0f4d8b7 + 6fec459 commit 2251170

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

.github/workflows/python.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ jobs:
6767
fetch-depth: 0
6868
- uses: actions/setup-python@v5
6969
with:
70-
python-version: '3.11'
71-
architecture: x64
70+
python-version: '3.12'
7271
- run: pip install build
7372
- run: python -m build
7473
- uses: pypa/gh-action-pypi-publish@release/v1

Jenkinsfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pipeline {
99
}
1010

1111
environment {
12-
PYTHON_PACKAGE = 'version-query'
12+
PYTHON_PACKAGE = 'version_query'
1313
}
1414

1515
agent {
@@ -24,7 +24,7 @@ pipeline {
2424

2525
stage('Lint') {
2626
environment {
27-
PYTHON_MODULES = "${env.PYTHON_PACKAGE.replace('-', '_')} test *.py"
27+
PYTHON_MODULES = "${env.PYTHON_PACKAGE} test *.py"
2828
}
2929
steps {
3030
sh """#!/usr/bin/env bash
@@ -93,7 +93,7 @@ pipeline {
9393
sh """#!/usr/bin/env bash
9494
set -Eeuxo pipefail
9595
python3 -m twine upload \
96-
dist/${PYTHON_PACKAGE.replace('-', '_')}-${VERSION}-py3-none-any.whl \
96+
dist/${PYTHON_PACKAGE}-${VERSION}-py3-none-any.whl \
9797
dist/${PYTHON_PACKAGE}-${VERSION}.tar.gz \
9898
dist/${PYTHON_PACKAGE}-${VERSION}.zip
9999
"""
@@ -110,7 +110,7 @@ pipeline {
110110
steps {
111111
script {
112112
githubUtils.createRelease([
113-
"dist/${PYTHON_PACKAGE.replace('-', '_')}-${VERSION}-py3-none-any.whl",
113+
"dist/${PYTHON_PACKAGE}-${VERSION}-py3-none-any.whl",
114114
"dist/${PYTHON_PACKAGE}-${VERSION}.tar.gz",
115115
"dist/${PYTHON_PACKAGE}-${VERSION}.zip"
116116
])

NOTICE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version-query
2-
Copyright (c) 2017-2023 Mateusz Bysiek https://mbdevpl.github.io/
2+
Copyright (c) 2017-2024 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");

requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
boilerplates[logging] ~= 1.0
1+
boilerplates[cli,logging] ~= 1.0
22
GitPython ~= 3.1
33
packaging >= 23.0
4-
semver ~= 2.13
4+
semver >= 2.13, < 3.1

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class Package(boilerplates.setup.Package):
2424
'Programming Language :: Python :: 3.9',
2525
'Programming Language :: Python :: 3.10',
2626
'Programming Language :: Python :: 3.11',
27+
'Programming Language :: Python :: 3.12',
2728
'Programming Language :: Python :: 3 :: Only',
2829
'Topic :: Software Development :: Version Control',
2930
'Topic :: Software Development :: Version Control :: Git',

version_query/main.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import argparse
44
import pathlib
5-
import sys
5+
6+
from boilerplates.cli import make_copyright_notice, add_version_option
67

78
from ._version import VERSION
89
from .version import VersionComponent
@@ -18,17 +19,17 @@ def main(args=None, namespace=None) -> None:
1819
prog='version_query',
1920
description='''Tool for querying current versions of Python packages. Use LOGGING_LEVEL
2021
environment variable to adjust logging level.''',
21-
epilog='''Copyright 2017-2023 by the contributors, Apache License 2.0,
22-
https://github.com/mbdevpl/version-query''',
22+
epilog=make_copyright_notice(
23+
2017, 2024, author='the contributors', url='https://github.com/mbdevpl/version-query'),
2324
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
25+
add_version_option(parser, VERSION)
26+
2427
parser.add_argument('-i', '--increment', action='store_true', help='''output version string for
2528
next patch release, i.e. if version is 1.0.3, output 1.0.4''')
2629
parser.add_argument('-p', '--predict', action='store_true', help='''operate in prediction mode,
2730
i.e. assume existence of git repository and infer current version from
2831
its tags, history and working tree status''')
2932
parser.add_argument('path', type=pathlib.Path)
30-
parser.add_argument('--version', action='version',
31-
version=f'{parser.prog} {VERSION},\nPython {sys.version}')
3233
parsed_args = parser.parse_args(args=args, namespace=namespace)
3334
if parsed_args.predict and parsed_args.increment:
3435
raise ValueError(

0 commit comments

Comments
 (0)