- update to 3.2.2:

* Fixed crash when running mutmut results
  * Read paths_to_mutate from config file
  * Mutate break to return to avoid timeouts
  * Added debug mode. Enable with debug=True in setup.cfg under
    [mutmut]
  * Fixed new test detection. The old code incorrectly detected
    new tests when there were none, creating a much slower
    interaction loop for fixing mutants.
  * And many more fixes
  * Timeouts for mutants implemented.
  * Browser: syntax highlighting for diff view
  * More fixes for generators.
  * Fix for src-style layout of projects.
  * Fixed bug where mutmut would recollect all tests on every
    run, slowing down startup.
  * Correctly handle mutation for generator functions (yield).
  * Fixed so that from __future__ lines are always first.
  * If no stats are collected exit directly, as that is a
    breaking error for mutation testing.
  * Changed name mangling to make mutants less likely to trigger
    name-based python magic, like in pytest where functions named
    test_* have special meaning.
  * Another attempt to get the pypi package to work
  * Another attempt to get the pypi package to work
  * Fixed missing requirement in install package
  * Fixed missing file from the install package
  * Fixed bad entrypoint definition
  * Ignore files that can't be parsed by parso
  * Missed a file in distribution, so browse command was broken.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mutmut?expand=0&rev=15
This commit is contained in:
Dirk Mueller 2024-11-21 10:12:29 +00:00 committed by Git OBS Bridge
commit fbf8a8c928
7 changed files with 263 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

3
2.0.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9302546f4f1f64544d3f4839712a8ea4c82ed557ac6138d49d8ba328e12c0fb2
size 46395

3
3.2.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d4297aa53cd223e6b29afd3ea9a26762497d62d52afc6a41e3c8cfba1e575e17
size 570921

38
pr_134.patch Normal file
View File

