New package needed for python-Mathics upgrade to version 8.0.0
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-stopit?expand=0&rev=1
This commit is contained in:
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal 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
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.osc
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Gilles Lenfant
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
15
python-stopit.changes
Normal file
15
python-stopit.changes
Normal file
@@ -0,0 +1,15 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 4 11:50:34 UTC 2025 - Atri Bhattacharya <badshah400@gmail.com>
|
||||
|
||||
- Switch to pyproject macros for build.
|
||||
- Add LICENSE and tests.py as additional sources.
|
||||
- Run tests as part of a %check section.
|
||||
- Improved package Summary and Description.
|
||||
- Fix License tag: MIT instead of GPL-3.0.
|
||||
- Drop outdated macro redefintions.
|
||||
- More fine-grained file list.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 13 09:54:14 AM UTC 2020 - John Vandenberg <jayvdb@gmail.com>
|
||||
|
||||
- Initial spec for v1.1.2
|
||||
66
python-stopit.spec
Normal file
66
python-stopit.spec
Normal file
@@ -0,0 +1,66 @@
|
||||
#
|
||||
# spec file for package python-stopit
|
||||
#
|
||||
# Copyright (c) 2025 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# 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 http://bugs.opensuse.org/
|
||||
|
||||
|
||||
%define modname stopit
|
||||
Name: python-stopit
|
||||
Version: 1.1.2
|
||||
Release: 0
|
||||
Summary: Timeout control decorator and context managers
|
||||
License: MIT
|
||||
URL: https://pypi.python.org/pypi/stopit
|
||||
Source0: https://files.pythonhosted.org/packages/source/s/stopit/stopit-%{version}.tar.gz
|
||||
Source1: https://raw.githubusercontent.com/glenfant/stopit/refs/tags/%{version}/tests.py
|
||||
Source2: https://raw.githubusercontent.com/glenfant/stopit/refs/tags/%{version}/LICENSE
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
BuildArch: noarch
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
%{name} is a python module that provides:
|
||||
* a function that raises an exception in another thread, including the main thread.
|
||||
* two context managers that may stop its inner block activity on timeout.
|
||||
* two decorators that may stop its decorated callables on timeout.
|
||||
|
||||
%prep
|
||||
%autosetup -n %{modname}-%{version}
|
||||
cp %{SOURCE1} %{SOURCE2} ./
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
%{python_expand export PYTHONDONTWRITEBYTECODE=1
|
||||
export PYTHONPATH=%{buildroot}%{$python_sitelib}
|
||||
$python tests.py
|
||||
}
|
||||
|
||||
%files %{python_files}
|
||||
%license LICENSE
|
||||
%doc CHANGES.rst README.rst
|
||||
%{python_sitelib}/%{modname}/
|
||||
%{python_sitelib}/%{modname}-%{version}*.*-info
|
||||
|
||||
%changelog
|
||||
3
stopit-1.1.2.tar.gz
Normal file
3
stopit-1.1.2.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f7f39c583fd92027bd9d06127b259aee7a5b7945c1f1fa56263811e1e766996d
|
||||
size 18281
|
||||
30
tests.py
Normal file
30
tests.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import doctest
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from stopit import ThreadingTimeout, threading_timeoutable, SignalTimeout, signal_timeoutable
|
||||
|
||||
# We run twice the same doctest with two distinct sets of globs
|
||||
# This one is for testing signals based timeout control
|
||||
signaling_globs = {
|
||||
'Timeout': SignalTimeout,
|
||||
'timeoutable': signal_timeoutable
|
||||
}
|
||||
|
||||
# And this one is for testing threading based timeout control
|
||||
threading_globs = {
|
||||
'Timeout': ThreadingTimeout,
|
||||
'timeoutable': threading_timeoutable
|
||||
}
|
||||
|
||||
|
||||
def suite(): # Func for setuptools.setup(test_suite=xxx)
|
||||
test_suite = unittest.TestSuite()
|
||||
test_suite.addTest(doctest.DocFileSuite('README.rst', globs=signaling_globs))
|
||||
if os.name == 'posix': # Other OS have no support for signal.SIGALRM
|
||||
test_suite.addTest(doctest.DocFileSuite('README.rst', globs=threading_globs))
|
||||
return test_suite
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.TextTestRunner(verbosity=2).run(suite())
|
||||
Reference in New Issue
Block a user