Skip to content

Commit

Permalink
alvistack/1.26.4
Browse files Browse the repository at this point in the history
    git clean -xdf
    git submodule sync --recursive
    git submodule update --recursive --init
    git submodule foreach --recursive git checkout -- .
    tar zcvf ../python-numpy_1.26.4.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-numpy.spec ../python-numpy_1.26.4-1.spec
    cp ../python*-numpy*1.26.4*.{gz,xz,spec,dsc} /osc/home\:alvistack/numpy-numpy-1.26.4/
    rm -rf ../python*-numpy*1.26.4*.*

See numpy#22623
See pypa/setuptools#3705

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
  • Loading branch information
hswong3i committed Feb 24, 2024
1 parent 9815c16 commit ef5ded7
Show file tree
Hide file tree
Showing 19 changed files with 503 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -231,3 +231,5 @@ numpy/core/src/umath/loops_autovec.dispatch.c
# multiarray module
numpy/core/src/multiarray/argfunc.dispatch.c
numpy/core/src/multiarray/arraytypes.h

.pybuild/
24 changes: 24 additions & 0 deletions LICENSE.txt
Expand Up @@ -28,3 +28,27 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


The NumPy repository and source distributions bundle several libraries that are
compatibly licensed. We list these here.

Name: lapack-lite
Files: numpy/linalg/lapack_lite/*
License: BSD-3-Clause
For details, see numpy/linalg/lapack_lite/LICENSE.txt

Name: tempita
Files: tools/npy_tempita/*
License: MIT
For details, see tools/npy_tempita/license.txt

Name: dragon4
Files: numpy/core/src/multiarray/dragon4.c
License: MIT
For license text, see numpy/core/src/multiarray/dragon4.c

Name: libdivide
Files: numpy/core/include/numpy/libdivide/*
License: Zlib
For license text, see numpy/core/include/numpy/libdivide/LICENSE.txt
7 changes: 7 additions & 0 deletions debian/.gitignore
@@ -0,0 +1,7 @@
*.substvars
*debhelper*
.debhelper
files
python3-numpy
python-numpy-doc
tmp
5 changes: 5 additions & 0 deletions debian/changelog
@@ -0,0 +1,5 @@
python-numpy (100:1.26.4-1) UNRELEASED; urgency=medium

* https://github.com/numpy/numpy/releases/tag/v1.26.4

-- Wong Hoi Sing Edison <hswong3i@pantarei-design.com> Tue, 06 Feb 2024 15:01:31 +0800
53 changes: 53 additions & 0 deletions debian/control
@@ -0,0 +1,53 @@
Source: python-numpy
Section: python
Priority: optional
Standards-Version: 4.5.0
Maintainer: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
Homepage: https://github.com/numpy/numpy/tags
Vcs-Browser: https://github.com/alvistack/numpy-numpy
Vcs-Git: https://github.com/alvistack/numpy-numpy.git
Build-Depends:
debhelper,
debhelper-compat (= 10),
dh-python,
cython3,
fdupes,
gfortran,
liblapack-dev,
libopenblas-dev,
python3-dev,
python3-numpy <!nocheck>,
python3-setuptools,

Package: python3-numpy
Architecture: amd64
Description: Fast array facility to the Python 3 language
Numpy contains a powerful N-dimensional array object, sophisticated
(broadcasting) functions, tools for integrating C/C++ and Fortran code,
and useful linear algebra, Fourier transform, and random number
capabilities.
Depends:
${misc:Depends},
${shlibs:Depends},
python3,
python3-pkg-resources,
Suggests:
gcc,
gfortran,
python-numpy-doc,
python3-dev,
python3-pytest,
Provides:
${numpy3:Provides},
${python3:Provides},
dh-sequence-numpy3,
python3-f2py,
python3-numpy-dev,

Package: python-numpy-doc
Section: doc
Architecture: all
Description: NumPy documentation
This package contains documentation for Numpy and f2py.
Depends:
${misc:Depends},
21 changes: 21 additions & 0 deletions 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 <hswong3i@pantarei-design.com>
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".
58 changes: 58 additions & 0 deletions debian/dh_numpy3
@@ -0,0 +1,58 @@
#!/usr/bin/perl -w

# Copyright © 2010 Piotr Ożarowski <piotr@debian.org>
# Copyright © 2012 Jakub Wilk <jwilk@debian.org>
#
# 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.

use strict;
use Debian::Debhelper::Dh_Lib;

init(options => {
"strict" => \$dh{STRICT},
});

my %data;

open(FILE, '<', '/usr/share/numpy3/versions') or error("cannot read version data: $!\n");
while (<FILE>) {
chomp;
next unless /^[^#]/;
my ($key, $value) = split;
$data{$key} = $value;
}
close FILE;

unless ($data{'abi'} and $data{'api'} and $data{'api-min-version'}) {
error("cannot parse version data file");
}

foreach my $package (@{$dh{DOPACKAGES}}) {
my $numpy_dep;
if (package_arch($package) eq 'all') {
$numpy_dep = 'python3-numpy';
} elsif ($dh{STRICT}) {
$numpy_dep = "python3-numpy-api$data{'api'}";
} else {
$numpy_dep = "python3-numpy (>= $data{'api-min-version'}), python3-numpy-abi$data{'abi'}";
}
addsubstvar($package, "python3:Depends", $numpy_dep);
}

exit 0
15 changes: 15 additions & 0 deletions debian/dh_numpy3.1
@@ -0,0 +1,15 @@
.TH DH_NUMPY3 1 "2012-01-29" "Numpy"
.SH NAME
dh_numpy3 \- adds Numpy depends to python:Depends substvar
.SH SYNOPSIS
\fBdh_numpy3\fR [\fIdebhelper\ options\fR]
.SH DESCRIPTION
dh_numpy3 adds information about the correct versioned depends on python3-numpy to python3:Depends substvar.
.PP
This is needed because some Python extensions require strict versioned depends on python3-numpy, and using this helper script is the easiest and most consistent way to get them.
.PP
The helper script uses the information stored in /usr/share/numpy3/versions, and the architecture type of the package, to generate the Depends information; for a detailed description of how the dependencies are generated, please refer to /usr/share/doc/python3-numpy/README.DebianMaints .
.SH "SEE ALSO"
\fIdebhelper\fR(7)
.PP
This program is not a part of debhelper (and it's provided by python-numpy).
8 changes: 8 additions & 0 deletions debian/numpy3.pm
@@ -0,0 +1,8 @@
#!/usr/bin/perl
use warnings;
use strict;
use Debian::Debhelper::Dh_Lib;

insert_before("dh_gencontrol", "dh_numpy3");

1
3 changes: 3 additions & 0 deletions debian/python-numpy-doc.lintian-overrides
@@ -0,0 +1,3 @@
python-numpy-doc: copyright-without-copyright-notice
python-numpy-doc: initial-upload-closes-no-bugs
python-numpy-doc: zero-byte-file-in-doc-directory
5 changes: 5 additions & 0 deletions debian/python3-numpy.install
@@ -0,0 +1,5 @@
debian/dh_numpy3 usr/bin
debian/numpy3.pm usr/share/perl5/Debian/Debhelper/Sequence/
debian/versions usr/share/numpy3/
usr/bin/*
usr/lib/python*/*-packages/*
8 changes: 8 additions & 0 deletions debian/python3-numpy.lintian-overrides
@@ -0,0 +1,8 @@
python3-numpy: copyright-without-copyright-notice
python3-numpy: initial-upload-closes-no-bugs
python3-numpy: missing-prerequisite-for-gfortran-module
python3-numpy: no-manual-page
python3-numpy: python-module-in-wrong-location
python3-numpy: shared-library-lacks-prerequisites
python3-numpy: unusual-interpreter
python3-numpy: zero-byte-file-in-doc-directory
51 changes: 51 additions & 0 deletions debian/rules
@@ -0,0 +1,51 @@
#!/usr/bin/make -f

SHELL := /bin/bash

export DH_VERBOSE=1

PY3VERS=$(shell py3versions -vr)
PY3DEF=$(shell py3versions -dv)
PY3LIBPATH := $(shell python3 -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_platlib)")

# Look at #634012 to understand why is needed and what will happen if we set
# compat to 9
unexport LDFLAGS
export ATLAS=None

# https://github.com/numpy/numpy/pull/20695
export NPY_DISABLE_SVML=1

%:
dh $@ --with python3 --buildsystem=pybuild

override_dh_auto_clean:

override_dh_installman:
dh_installman -ppython-numpy-doc debian/dh_numpy3.1

override_dh_install:
# install numpy.i into the include directory
cp -a tools/swig/numpy.i debian/tmp/usr/lib/python$(PY3DEF)/dist-packages/numpy/core/include/numpy

dh_install

# create symlinks for .h files
set -e; for i in $(PY3DEF); do \
ABITAG=`python$$i -c "import sys; print(sys.abiflags)"`; \
[ -d $(CURDIR)/debian/python3-numpy/usr/include/python$$i$$ABITAG ] || \
mkdir -p $(CURDIR)/debian/python3-numpy/usr/include/python$$i$$ABITAG; \
dh_link -ppython3-numpy usr/lib/python3/dist-packages/numpy/core/include/numpy usr/include/python$$i$$ABITAG/numpy; \
done

override_dh_gencontrol:
python3 debian/versions3.helper >> debian/python3-numpy.substvars
dh_gencontrol

override_dh_auto_test:

override_dh_auto_install:
dh_auto_install

# Install for Python 3
python3 setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \
1 change: 1 addition & 0 deletions debian/source/format
@@ -0,0 +1 @@
3.0 (quilt)
5 changes: 5 additions & 0 deletions debian/source/lintian-overrides
@@ -0,0 +1,5 @@
python-numpy source: file-without-copyright-information
python-numpy source: no-debian-changes
python-numpy source: source-contains-prebuilt-windows-binary
python-numpy source: source-is-missing
python-numpy source: source-package-encodes-python-version
15 changes: 15 additions & 0 deletions debian/versions
@@ -0,0 +1,15 @@
# ABI version.
# This number must be changed every time C_ABI_VERSION changes.
# It's should be normally equal to C_ABI_VERSION - 0x1000000.
# Check numpy/core/setup_common.py
abi 9

# Minor API version.
# This number must be changed every time C_API_VERSION changes.
# It's should be normally equal to C_API_VERSION.
# Description of the changes at numpy/core/code_generators/cversions.txt
api 16

# Minimum version of Numpy that shares this minor API version.
# This version must be updated every time C_API_VERSION changes.
api-min-version 1:1.23.0
24 changes: 24 additions & 0 deletions debian/versions3.helper
@@ -0,0 +1,24 @@
#!/usr/bin/python

'''
Check if debian/versions is sane and generate substvars for numpy:Provides.
'''

import os

def main():
data = {}
file = open('debian/versions', 'r')
try:
for line in file:
line = line.strip()
if not line or line.startswith('#'):
continue
key, value = line.split(None, 1)
data[key] = value
finally:
file.close()
print('numpy3:Provides=python3-numpy-abi%s, python3-numpy-api%s' % (data['abi'], data['api']))

if __name__ == '__main__':
main()

0 comments on commit ef5ded7

Please sign in to comment.