@ -0,0 +1,38 @@
From bd3866316949f8ba7162e0292be0776d6f51cf50 Mon Sep 17 00:00:00 2001
From: Maxime Lapointe <hunter_spawn@hotmail.com>
Date: Tue, 23 Jul 2019 08:55:15 -0400
Subject: [PATCH] Use sys.executable as default python executable
It's more likely to be the correct Python executable in case where someone specified the executable when running mutmut.
---
mutmut/__main__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: mutmut-2.0.0/mutmut/__main__.py
===================================================================
--- mutmut-2.0.0.orig/mutmut/__main__.py 2020-03-26 09:45:09.000000000 +0100
+++ mutmut-2.0.0/mutmut/__main__.py 2020-03-30 16:01:03.781625630 +0200
@@ -101,7 +101,7 @@ null_out = open(os.devnull, 'w')
@config_from_setup_cfg(
dict_synonyms='',
paths_to_exclude='',
- runner='python -m pytest -x --assert=plain',
+ runner='"' + sys.executable + '" -m pytest -x',
tests_dir='tests/:test/',
pre_mutation=None,
post_mutation=None,
Index: mutmut-2.0.0/tests/test_main.py
===================================================================
--- mutmut-2.0.0.orig/tests/test_main.py 2020-03-26 09:45:09.000000000 +0100
+++ mutmut-2.0.0/tests/test_main.py 2020-03-30 16:03:15.066124033 +0200
@@ -94,8 +94,8 @@ def create_filesystem(tmpdir, file_to_mu
with open(join(test_dir, 'setup.cfg'), 'w') as f:
f.write("""
[mutmut]
-runner=python -m hammett -x
-""")
+runner={} -m hammett -x
+""".format(sys.executable))
with open(join(test_dir, "foo.py"), 'w') as f:
f.write(file_to_mutate_contents)

100
python-mutmut.changes Normal file
View File

@ -0,0 +1,100 @@
-------------------------------------------------------------------
Thu Nov 21 10:11:34 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 3.2.2:
* Fixed crash when running mutmut results
* Read paths_to_mutate from config file
* Mutate break to return to avoid timeouts
* Added debug mode. Enable with debug=True in setup.cfg under
[mutmut]
* Fixed new test detection. The old code incorrectly detected
new tests when there were none, creating a much slower
interaction loop for fixing mutants.
* And many more fixes
* Timeouts for mutants implemented.
* Browser: syntax highlighting for diff view
* More fixes for generators.
* Fix for src-style layout of projects.
* Fixed bug where mutmut would recollect all tests on every
run, slowing down startup.
* Correctly handle mutation for generator functions (yield).
* Fixed so that from __future__ lines are always first.
* If no stats are collected exit directly, as that is a
breaking error for mutation testing.
* Changed name mangling to make mutants less likely to trigger
name-based python magic, like in pytest where functions named
test_* have special meaning.
* Another attempt to get the pypi package to work
* Another attempt to get the pypi package to work
* Fixed missing requirement in install package
* Fixed missing file from the install package
* Fixed bad entrypoint definition
* Ignore files that can't be parsed by parso
* Missed a file in distribution, so browse command was broken.
* Execution model switched to mutation schemata, which enabled
parallell execution.
* New terminal UI
* Pytest only, which enabled better integration, cutting
execution time significantly.
- drop pr_134.patch (upstream)
-------------------------------------------------------------------
Thu Mar 14 10:02:38 UTC 2024 - Dirk Müller <dmueller@suse.com>
- skip building for 3.12
-------------------------------------------------------------------
Thu Mar 24 10:46:05 UTC 2022 - pgajdos@suse.com
- python-mock is not required for build
-------------------------------------------------------------------
Tue Feb 2 13:29:40 UTC 2021 - Dirk Müller <dmueller@suse.com>
- skip python 3.6 (hammett requires python 3.7 or later)
-------------------------------------------------------------------
Mon May 25 06:50:55 UTC 2020 - Petr Gajdos <pgajdos@suse.com>
- %python3_only -> %python_alternative
-------------------------------------------------------------------
Mon Mar 30 14:06:25 UTC 2020 - pgajdos@suse.com
- version update to 2.0.0
* New execution model. This should result in some modest speed improvements when using pytest.
* A special execution mode when using the hammett test runner. This is MUCH MUCH faster. Please try it!
* Dropped support for python < 3.7. If you need to use mutmut on older versions of python, please use mutmut 1.9.0
* Some other speed improvements.
* `mutmut run 7` will always rerun the mutant `7`
* `mutmut show <filename>` to show all mutants for that file
* `mutmut run <filename>` to run mutation testing on that file
* New experimental plugin system: create a file `mutmut_config.py` in your base directory. In it you can have an `init()` function, and a `pre_mutation(context)` function. You can set `context.skip = True` to skip a mutant, and you can modify `context.config.runner`, this is useful to limit the tests. Check out the `Context` class for what information you get.
* Better display of `mutmut show`/`mutmut result`
* Fixed a spurious mutant on assigning a local variable with type annotations
* mutmut now will rerun tests without mutation when tests have changed. This avoids a common pitfall of introducing a failing test and then having all mutants killed incorrectly
* Added `mutmut html` report generation.
* Bugfix for multiple assignment. Mutmut used to not handle `foo = bar = baz` correctly (Thanks Roxane Bellot!)
* Bugfix for incorrect mutation of "in" operator (Thanks Roxane Bellot!)
* Fixed bug where a mutant survived in the internal AST too long. This could cause mutmut to apply more than one mutant at a time.
* Vastly improved startup performance when resuming a mutation run.
* Added new experimental feature for advanced config at runtime of mutations
- modified patches
% pr_134.patch (extended)
- deleted patches
- no-direct-python-call.patch (merged to pr_134.patch)
-------------------------------------------------------------------
Tue Oct 15 07:51:17 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Update to 1.6.0:
* Various minor fixes around in the package
- Remove merged patches pr_148.patch merged_4405bafe.patch
- Rebase patch pr_134.patch
- Add patch no-direct-python-call.patch to avoid direct calls
to python binary
-------------------------------------------------------------------
Wed Aug 7 03:15:06 AM UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Initial spec for v1.5.1

95
python-mutmut.spec Normal file
View File

@ -0,0 +1,95 @@
#
# spec file for package python-mutmut
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
Name: python-mutmut
Version: 3.2.2
Release: 0
Summary: Python mutation testing
License: BSD-3-Clause
URL: https://github.com/boxed/mutmut
Source: https://github.com/boxed/mutmut/archive/%{version}.tar.gz
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-click
Requires: python-hammett
Requires: python-junit-xml >= 1.8
Requires: python-parso
Requires: python-rich
Requires: python-setproctitle
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: python-coverage
Recommends: python-pytest
Suggests: python-pytest-cov
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module click}
BuildRequires: %{python_module coverage}
BuildRequires: %{python_module hammett}
BuildRequires: %{python_module junit-xml >= 1.8}
BuildRequires: %{python_module parso}
BuildRequires: %{python_module pytest >= 2.8.7}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module rich}
BuildRequires: %{python_module setproctitle}
BuildRequires: %{python_module whatthepatch >= 0.0.5}
BuildRequires: ed
BuildRequires: patch
# /SECTION
%python_subpackages
%description
Python mutation testing.
%prep
%setup -q -n mutmut-%{version}
%autopatch -p1
sed -i 's/==/>=/' *requirements.txt
# Remove maximum pins any anything that follows
sed -Ei 's/,?<=?.*$//' test_requirements.txt
sed -i '1{/^#!/d}' mutmut/__main__.py
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/mutmut
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest
%post
%python_install_alternative mutmut
%postun
%python_uninstall_alternative mutmut
%files %{python_files}
%doc README.rst
%license LICENSE
%python_alternative %{_bindir}/mutmut
%{python_sitelib}/mutmut
%{python_sitelib}/mutmut-%{version}.dist-info
%changelog