commit 1faf7f207f4bc8e0dc279ef42b1596a82f4fa68bd39e4915b6218298323c3151 Author: Dirk Mueller Date: Thu May 15 15:18:13 2025 +0000 - Convert to pip-based build OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cachey?expand=0&rev=10 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/cachey-0.2.1.tar.gz b/cachey-0.2.1.tar.gz new file mode 100644 index 0000000..03cb19f --- /dev/null +++ b/cachey-0.2.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0310ba8afe52729fa7626325c8d8356a8421c434bf887ac851e58dcf7cf056a6 +size 6461 diff --git a/python-cachey.changes b/python-cachey.changes new file mode 100644 index 0000000..bfdfd24 --- /dev/null +++ b/python-cachey.changes @@ -0,0 +1,37 @@ +------------------------------------------------------------------- +Thu May 15 12:46:20 UTC 2025 - Markéta Machová + +- Convert to pip-based build + +------------------------------------------------------------------- +Thu Oct 13 07:13:58 UTC 2022 - Dirk Müller + +- use https for urls + +------------------------------------------------------------------- +Mon Mar 30 09:17:57 UTC 2020 - Marketa Calabkova + +- 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 + +- Use noun phrase in summary. + +------------------------------------------------------------------- +Thu Jan 24 08:20:29 UTC 2019 - Tomáš Chvátal + +- 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 diff --git a/python-cachey.spec b/python-cachey.spec new file mode 100644 index 0000000..087aa0b --- /dev/null +++ b/python-cachey.spec @@ -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