14
0

Accepting request 1121631 from home:buschmann23:branches:devel:languages:python

- update to version 3.5.0
  * Features
    + Improve performance of check-hooks-apply and check-useless-excludes.
  * Fixes
    + Use time.monotonic() for more accurate hook timing.
  * Migrating
    + Require npm 6.x+ for language: node hooks.
- notable changes since 2.21.0
  * Remove pre-commit-validate-config and pre-commit-validate-manifest,
    use pre-commit validate-config and pre-commit validate-manifest
    instead.
  * See CHANGELOG.md
- spec file changes
  * Remove python-re-assert and python-toml from the runtime requirements
  * Remove python-toml from the build requirements
  * Update required python-virtualenv version to 20.10.0
  * Rename excluded test est_local_golang_additional_dependencies to
    test_local_golang_additional_deps
  * Exclude new tests that require internet access
    + test_run_example_executable
    + test_run_dep
    + test_perl_additional_dependencies
    + test_lua_additional_dependencies
  * Exclude new tests that have unfulfillable dependencies
    + test_swift_language
  * Add LICENSE and CHANGELOG.md to the files list

OBS-URL: https://build.opensuse.org/request/show/1121631
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pre-commit?expand=0&rev=27
This commit is contained in:
2023-11-01 15:48:46 +00:00
committed by Git OBS Bridge
parent 418ed5714c
commit 95c2bd0d37
4 changed files with 45 additions and 20 deletions

View File

@@ -18,12 +18,12 @@
%define skip_python2 1
Name: python-pre-commit
Version: 2.21.0
Version: 3.5.0
Release: 0
Summary: Multi-language pre-commit hooks
License: MIT
URL: https://github.com/pre-commit/pre-commit
Source: https://github.com/pre-commit/pre-commit/archive/v%{version}.tar.gz#/pre_commit-%{version}.tar.gz
Source: https://github.com/pre-commit/pre-commit/archive/v%{version}.tar.gz#/pre-commit-%{version}.tar.gz
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: lua54-devel
@@ -33,9 +33,7 @@ Requires: python-PyYAML >= 5.1
Requires: python-cfgv >= 2.0.0
Requires: python-identify >= 1.0.0
Requires: python-nodeenv >= 0.11.1
Requires: python-re-assert
Requires: python-toml
Requires: python-virtualenv >= 20.0.8
Requires: python-virtualenv >= 20.10.0
Requires(post): update-alternatives
Requires(postun):update-alternatives
BuildArch: noarch
@@ -47,8 +45,7 @@ BuildRequires: %{python_module nodeenv >= 0.11.1}
BuildRequires: %{python_module pytest-env}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module re-assert}
BuildRequires: %{python_module toml}
BuildRequires: %{python_module virtualenv >= 20.0.8}
BuildRequires: %{python_module virtualenv >= 20.10.0}
BuildRequires: %{pythons}
BuildRequires: git-core
# /SECTION
@@ -69,8 +66,6 @@ sed -i 's|^#!%{_bindir}/env bash|#!%{_bindir}/bash|' pre_commit/resources/hook-t
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/pre-commit
%python_clone -a %{buildroot}%{_bindir}/pre-commit-validate-manifest
%python_clone -a %{buildroot}%{_bindir}/pre-commit-validate-config
%check
export GIT_AUTHOR_NAME=test GIT_COMMITTER_NAME=test \
@@ -79,7 +74,7 @@ export GIT_AUTHOR_NAME=test GIT_COMMITTER_NAME=test \
# gh#pre-commit/pre-commit#1202
# test_switch_language_versions_doesnt_clobber - looks like your installation of python is broken?
# test_run_a_ruby_hook, test_additional_ruby_dependencies_installed: you need to have gem installed
# test_golang_hook, test_golang_hook_still_works_when_gobin_is_set, test_additional_golang_dependencies_installed, test_local_golang_additional_dependencies: you need to have go installed
# test_golang_hook, test_golang_hook_still_works_when_gobin_is_set, test_additional_golang_dependencies_installed, test_local_golang_additional_deps: you need to have go installed
# test_rust_hook, test_additional_rust_lib_dependencies_installed, test_local_rust_additional_dependencies: you need to have cargo installed
# test_installed_from_venv I suspect you have some PYTHONPATH shenanigans going on? hard to tell
# conda, dart, dotnet, node, r tests: not available
@@ -88,13 +83,17 @@ export GIT_AUTHOR_NAME=test GIT_COMMITTER_NAME=test \
EXCLUDED_TESTS="test_main or test_run_a_node_hook or test_run_versioned_node_hook or test_additional_node_dependencies_installed or test_node_hook_with_npm_userconfig_set"
EXCLUDED_TESTS="$EXCLUDED_TESTS or test_run_versioned_ruby_hook or test_run_ruby_hook_with_disable_shared_gems or test_additional_dependencies_roll_forward"
EXCLUDED_TESTS="$EXCLUDED_TESTS or test_golang or test_additional_ruby_ or test_additional_golang_ or test_additional_rust_ or test_rust"
EXCLUDED_TESTS="$EXCLUDED_TESTS or test_switch_language_versions_doesnt_clobber or test_run_a_ruby_hook or test_local_golang_additional_dependencies"
EXCLUDED_TESTS="$EXCLUDED_TESTS or test_switch_language_versions_doesnt_clobber or test_run_a_ruby_hook or test_local_golang_additional_deps"
EXCLUDED_TESTS="$EXCLUDED_TESTS or test_local_rust_additional_dependencies or test_installed_from_venv"
EXCLUDED_TESTS="$EXCLUDED_TESTS or conda or test_perl_hook or test_local_perl_additional_dependencies"
EXCLUDED_TESTS="$EXCLUDED_TESTS or dart or dotnet or r_ or node or ruby"
EXCLUDED_TESTS="$EXCLUDED_TESTS or test_local_lua_additional_dependencies"
# rust_tests use rustup which require network
EXCLUDED_TESTS="$EXCLUDED_TESTS or test_local_python_repo_python2 or rust_test"
# tests that require network access
EXCLUDED_TESTS="$EXCLUDED_TESTS or test_run_example_executable or test_run_dep or test_perl_additional_dependencies or test_lua_additional_dependencies"
# requires swift
EXCLUDED_TESTS="$EXCLUDED_TESTS or test_swift_language"
# Fix issue with git submodule in OBS
git config --global --add protocol.file.allow always
@@ -104,18 +103,14 @@ git init .
%post
%python_install_alternative pre-commit
%python_install_alternative pre-commit-validate-config
%python_install_alternative pre-commit-validate-manifest
%postun
%python_uninstall_alternative pre-commit
%python_uninstall_alternative pre-commit-validate-config
%python_uninstall_alternative pre-commit-validate-manifest
%files %{python_files}
%python_alternative %{_bindir}/pre-commit-validate-manifest
%license LICENSE
%doc CHANGELOG.md
%python_alternative %{_bindir}/pre-commit
%python_alternative %{_bindir}/pre-commit-validate-config
%{python_sitelib}/pre_commit
%{python_sitelib}/pre_commit-%{version}-py*.egg-info