Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refresh packaging #21

Merged
merged 4 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pipeline {
}

environment {
PYTHON_PACKAGE = 'version-query'
PYTHON_PACKAGE = 'version_query'
}

agent {
Expand All @@ -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
Expand Down Expand Up @@ -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
"""
Expand All @@ -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"
])
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
11 changes: 6 additions & 5 deletions version_query/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down
Loading