commit a1e16fa0c48e2fa32087dc36bfb8b7b6778a8c1cecc3969d635eed5c0a1fd27f Author: Markéta Machová Date: Tue Apr 2 12:53:25 2024 +0000 Accepting request 1163595 from home:bnavigator:branches:devel:languages:python Required for testing python-pycrdt (Jupyter Collaboration) OBS-URL: https://build.opensuse.org/request/show/1163595 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-objsize?expand=0&rev=1 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/objsize-0.7.0-gh.tar.gz b/objsize-0.7.0-gh.tar.gz new file mode 100644 index 0000000..2514cbb --- /dev/null +++ b/objsize-0.7.0-gh.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:667956e07034d4a36b15e6d76910964aadbec249ca3f54988a071b43152d9faa +size 20419 diff --git a/python-objsize.changes b/python-objsize.changes new file mode 100644 index 0000000..0fdc237 --- /dev/null +++ b/python-objsize.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Fri Mar 29 19:26:12 UTC 2024 - Ben Greiner + +- Initial specfile for v0.7.0 +- Required for testing python-pycrdt (Jupyter Collaboration) diff --git a/python-objsize.spec b/python-objsize.spec new file mode 100644 index 0000000..568aea6 --- /dev/null +++ b/python-objsize.spec @@ -0,0 +1,69 @@ +# +# spec file for package python-objsize +# +# 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/ +# + + +Name: python-objsize +Version: 0.7.0 +Release: 0 +Summary: Calculate the size of Python's objects subtree in bytes (deep size) +License: BSD-3-Clause +URL: https://github.com/liran-funaro/objsize +Source: https://github.com/liran-funaro/objsize/archive/refs/tags/%{version}.tar.gz#/objsize-%{version}-gh.tar.gz +BuildRequires: %{python_module base >= 3.7} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools >= 61.0.0} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +# SECTION test +BuildRequires: %{python_module PyYAML} +BuildRequires: %{python_module pytest} +# /SECTION +%python_subpackages + +%description +Traversal over Python's objects subtree and calculate the total size of the subtree in bytes (deep size). + +The objsize Python package allows for the exploration and measurement of an object's complete memory usage +in bytes, including its child objects. This process, often referred to as deep size calculation, is achieved +through Python's internal Garbage Collection (GC) mechanism. + +The objsize package is designed to ignore shared objects, such as None, types, modules, classes, functions, +and lambdas, because they are shared across many instances. One of the key performance features of objsize +is that it avoids recursive calls, ensuring a faster and safer execution. + +%prep +%autosetup -p1 -n objsize-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%doc README.md +%license LICENSE +%{python_sitelib}/objsize +%{python_sitelib}/objsize-%{version}.dist-info + +%changelog