From 669430f49231f568db114947c32956ed2d908512 Mon Sep 17 00:00:00 2001 From: Ondřej Nosek Date: Jun 25 2025 02:14:51 +0000 Subject: Switch to %pyproject_* macros Drop setuptools support and relevant cleanup. Only Python3.6 still relies on setuptools so it can't be completely removed yet. Drop bash and zsh completion in favor of python argcomplete. Add python 3.14 classifiers and test environment. JIRA: RHELCMP-14593 Signed-off-by: Ondřej Nosek --- diff --git a/conf/bash-completion/fedpkg.bash b/conf/bash-completion/fedpkg.bash deleted file mode 100644 index 9b87235..0000000 --- a/conf/bash-completion/fedpkg.bash +++ /dev/null @@ -1,391 +0,0 @@ -# fedpkg bash completion - -_fedpkg() -{ - COMPREPLY=() - - in_array() - { - local i - for i in $2; do - [[ $i = $1 ]] && return 0 - done - return 1 - } - - _filedir_exclude_paths() - { - _filedir "$@" - for ((i=0; i<=${#COMPREPLY[@]}; i++)); do - [[ ${COMPREPLY[$i]} =~ /?\.git/? ]] && unset COMPREPLY[$i] - done - } - - local cur prev - _get_comp_words_by_ref cur prev - - # global options - - local options="--help -v -q" - local options_value="--release --user --path --user-config --name --namespace" - local commands="build chain-build ci clean clog clone co commit compile \ - container-build diff gimmespec giturl help gitbuildhash import install lint \ - local mockbuild mock-config module-build module-build-cancel \ - module-build-local module-build-info module-build-watch module-overview \ - module-scratch-build \ - new new-sources patch prep pull push retire request-branch request-repo \ - request-tests-repo request-side-tag list-side-tags remove-side-tag \ - scratch-build set-distgit-token set-pagure-token sources srpm switch-branch \ - tag unused-patches update upload \ - verify-files verrel override fork" - - # parse main options and get command - - local command= - local command_first= - local path= - - local i w - for (( i = 0; i < ${#COMP_WORDS[*]} - 1; i++ )); do - w="${COMP_WORDS[$i]}" - # option - if [[ ${w:0:1} = - ]]; then - if in_array "$w" "$options_value"; then - ((i++)) - [[ "$w" = --path ]] && path="${COMP_WORDS[$i]}" - fi - # command - elif in_array "$w" "$commands"; then - command="$w" - command_first=$((i+1)) - break - fi - done - - # complete base options - - if [[ -z $command ]]; then - if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W "$options $options_value" -- "$cur") ) - return 0 - fi - - case "$prev" in - --release | --user | -u | --config) - ;; - --path) - _filedir_exclude_paths - ;; - --namespace) - COMPREPLY=( $(compgen -W "$(_fedpkg_namespaces)" -- "$cur") ) - ;; - *) - COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) - ;; - esac - - return 0 - fi - - # parse command specific options - - local options= - local options_target= options_arches= options_branch= options_string= options_file= options_dir= options_srpm= options_mroot= options_builder= options_namespace= - local options_update_type= options_update_request= - local options_yaml= - local after= after_more= - - case $command in - help|gimmespec|gitbuildhash|giturl|new|push|unused-patches|verrel|set-distgit-token|set-pagure-token) - ;; - build) - options="--nowait --background --skip-tag --scratch --skip-remote-rules-validation --fail-fast" - options_arches="--arches" - options_srpm="--srpm" - options_target="--target" - ;; - chain-build) - options="--nowait --background" - options_target="--target" - after="package" - after_more=true - ;; - clean) - options="--dry-run -x" - ;; - clog) - options="--raw" - ;; - clone|co) - options="--branches --anonymous" - options_branch="-b" - after="package" - ;; - commit|ci) - options="--push --clog --raw --tag --with-changelog" - options_string="--message" - options_file="--file" - after="file" - after_more=true - ;; - compile|install) - options="--short-circuit" - options_arches="--arch" - options_dir="--builddir" - ;; - container-build) - options="--scratch --nowait --repo-url --skip-remote-rules-validation" - options_arches="--arches" - options_target="--target" - ;; - diff) - options="--cached" - after="file" - after_more=true - ;; - import) - options="--create" - options_branch="--branch" - after="srpm" - ;; - lint) - options="--info" - options_file="--rpmlintconf" - ;; - list-side-tags) - options="--mine" - options_string="--user --base-tag" - ;; - local) - options="--md5" - options_arches="--arch" - options_string="--with --without" - options_dir="--builddir" - ;; - mock-config) - options="--target" - options_arches="--arch" - ;; - mockbuild) - options="--md5 --no-clean --no-cleanup-after --no-clean-all --shell" - options_string="--with --without" - options_mroot="--root --mock-config" - ;; - module-build) - options="--scratch --watch" - options_string="--optional --requires --buildrequires" - options_yaml="--file" - options_srpm="--srpm" - ;; - module-build-local) - options="--skip-tests" - options_string="--add-local-build --stream --set-default-stream" - options_yaml="--file" - options_srpm="--srpm" - ;; - module-overview) - options="--unfinished" - options_string="--limit" - ;; - module-scratch-build) - options="--watch" - options_string="--optional --requires --buildrequires" - options_yaml="--file" - options_srpm="--srpm" - ;; - patch) - options="--rediff" - options_string="--suffix" - ;; - prep|verify-files) - options_arches="--arch" - options_dir="--builddir" - ;; - pull) - options="--rebase --no-rebase" - ;; - remove-side-tag) - after_more=true - ;; - retire) - after_more=true - ;; - request-branch) - options="--no-git-branch --all-releases --no-auto-module" - options_string="--sl --repo" - ;; - request-repo) - options="--exception --no-initial-commit" - options_string="--description --monitor --upstreamurl --summary" - options_namespace="--namespace" - ;; - request-tests-repo) - options_string="--bug" - ;; - request-side-tag) - options_string="--base-tag" - ;; - scratch-build) - options="--nowait --background" - options_target="--target" - options_arches="--arches" - options_srpm="--srpm" - ;; - sources) - options_dir="--outdir" - ;; - srpm) - options="--md5" - ;; - switch-branch) - options="--list" - after="branch" - ;; - tag) - options="--clog --raw --force --list --delete" - options_string="--message" - options_file="--file" - after_more=true - ;; - upload|new-sources) - after="file" - after_more=true - ;; - update) - options="--not-close-bugs --suggest-reboot --disable-autokarma" - options_string="--notes --bugs --stable-karma --unstable-karma" - options_update_type="--type" - options_update_request="--request" - ;; - esac - - local all_options="--help $options" - local all_options_value="$options_target $options_arches $options_branch \ - $options_string $options_file $options_dir $options_srpm $options_mroot \ - $options_builder $options_namespace $options_update_type $options_update_request \ - $options_yaml" - - # count non-option parameters - - local i w - local last_option= - local after_counter=0 - for (( i = $command_first; i < ${#COMP_WORDS[*]} - 1; i++)); do - w="${COMP_WORDS[$i]}" - if [[ ${w:0:1} = - ]]; then - if in_array "$w" "$all_options"; then - last_option="$w" - continue - elif in_array "$w" "$all_options_value"; then - last_option="$w" - ((i++)) - continue - fi - fi - in_array "$last_option" "$options_arches" || ((after_counter++)) - done - - # completion - - if [[ -n $options_target ]] && in_array "$prev" "$options_target"; then - COMPREPLY=( $(compgen -W "$(_fedpkg_target)" -- "$cur") ) - - elif [[ -n $options_arches ]] && in_array "$last_option" "$options_arches"; then - COMPREPLY=( $(compgen -W "$(_fedpkg_arch) $all_options" -- "$cur") ) - - elif [[ -n $options_srpm ]] && in_array "$prev" "$options_srpm"; then - _filedir_exclude_paths "*.src.rpm" - - elif [[ -n $options_yaml ]] && in_array "$prev" "$options_yaml"; then - _filedir_exclude_paths "yaml" - - elif [[ -n $options_branch ]] && in_array "$prev" "$options_branch"; then - COMPREPLY=( $(compgen -W "$(_fedpkg_branch "$path")" -- "$cur") ) - - elif [[ -n $options_file ]] && in_array "$prev" "$options_file"; then - _filedir_exclude_paths - - elif [[ -n $options_dir ]] && in_array "$prev" "$options_dir"; then - _filedir_exclude_paths -d - - elif [[ -n $options_string ]] && in_array "$prev" "$options_string"; then - COMPREPLY=( ) - - elif [[ -n $options_mroot ]] && in_array "$prev" "$options_mroot"; then - COMPREPLY=( ) - if declare -F _mock_root &>/dev/null; then - _mock_root - elif declare -F _xfunc &>/dev/null; then - _xfunc mock _mock_root - fi - - elif [[ -n $options_namespace ]] && in_array "$prev" "$options_namespace"; then - COMPREPLY=( $(compgen -W "$(_fedpkg_namespaces)" -- "$cur") ) - - elif [[ -n $options_update_type ]] && in_array "$prev" "$options_update_type"; then - COMPREPLY=( $(compgen -W "bugfix security enhancement newpackage" -- "$cur") ) - - elif [[ -n $options_update_request ]] && in_array "$prev" "$options_update_request"; then - COMPREPLY=( $(compgen -W "testing stable" -- "$cur") ) - - else - local after_options= - - if [[ $after_counter -eq 0 ]] || [[ $after_more = true ]]; then - case $after in - file) _filedir_exclude_paths ;; - srpm) _filedir_exclude_paths "*.src.rpm" ;; - branch) after_options="$(_fedpkg_branch "$path")" ;; - package) after_options="$(_fedpkg_package "$cur")";; - esac - fi - - if [[ $cur != -* ]]; then - all_options= - all_options_value= - fi - - COMPREPLY+=( $(compgen -W "$all_options $all_options_value $after_options" -- "$cur" ) ) - fi - - return 0 -} && -complete -F _fedpkg fedpkg - -_fedpkg_target() -{ - koji list-targets --quiet 2>/dev/null | cut -d" " -f1 -} - -_fedpkg_arch() -{ - echo "aarch64 armhfp i686 ppc64le s390x x86_64" -} - -_fedpkg_branch() -{ - local git_options= format="--format %(refname:short)" - [[ -n $1 ]] && git_options="--git-dir=$1/.git" - - git $git_options for-each-ref $format 'refs/remotes' | sed 's,.*/,,' - git $git_options for-each-ref $format 'refs/heads' -} - -_fedpkg_package() -{ - repoquery -C --qf=%{sourcerpm} "$1*" 2>/dev/null | sort -u | sed -r 's/(-[^-]*){2}\.src\.rpm$//' -} - -_fedpkg_namespaces() -{ - grep "^distgit_namespaces =" /etc/rpkg/fedpkg.conf | cut -d'=' -f2 -} - - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh diff --git a/conf/zsh-completion/_fedpkg b/conf/zsh-completion/_fedpkg deleted file mode 100644 index 405f13c..0000000 --- a/conf/zsh-completion/_fedpkg +++ /dev/null @@ -1,563 +0,0 @@ -#compdef fedpkg - -(( $+functions[_fedpkg_targets] )) || -_fedpkg_targets() -{ - local expl - - _wanted koji-targets expl 'target' compadd \ - ${${(f)"$(_call_program koji-targets koji list-targets --quiet 2>/dev/null)"}%% *} -} - -(( $+functions[_fedpkg_arches] )) || -_fedpkg_arches() -{ - local expl - local -a arches - - arches=( /etc/mock/[^-]##-[^-]##-[^-]##.cfg ) - _wanted mock-arches expl 'arch' compadd \ - ${(u)${arches#/etc/mock/[^-]##-[^-]##-}%.cfg} -} - -(( $+functions[_fedpkg_packages] )) || -_fedpkg_packages() -{ - local expl - - _wanted repo-packages expl 'package' compadd \ - ${${(fu)"$(repoquery -Cs -- "$words[CURRENT]*")"}%-[^-]##-[^-]##.src.rpm} -} - -(( $+functions[_fedpkg_branches] )) || -_fedpkg_branches() -{ - local expl - local -a git_opts - local -a branches - - (( ${words[(I)--path]} )) && - git_opts=( --git-dir ${words[${words[(i)--path]}+1]} ) - - branches=(${${(f)"$(git $git_opts for-each-ref --format='%(refname)' refs/heads 2>/dev/null)"}#refs/heads/}) - branches+=(${${(f)"$(git $git_opts for-each-ref --format='%(refname)' refs/remotes 2>/dev/null)"}##refs/remotes/*/}) - - _wanted branch-names expl 'branch-name' compadd \ - ${(u)branches} -} - -(( $+functions[_fedpkg-help] )) || -_fedpkg-help () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' -} - -(( $+functions[_fedpkg-build] )) || -_fedpkg-build () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--arches[build for specific arches]:*:arch:_fedpkg_arches' \ - '--md5[use md5 checksums]' \ - '--nowait[don'\''t wait on build]' \ - '--target[define build target to build into]:target:_fedpkg_targets' \ - '--background[run the build at a low priority]' \ - '--skip-tag[do not attempt to tag package]' \ - '--scratch[perform a scratch build]' \ - '--srpm[build from an srpm]::srpm:_files -g "*.src.rpm"' \ - '--skip-remote-rules-validation[don'\''t check gating.yaml policies]' -} - -(( $+functions[_fedpkg-chain-build] )) || -_fedpkg-chain-build () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--arches[build for specific arches]:*:arch:_fedpkg_arches' \ - '--md5[use md5 checksums]' \ - '--nowait[on'\''t wait on build]' \ - '--target[define build target to build into]:target:_fedpkg_targets' \ - '--background[run the build at a low priority]' \ - '*:package:_fedpkg_packages' -} - -(( $+functions[_fedpkg-clean] )) || -_fedpkg-clean () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(-n --dry-run)'{-n,--dry-run}'[perform a dry-run]' \ - '-x[do not follow .gitignore rules]' -} - -(( $+functions[_fedpkg-clog] )) || -_fedpkg-clog () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--raw[generate a more "raw" clog without twiddling the contents]' -} - -(( $+functions[_fedpkg-clone] )) || -_fedpkg-clone () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(-B --branches)'{-B,--branches}'[do an old style checkout with subdirs for branches]' \ - '(-b --branch)'{-b,--branch}'[check out a specific branch]:branch:_fedpkg_branches' \ - '(-a --anonymous)'{-a,--anonymous}'[check out a module anonymously]' \ - ':package:_fedpkg_packages' -} - -(( $+functions[_fedpkg-commit] )) || -_fedpkg-commit () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(-c --clog)'{-c,--clog}'[generate the commit message from the %changelog section]' \ - '--raw[make the clog raw]' \ - '(-t --tag)'{-t,--tag}'[create a tag for this commit]' \ - '(-m --message)'{-m,--message}'[use the given commit message]:message' \ - '(-F --file)'{-F,--file}'[take the commit message from the given file]:file:_files' \ - '(-p --push)'{-p,--push}'[commit and push as one action]' \ - '(--with-changelog)'{--with-changelog}'[get the last changelog from SPEC as commit message body]' \ - '*:file:_files' -} - -(( $+functions[_fedpkg-compile] )) || -_fedpkg-compile () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--builddir[define an alternate builddir]:builddir:_files -/' \ - '--arch[prep for a specific arch]:arch:_fedpkg_arches' \ - '--short-circuit[short-circuit compile]' -} - -(( $+functions[_fedpkg-copr-build] )) || -_fedpkg-copr-build () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--nowait[on'\''t wait on build]' \ - '*:project' -} - -(( $+functions[_fedpkg-diff] )) || -_fedpkg-diff () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--cached[view staged changes]' \ - '*:file:_files' -} - -(( $+functions[_fedpkg-gimmespec] )) || -_fedpkg-gimmespec () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' -} - -(( $+functions[_fedpkg-gitbuildhash] )) || -_fedpkg-gitbuildhash () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - ':build' -} - -(( $+functions[_fedpkg-giturl] )) || -_fedpkg-giturl () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' -} - -(( $+functions[_fedpkg-import] )) || -_fedpkg-import () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - ':srpm:_files -g "*.src.rpm"' -} - -(( $+functions[_fedpkg-install] )) || -_fedpkg-install () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--builddir[define an alternate builddir]:builddir:_files -/' \ - '--arch[prep for a specific arch]:arch:_fedpkg_arches' \ - '--short-circuit[short-circuit compile]' -} - -(( $+functions[_fedpkg-lint] )) || -_fedpkg-lint () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(-i --info)'{-i,--info}'[display explanations for reported messages]' \ - '(-r --rpmlintconf)'{-r,--rpmlintconf}'[use a specific configuration file for rpmlint]:rpmlintconf:_files' -} - -(( $+functions[_fedpkg-local] )) || -_fedpkg-local () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--builddir[define an alternate builddir]:builddir:_files -/' \ - '--arch[prep for a specific arch]:arch:_fedpkg_arches' \ - '--md5[use md5 checksums]' -} - -(( $+functions[_fedpkg-mockbuild] )) || -_fedpkg-mockbuild () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--root[override mock root]:root:_files -/' \ - '--md5[use md5 checksums]' \ - '--no-clean[Do not clean chroot before building package]' \ - '--no-cleanup-after[Do not clean chroot after building (if automatic cleanup is enabled)]' \ - '--no-clean-all[Alias for both --no-clean and --no-cleanup-after]' \ - '--with[Enable configure option (bcond) for the build]' \ - '--without[Disable configure option (bcond) for the build]' \ - '--shell[Run commands interactively within chroot]' -} - -(( $+functions[_fedpkg-mock-config] )) || -_fedpkg-mock-config () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--target[override target used for config]:target:_fedpkg_targets' - '--arch[override local arch]:arch:_fedpkg_arches' -} - -(( $+functions[_fedpkg-module-build] )) || -_fedpkg-module-build () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(-w --watch)'{-w,--watch}'[Watch the module build]' \ - '--buildrequires[Buildrequires to override in the form of "name:stream"]' \ - '--requires[Requires to override in the form of "name:stream"]' \ - '--optional[MBS optional arguments in the form of "key=value"]:optional' \ - '--scratch[Perform a scratch build]' \ - '--file[The modulemd yaml file for module scratch build.]:file:_files -g "*.yaml"' \ - '*--srpm[Include srpm for module scratch build.]:srpm:_files -g "*.src.rpm"' \ - ':scm_url' \ - ':branch' -} - -(( $+functions[_fedpkg-module-build-cancel] )) || -_fedpkg-module-build-cancel () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - ':build_id' -} - -(( $+functions[_fedpkg-module-build-info] )) || -_fedpkg-module-build-info () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - ':build_id' -} - -(( $+functions[_fedpkg-module-build-local] )) || -_fedpkg-module-build-local () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--skip-tests[Adds a macro for skipping the check section]' \ - '--add-local-build[Import previously finished local module builds into MBS]:build_id' \ - '--stream[The module'\''s stream/SCM branch.]:stream' \ - '(--set-default-stream -s)'{--set-default-stream,-s}'[Set the default stream for given module dependency.]:default_stream' \ - '--file[The module'\''s modulemd yaml file.]:file:_files -g "*.yaml"' \ - '*--srpm[Include srpm for module build.]:srpm:_files -g "*.src.rpm"' \ - ':scm_url' \ - ':branch' -} - -(( $+functions[_fedpkg-module-overview] )) || -_fedpkg-module-overview () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--unfinished[Show unfinished module builds]' \ - '--limit[The number of most recent module builds to display]:limit' -} - -(( $+functions[_fedpkg-module-build-watch] )) || -_fedpkg-module-build-watch () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - ':build_id' -} - -(( $+functions[_fedpkg-module-scratch-build] )) || -_fedpkg-module-scratch-build () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(-w --watch)'{-w,--watch}'[Watch the module build]' \ - '--buildrequires[Buildrequires to override in the form of "name:stream"]' \ - '--requires[Requires to override in the form of "name:stream"]' \ - '--optional[MBS optional arguments in the form of "key=value"]:optional' \ - '--file[The modulemd yaml file for module scratch build.]:file:_files -g "*.yaml"' \ - '*--srpm[Include srpm for module scratch build.]:srpm:_files -g "*.src.rpm"' \ - ':scm_url' \ - ':branch' -} - -(( $+functions[_fedpkg-new] )) || -_fedpkg-new () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' -} - -(( $+functions[_fedpkg-new-sources] )) || -_fedpkg-new-sources () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '*:file:_files' -} - -(( $+functions[_fedpkg-patch] )) || -_fedpkg-patch () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--rediff[recreate gendiff file retaining comments]' \ - ':suffix' -} - -(( $+functions[_fedpkg-prep] )) || -_fedpkg-prep () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--builddir[define an alternate builddir]:builddir:_files -/' \ - '--arch[prep for a specific arch]:arch:_fedpkg_arches' -} - -(( $+functions[_fedpkg-pull] )) || -_fedpkg-pull () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(--no-rebase)--rebase[rebase the locally committed changes on top of the remote changes]' \ - '(--rebase)--no-rebase[do not rebase, override .git settings to automatically rebase]' -} - -(( $+functions[_fedpkg-push] )) || -_fedpkg-push () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' -} - -(( $+functions[_fedpkg-request-branch] )) || -_fedpkg-request-branch () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(--sl)'{--sl}'[The service levels (SLs) tied to the branch]' \ - '--no-git-branch[Do not create the branch in git but still create it in PDC]:optional' \ - '--all-releases[Make a new branch request for every active Fedora release]:optional' \ - ':branch' -} - -(( $+functions[_fedpkg-request-repo] )) || -_fedpkg-request-repo () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(-d --description)'{-d,--description}'[The description in dist-git]' \ - '(-m --monitor)'{-m,--monitor}'[The Anitya monitoring type for the repo]' \ - '(-u --upstreamurl)'{-u,--upstreamurl}'[The upstream URL of the project]' \ - '(-s --summary)'{-s,--summary}'[Override the package summary from the Bugzilla bug]' \ - '--exception[The package is an exception to the regular package review process]:optional' \ - ':bug' -} - -(( $+functions[_fedpkg-scratch-build] )) || -_fedpkg-scratch-build () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--arches[build for specific arches]:*:arch:_fedpkg_arches' \ - '--md5[use md5 checksums]' \ - '--nowait[on'\''t wait on build]' \ - '--target[define build target to build into]:target:_fedpkg_targets' \ - '--background[run the build at a low priority]' \ - '--srpm[build from an srpm]::srpm:_files -g "*.src.rpm"' -} - -(( $+functions[_fedpkg-sources] )) || -_fedpkg-sources () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--outdir[directory to download files into]:outdir:_files -/' -} - -(( $+functions[_fedpkg-srpm] )) || -_fedpkg-srpm () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--md5[use md5 checksums]' -} - -(( $+functions[_fedpkg-switch-branch] )) || -_fedpkg-switch-branch () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(: -l --list)'{-l,--list}'[list both remote-tracking branches and local branches]' \ - '(-):branch:_fedpkg_branches' -} - -(( $+functions[_fedpkg-tag] )) || -_fedpkg-tag () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(-f --force)'{-f,--force}'[force the creation of the tag]' \ - '(-m --message)'{-m,--message}'[use the given commit message]:message' \ - '(-c --clog)'{-c,--clog}'[generate the commit message from the %changelog section]' \ - '--raw[make the clog raw]' \ - '(-F --file)'{-F,--file}'[take the commit message from the given file]:file:_files' \ - '(-l --list)'{-l,--list}'[list all tags with a given pattern]' \ - '(-d --delete)'{-d,--delete}'[delete a tag]' \ - ':tag' -} - -(( $+functions[_fedpkg-unused-patches] )) || -_fedpkg-unused-patches () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' -} - -(( $+functions[_fedpkg-upload] )) || -_fedpkg-upload () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '*:file:_files' -} - -(( $+functions[_fedpkg-verify-files] )) || -_fedpkg-verify-files () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '--builddir[define an alternate builddir]:builddir:_files -/' \ - '--arch[prep for a specific arch]:arch:_fedpkg_arches' -} - -(( $+functions[_fedpkg-verrel] )) || -_fedpkg-verrel () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' -} - -(( $+functions[_fedpkg-retire] )) || -_fedpkg-retire () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(-p --push)'{-p,--push}'[push changes to remote repository]' \ - ':message' -} - -(( $+functions[_fedpkg-update] )) || -_fedpkg-update () { - _arguments -C \ - '(-h --help)'{-h,--help}'[show help message and exit]' \ - '(--type)'{--type}'[update type]' \ - '(--request)'{--request}'[update request type]' \ - '(--bugs)'{--bugs}'[bug numbers to be resolved]' \ - '(--notes)'{--notes}'[update description]' \ - '(--disable-autokarma)'{--disable-autokarma}'[disable karma automatism]' \ - '(--stable-karma)'{--stable-karma}'[stable karma]' \ - '(--unstable-karma)'{--unstable-karma}'[unstable karma]' \ - '(--not-close-bugs)'{--not-close-bugs}'[do not close bugs automatically]' \ - '(--suggest-reboot)'{--suggest-reboot}'[suggest reboot]' -} - -(( $+functions[_fedpkg_commands] )) || -_fedpkg_commands () { - local -a fedpkg_commands - fedpkg_commands=( - help:'show usage' - build:'request build' - chain-build:'build current package in order with other packages' - clean:'remove untracked files' - clog:'make a clog file containing top changelog entry' - clone:'clone and checkout a module' - commit:'commit changes' - compile:'local test rpmbuild compile' - copr-build:'build package in Copr' - diff:'show changes between commits, commit and working tree, etc' - gimmespec:'print the spec file name' - gitbuildhash:'print the git hash used to build the provided n-v-r' - giturl:'print the git url for building' - import:'import srpm content into a module' - install:'local test rpmbuild install' - lint:'run rpmlint against local spec and build output if present' - local:'local test rpmbuild binary' - mockbuild:'local test build using mock' - mock-config:'generate a mock config' - module-build:'build a module using MBS' - module-build-cancel:'cancel an MBS module build' - module-build-info:'show information of an MBS module build' - module-build-local:'build a module locally using the mbs-manager command' - module-build-watch:'watch an MBS build' - module-overview:'shows an overview of MBS builds' - module-scratch-build:'build a scratch module using MBS' - new:'diff against last tag' - new-sources:'upload new source files' - patch:'create and add a gendiff patch file' - prep:'local test rpmbuild prep' - pull:'pull changes from remote repository and update working copy' - push:'push changes to remote repository' - request-branch:'request a new dist-git branch' - request-repo:'request a new dist-git repository' - scratch-build:'request scratch build' - sources:'download source files' - srpm:'create a source rpm' - switch-branch:'work with branches' - tag:'management of git tags' - unused-patches:'print list of patches not referenced by name in the specfile' - upload:'upload source files' - verify-files:'locally verify %files section' - verrel:'print the name-version-release' - retire:'retire a package' - update:'submit last build as an update' - ) - - integer ret=1 - - # TODO: Is this the correct way of doing it? Should we be using _alternative - # and separate functions for each set of commands instead? - _describe -t fedpkg-commands 'fedpkg command' fedpkg_commands && ret=0 - - return ret -} - -_fedpkg() { - local -A fedpkg_aliases - fedpkg_aliases=( - co clone - ci commit - ) - integer ret=1 - - local curcontext=$curcontext state line - declare -A opt_args - - _arguments -C \ - '(- :)'{-h,--help}'[show help message and exit]' \ - '(-C --config)'{-C,--config}'[specify a config file to use]:config file:_files' \ - '--user-config[specify a user config file to use]:user config file:_files' \ - '--dist[override the discovered distribution]:distribution' \ - '--release[override the discovered release]:release' \ - '--user[override the discovered user name]:user' \ - '--path[define the directory to work in (defaults to cwd)]:working direcory:_directories' \ - '(-q)-v[run with verbose debug output]' \ - '(-v)-q[run quietly only displaying errors]' \ - '(-): :->command' \ - '(-)*:: :->option-or-argument' && return - - case $state in - (command) - _fedpkg_commands && ret=0 - ;; - (option-or-argument) - local cmd=$words[1] - (( $+fedpkg_aliases[$cmd] )) && - cmd=$fedpkg_aliases[$cmd] - - curcontext=${curcontext%:*:*}:fedpkg-$cmd: - - if (( $+functions[_fedpkg-$cmd] )); then - _call_function ret _fedpkg-$cmd - elif zstyle -T :completion:$curcontext: use-fallback; then - _files && ret=0 - else - _message 'unknown sub-command' - fi - ;; - esac - - return ret -} - -_fedpkg diff --git a/jenkins_test.dockerfile b/jenkins_test.dockerfile index f848fd2..7970925 100644 --- a/jenkins_test.dockerfile +++ b/jenkins_test.dockerfile @@ -23,4 +23,4 @@ WORKDIR /src ENV PYTHONPATH "${PYTHONPATH}:./rpkg" -CMD ["tox", "-e", "py36,py39,py312,py313,flake8,bandit"] +CMD ["tox", "-e", "py36,py39,py312,py313,py314,flake8,bandit"] diff --git a/pyproject.toml b/pyproject.toml index 1113594..3fc787f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Software Development :: Build Tools", ] dependencies = [ @@ -30,7 +31,6 @@ dependencies = [ "openidc-client", "python-bugzilla", "rpkg", - "setuptools;python_version>='3.12'", ] [project.scripts] @@ -49,7 +49,6 @@ exclude = [ "/doc/source/_static", ] only-exclude = [ - ".gitignore", "/doc/source/cli.rst", "/doc/source/man_pages.json", ] @@ -83,8 +82,6 @@ packages = [ ] [tool.hatch.build.targets.wheel.shared-data] -"conf/bash-completion" = "/usr/share/bash-completion/completions" -"conf/etc/rpkg/fedpkg-stage.conf" = "/etc/rpkg/fedpkg-stage.conf" -"conf/etc/rpkg/fedpkg.conf" = "/etc/rpkg/fedpkg.conf" -"conf/zsh-completion" = "/usr/share/zsh/site-functions" +"conf/etc/rpkg/fedpkg-stage.conf" = "etc/rpkg/fedpkg-stage.conf" +"conf/etc/rpkg/fedpkg.conf" = "etc/rpkg/fedpkg.conf" diff --git a/setup.cfg b/setup.cfg index c69883b..3c47304 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,10 +5,6 @@ test = pytest formats = bztar [tool:pytest] -# additional values for 'addopts' can be: -# --cov-report html -# -ra -q -addopts = --cov=fedpkg testpaths = test [flake8] diff --git a/setup.py b/setup.py index a261d85..f67229f 100755 --- a/setup.py +++ b/setup.py @@ -4,17 +4,6 @@ import os from setuptools import find_packages, setup -try: - from subprocess import getstatusoutput -except ImportError: - from commands import getstatusoutput - - -def bash_completion_dir(): - (sts, output) = getstatusoutput( - 'pkg-config --variable=completionsdir bash-completion') - return output if not sts and output else '/etc/bash_completion.d' - project_dir = os.path.dirname(os.path.realpath(__file__)) requirements = os.path.join(project_dir, 'requirements.txt') @@ -40,13 +29,10 @@ setup( license="GPLv2+", url="https://pagure.io/fedpkg", packages=find_packages(), - data_files=[(bash_completion_dir(), ['conf/bash-completion/fedpkg.bash']), - ('/etc/rpkg', ['conf/etc/rpkg/fedpkg.conf', + data_files=[('/etc/rpkg', ['conf/etc/rpkg/fedpkg.conf', 'conf/etc/rpkg/fedpkg-stage.conf']), - ('/usr/share/zsh/site-functions', ['conf/zsh-completion/_fedpkg']), ], - setup_requires=['pytest-runner'], install_requires=install_requires, tests_require=tests_require, @@ -68,5 +54,6 @@ setup( 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14', ], )