15
0
forked from pool/python-cachey

- Convert to pip-based build

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cachey?expand=0&rev=10
This commit is contained in:
2025-05-15 15:18:13 +00:00
committed by Git OBS Bridge
commit 1faf7f207f
5 changed files with 137 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
cachey-0.2.1.tar.gz Normal file
View File

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

37
python-cachey.changes Normal file
View File

@@ -0,0 +1,37 @@
-------------------------------------------------------------------
Thu May 15 12:46:20 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build
-------------------------------------------------------------------
Thu Oct 13 07:13:58 UTC 2022 - Dirk Müller <dmueller@suse.com>
- use https for urls
-------------------------------------------------------------------
Mon Mar 30 09:17:57 UTC 2020 - Marketa Calabkova <mcalabkova@suse.com>
- Update to 0.2.1
* Change links to blaze org
* Fix Cache.clear()
* Add a resize method.
* make default data dict inside __init__
* test against 3.7 and 3.8, drop 2.7
- Drop upstreamed patch fix_cache_clear.patch
-------------------------------------------------------------------
Thu Jan 24 09:25:19 UTC 2019 - Jan Engelhardt <jengelh@inai.de>
- Use noun phrase in summary.
-------------------------------------------------------------------
Thu Jan 24 08:20:29 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Sort out a bit with spec-cleaner
-------------------------------------------------------------------
Mon May 22 19:12:01 UTC 2017 - toddrme2178@gmail.com
- Initial version
- Add fix_cache_clear.patch
Upstream patch to fix unit test error

73
python-cachey.spec Normal file
View File

@@ -0,0 +1,73 @@
#
# spec file for package python-cachey
#
# Copyright (c) 2025 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/
#
Name: python-cachey
Version: 0.2.1
Release: 0
Summary: A Python cache mindful of computation/storage costs
License: BSD-3-Clause
Group: Development/Languages/Python
URL: https://github.com/mrocklin/cachey/
Source: https://files.pythonhosted.org/packages/source/c/cachey/cachey-%{version}.tar.gz
BuildRequires: %{python_module HeapDict}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-HeapDict
BuildArch: noarch
%python_subpackages
%description
Cachey tries to hold on to values that have the following characteristics
1. Expensive to recompute (in seconds)
2. Cheap to store (in bytes)
3. Frequently used
4. Recenty used
It accomplishes this by adding the following to each items score on each access
score += compute_time / num_bytes * (1 + eps) ** tick_time
For some small value of epsilon (which determines the memory halflife). This
has units of inverse bandwidth, has exponential decay of old results and
roughly linear amplification of repeated results.
%prep
%setup -q -n cachey-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%pytest
%files %{python_files}
%license LICENSE.txt
%doc README.md
%{python_sitelib}/cachey
%{python_sitelib}/cachey-%{version}*-info
%changelog