diff --git a/.gitignore b/.gitignore index e4415579..9fb0ecf8 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ __pycache__/ /.mypy_cache /.venv* /wheelhouse +.pybuild diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 00000000..9af8d63b --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,6 @@ +*.substvars +*debhelper* +.debhelper +files +python3-immutables +tmp diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..27e07f30 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +python-immutables (100:0.20-1) UNRELEASED; urgency=medium + + * https://github.com/MagicStack/immutables/releases/tag/v0.20 + + -- Wong Hoi Sing Edison Mon, 01 Jan 2024 11:48:50 +0800 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..a7bd1efc --- /dev/null +++ b/debian/control @@ -0,0 +1,27 @@ +Source: python-immutables +Section: python +Priority: optional +Standards-Version: 4.5.0 +Maintainer: Wong Hoi Sing Edison +Homepage: https://github.com/MagicStack/immutables/tags +Vcs-Browser: https://github.com/alvistack/MagicStack-immutables +Vcs-Git: https://github.com/alvistack/MagicStack-immutables.git +Build-Depends: + debhelper, + debhelper-compat (= 10), + dh-python, + fdupes, + cython3, + python3-dev, + python3-setuptools, + +Package: python3-immutables +Architecture: amd64 +Description: Immutable Collections + An immutable mapping type for Python. +Depends: + ${misc:Depends}, + ${shlibs:Depends}, + ${python3:Depends}, + python3, + python3-typing-extensions (>= 3.7.4.3), diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..12900b41 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,21 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Files: debian/* +Copyright: 2024 Wong Hoi Sing Edison +License: Apache-2.0 + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + The complete text of the Apache version 2.0 license + can be found in "/usr/share/common-licenses/Apache-2.0". diff --git a/debian/python3-immutables.install b/debian/python3-immutables.install new file mode 100644 index 00000000..e3da3e75 --- /dev/null +++ b/debian/python3-immutables.install @@ -0,0 +1 @@ +usr/lib/python*/*-packages/* diff --git a/debian/python3-immutables.lintian-overrides b/debian/python3-immutables.lintian-overrides new file mode 100644 index 00000000..c573a6e8 --- /dev/null +++ b/debian/python3-immutables.lintian-overrides @@ -0,0 +1,4 @@ +python3-immutables: copyright-without-copyright-notice +python3-immutables: initial-upload-closes-no-bugs +python3-immutables: no-manual-page +python3-immutables: zero-byte-file-in-doc-directory diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..fcaa45ef --- /dev/null +++ b/debian/rules @@ -0,0 +1,15 @@ +#!/usr/bin/make -f + +SHELL := /bin/bash + +override_dh_auto_install: + dh_auto_install --destdir=debian/tmp + find debian/tmp/usr/lib/python*/*-packages -type f -name '*.pyc' -exec rm -rf {} \; + fdupes -qnrps debian/tmp/usr/lib/python*/*-packages + +override_dh_auto_test: + +override_dh_auto_clean: + +%: + dh $@ --buildsystem=pybuild --with python3 diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides new file mode 100644 index 00000000..93d1b9cf --- /dev/null +++ b/debian/source/lintian-overrides @@ -0,0 +1,5 @@ +python-immutables source: file-without-copyright-information +python-immutables source: no-debian-changes +python-immutables source: source-contains-prebuilt-windows-binary +python-immutables source: source-is-missing +python-immutables source: source-package-encodes-python-version diff --git a/immutables/_map.c b/immutables/_map.c index d3990aed..256f4677 100644 --- a/immutables/_map.c +++ b/immutables/_map.c @@ -1284,7 +1284,7 @@ map_node_bitmap_dump(MapNode_Bitmap *node, if (tmp1 == NULL) { goto error; } - tmp2 = _PyLong_Format(tmp1, 2); + tmp2 = PyNumber_ToBase(tmp1, 2); Py_DECREF(tmp1); if (tmp2 == NULL) { goto error; diff --git a/python-immutables.spec b/python-immutables.spec new file mode 100644 index 00000000..13782e9b --- /dev/null +++ b/python-immutables.spec @@ -0,0 +1,90 @@ +# Copyright 2024 Wong Hoi Sing Edison +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +%global debug_package %{nil} + +%global source_date_epoch_from_changelog 0 + +Name: python-immutables +Epoch: 100 +Version: 0.20 +Release: 1%{?dist} +Summary: Immutable Collections +License: Apache-2.0 +URL: https://github.com/MagicStack/immutables/tags +Source0: %{name}_%{version}.orig.tar.gz +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildRequires: python3-Cython3 +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +%description +An immutable mapping type for Python. + +%prep +%autosetup -T -c -n %{name}_%{version}-%{release} +tar -zx -f %{S:0} --strip-components=1 -C . + +%build +%py3_build + +%install +%py3_install +find %{buildroot}%{python3_sitearch} -type f -name '*.pyc' -exec rm -rf {} \; +fdupes -qnrps %{buildroot}%{python3_sitearch} + +%check + +%if 0%{?suse_version} > 1500 +%package -n python%{python3_version_nodots}-immutables +Summary: Immutable Collections +Requires: python3 +Requires: python3-typing-extensions >= 3.7.4.3 +Provides: python3-immutables = %{epoch}:%{version}-%{release} +Provides: python3dist(immutables) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}-immutables = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}dist(immutables) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}-immutables = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}dist(immutables) = %{epoch}:%{version}-%{release} + +%description -n python%{python3_version_nodots}-immutables +An immutable mapping type for Python. + +%files -n python%{python3_version_nodots}-immutables +%license LICENSE +%{python3_sitearch}/* +%endif + +%if !(0%{?suse_version} > 1500) +%package -n python3-immutables +Summary: Immutable Collections +Requires: python3 +Requires: python3-typing-extensions >= 3.7.4.3 +Provides: python3-immutables = %{epoch}:%{version}-%{release} +Provides: python3dist(immutables) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}-immutables = %{epoch}:%{version}-%{release} +Provides: python%{python3_version}dist(immutables) = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}-immutables = %{epoch}:%{version}-%{release} +Provides: python%{python3_version_nodots}dist(immutables) = %{epoch}:%{version}-%{release} + +%description -n python3-immutables +An immutable mapping type for Python. + +%files -n python3-immutables +%license LICENSE +%{python3_sitearch}/* +%endif + +%changelog