pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

yet another attempt at import a package i need



Module Name:	pkgsrc-wip
Committed By:	Joe Mifsud <lntl%disroot.org@localhost>
Pushed By:	lntl
Date:		Mon Apr 12 10:46:59 2021 +0000
Changeset:	d4b65d92c16323407fcb306c1e2e80323318e99f

Modified Files:
	py-murmurhash/Makefile
	py-preshed/Makefile
	py-preshed/PLIST
	py-preshed/buildlink3.mk
	py-spacy/Makefile
	py-spacy/distinfo
	py-thinc/TODO
	py-wasabi/Makefile
Added Files:
	py-cython-blis/DESCR
	py-cython-blis/Makefile
	py-cython-blis/PLIST
	py-cython-blis/distinfo

Log Message:
yet another attempt at import a package i need

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d4b65d92c16323407fcb306c1e2e80323318e99f

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 py-cython-blis/DESCR     | 145 +++++++++++++++++++++++++++++++++++++++++++++++
 py-cython-blis/Makefile  |  19 +++++++
 py-cython-blis/PLIST     |  33 +++++++++++
 py-cython-blis/distinfo  |   6 ++
 py-murmurhash/Makefile   |   4 +-
 py-preshed/Makefile      |   6 +-
 py-preshed/PLIST         |  12 ++--
 py-preshed/buildlink3.mk |  16 +++---
 py-spacy/Makefile        |  19 +++----
 py-spacy/distinfo        |   8 +--
 py-thinc/TODO            |   6 +-
 py-wasabi/Makefile       |   2 +-
 12 files changed, 239 insertions(+), 37 deletions(-)

diffs:
diff --git a/py-cython-blis/DESCR b/py-cython-blis/DESCR
new file mode 100644
index 0000000000..0ce2a821dc
--- /dev/null
+++ b/py-cython-blis/DESCR
@@ -0,0 +1,145 @@
+# Cython BLIS: Fast BLAS-like operations from Python and Cython,
+without the tears
+
+This repository provides the [Blis linear
+algebra](https://github.com/flame/blis) routines as a self-contained
+Python C-extension.
+
+Currently, we only supports single-threaded execution, as this is
+actually best for our workloads (ML inference).
+
+[![Azure
+Pipelines](https://img.shields.io/azure-devops/build/explosion-ai/public/6/master.svg?logo=azure-pipelines&style=flat-square)](https://dev.azure.com/explosion-ai/public/_build?definitionId=6)
+[![pypi
+Version](https://img.shields.io/pypi/v/blis.svg?style=flat-square&logo=pypi&logoColor=white)](https://pypi.python.org/pypi/blis)
+[![conda](https://img.shields.io/conda/vn/conda-forge/cython-blis.svg?style=flat-square&logo=conda-forge&logoColor=white)](https://anaconda.org/conda-forge/cython-blis)
+[![Python
+wheels](https://img.shields.io/badge/wheels-%E2%9C%93-4c1.svg?longCache=true&style=flat-square&logo=python&logoColor=white)](https://github.com/explosion/wheelwright/releases)
+
+## Installation
+
+You can install the package via pip, first making sure that `pip`,
+`setuptools`, and `wheel` are up-to-date:
+
+```bash pip install -U pip setuptools wheel pip install blis ```
+
+Wheels should be available, so installation should be fast. If you
+want to install from source and you're on Windows, you'll need to
+install LLVM.
+
+### Building BLIS for alternative architectures
+
+The provided wheels should work on x86_64 architectures. Unfortunately
+we do not currently know a way to provide different wheels for
+alternative architectures, and we cannot provide a single binary
+that works everywhere. So if the wheel doesn't work for your CPU,
+you'll need to specify source distribution, and tell Blis your CPU
+architecture using the `BLIS_ARCH` environment variable.
+
+#### a) Installing with generic arch support
+
+```bash BLIS_ARCH="generic" pip install spacy --no-binary blis ```
+
+#### b) Building specific support
+
+In order to compile Blis, `cython-blis` bundles makefile scripts
+for specific architectures, that are compiled by running the Blis
+build system and logging the commands. We do not yet have logs for
+every architecture, as there are some architectures we have not
+had access to.
+
+[See here](https://github.com/flame/blis/blob/0.5.1/config_registry)
+for list of architectures. For example, here's how to build support
+for the ARM architecture `cortexa57`:
+
+```bash git clone https://github.com/explosion/cython-blis && cd
+cython-blis git pull && git submodule init && git submodule update
+&& git submodule status python3 -m venv env3.6 source env3.6/bin/activate
+pip install -r requirements.txt
+./bin/generate-make-jsonl linux cortexa57
+BLIS_ARCH="cortexa57" python setup.py build_ext --inplace
+BLIS_ARCH="cortexa57" python setup.py bdist_wheel ```
+
+Fingers crossed, this will build you a wheel that supports your
+platform. You could then [submit a
+PR](https://github.com/explosion/cython-blis/pulls) with the
+`blis/_src/make/linux-cortexa57.jsonl` and
+`blis/_src/include/linux-cortexa57/blis.h` files so that you can
+run:
+
+```bash BLIS_ARCH=cortexa57 pip install --no-binary=blis ```
+
+## Usage
+
+Two APIs are provided: a high-level Python API, and direct
+[Cython](http://cython.org) access, which provides fused-type,
+nogil Cython bindings to the underlying Blis linear algebra library.
+Fused types are a simple template mechanism, allowing just a touch
+of compile-time generic programming:
+
+```python cimport blis.cy A = <float*>calloc(nN * nI, sizeof(float))
+B = <float*>calloc(nO * nI, sizeof(float)) C = <float*>calloc(nr_b0
+* nr_b1, sizeof(float)) blis.cy.gemm(blis.cy.NO_TRANSPOSE,
+blis.cy.NO_TRANSPOSE,
+	     nO, nI, nN, 1.0, A, nI, 1, B, nO, 1, 1.0, C, nO, 1)
+```
+
+Bindings have been added as we've needed them. Please submit pull
+requests if the library is missing some functions you require.
+
+## Development
+
+To build the source package, you should run the following command:
+
+```bash
+./bin/update-vendored-source
+```
+
+This populates the `blis/_src` folder for the various architectures,
+using the `flame-blis` submodule.
+
+## Updating the build files
+
+In order to compile the Blis sources, we use jsonl files that
+provide the explicit compiler flags. We build these jsonl files by
+running Blis's build system, and then converting the log. This
+avoids us having to replicate the build system within Python: we
+just use the jsonl to make a bunch of subprocess calls. To support
+a new OS/architecture combination, we have to provide the jsonl
+file and the header.
+
+### Linux
+
+The Linux build files need to be produced from within the manylinux1
+docker container, so that they will be compatible with the wheel
+building process.
+
+First, install docker. Then do the following to start the container:
+
+    sudo docker run -it quay.io/pypa/manylinux1_x86_64:latest
+
+Once within the container, the following commands should check out
+the repo and build the jsonl files for the generic arch:
+
+    mkdir /usr/local/repos cd /usr/local/repos git clone
+    https://github.com/explosion/cython-blis && cd cython-blis git
+    pull && git submodule init && git submodule update && git
+    submodule status /opt/python/cp36-cp36m/bin/python -m venv
+    env3.6 source env3.6/bin/activate pip install -r requirements.txt
+    ./bin/generate-make-jsonl linux generic --export
+    BLIS_ARCH=generic python setup.py build_ext --inplace # N.B.:
+    don't copy to /tmp, docker cp doesn't work from there.  cp
+    blis/_src/include/linux-generic/blis.h /linux-generic-blis.h
+    cp blis/_src/make/linux-generic.jsonl /
+
+Then from a new terminal, retrieve the two files we need out of
+the container:
+
+    sudo docker ps -l # Get the container ID # When I'm in Vagrant,
+    I need to go via cat -- but then I end up with dummy # lines
+    at the top and bottom. Sigh. If you don't have that problem
+    and # sudo docker cp just works, just copy the file.  sudo
+    docker cp aa9d42588791:/linux-generic-blis.h - | cat >
+    linux-generic-blis.h sudo docker cp aa9d42588791:/linux-generic.jsonl
+    - | cat > linux-generic.jsonl
+
diff --git a/py-cython-blis/Makefile b/py-cython-blis/Makefile
new file mode 100644
index 0000000000..d03845dfdb
--- /dev/null
+++ b/py-cython-blis/Makefile
@@ -0,0 +1,19 @@
+# $NetBSD$
+
+DISTNAME=	${GITHUB_PROJECT}-v0.7.0
+PKGNAME=	${DISTNAME}
+PKGREVISION=	1
+CATEGORIES=	math
+MASTER_SITES=	${MASTER_SITE_GITHUB:=explosion/}
+GITHUB_PROJECT=	cython-blis
+
+MAINTAINER=	lntl%disroot.org@localhost
+HOMEPAGE=	https://github.com/explosion/cython-blis/
+COMMENT=	Blis linear algebra routines as a self-contained Python C-extension
+LICENSE=	modified-bsd
+
+WRKSRC=	${WRKDIR}/${PKGNAME_NOREV:S/v//1}
+
+# url2pkg-marker (please do not remove this line.)
+.include	"../../lang/python/distutils.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/py-cython-blis/PLIST b/py-cython-blis/PLIST
new file mode 100644
index 0000000000..f6eb49ea87
--- /dev/null
+++ b/py-cython-blis/PLIST
@@ -0,0 +1,33 @@
+@comment $NetBSD$
+${PYSITELIB}/blis-0.7.0-py${PYVERSSUFFIX}.egg-info/PKG-INFO
+${PYSITELIB}/blis-0.7.0-py${PYVERSSUFFIX}.egg-info/SOURCES.txt
+${PYSITELIB}/blis-0.7.0-py${PYVERSSUFFIX}.egg-info/dependency_links.txt
+${PYSITELIB}/blis-0.7.0-py${PYVERSSUFFIX}.egg-info/requires.txt
+${PYSITELIB}/blis-0.7.0-py${PYVERSSUFFIX}.egg-info/top_level.txt
+${PYSITELIB}/blis/__init__.pxd
+${PYSITELIB}/blis/__init__.py
+${PYSITELIB}/blis/__init__.pyc
+${PYSITELIB}/blis/__init__.pyo
+${PYSITELIB}/blis/about.py
+${PYSITELIB}/blis/about.pyc
+${PYSITELIB}/blis/about.pyo
+${PYSITELIB}/blis/benchmark.py
+${PYSITELIB}/blis/benchmark.pyc
+${PYSITELIB}/blis/benchmark.pyo
+${PYSITELIB}/blis/cy.pxd
+${PYSITELIB}/blis/cy.pyx
+${PYSITELIB}/blis/cy.so
+${PYSITELIB}/blis/py.pyx
+${PYSITELIB}/blis/py.so
+${PYSITELIB}/blis/tests/__init__.py
+${PYSITELIB}/blis/tests/__init__.pyc
+${PYSITELIB}/blis/tests/__init__.pyo
+${PYSITELIB}/blis/tests/common.py
+${PYSITELIB}/blis/tests/common.pyc
+${PYSITELIB}/blis/tests/common.pyo
+${PYSITELIB}/blis/tests/test_dotv.py
+${PYSITELIB}/blis/tests/test_dotv.pyc
+${PYSITELIB}/blis/tests/test_dotv.pyo
+${PYSITELIB}/blis/tests/test_gemm.py
+${PYSITELIB}/blis/tests/test_gemm.pyc
+${PYSITELIB}/blis/tests/test_gemm.pyo
diff --git a/py-cython-blis/distinfo b/py-cython-blis/distinfo
new file mode 100644
index 0000000000..c5f7f27641
--- /dev/null
+++ b/py-cython-blis/distinfo
@@ -0,0 +1,6 @@
+$NetBSD$
+
+SHA1 (cython-blis-v0.7.0.tar.gz) = 06f782067bee4534fb9186741d7e3dd8a44dbed1
+RMD160 (cython-blis-v0.7.0.tar.gz) = ab6f54b7aa38f185e0edc3e4be4f5b125a7fdb6c
+SHA512 (cython-blis-v0.7.0.tar.gz) = 6ba22d1b924bf5a2238bcf0fb9ae33fd3668badc336201ea2385f633a827497dd5a7a420b729ed6f34f2ce64cfa2e029d64ee49c6219f6ef7056c083f594a690
+Size (cython-blis-v0.7.0.tar.gz) = 2728904 bytes
diff --git a/py-murmurhash/Makefile b/py-murmurhash/Makefile
index 74d277485a..66b25e8b37 100644
--- a/py-murmurhash/Makefile
+++ b/py-murmurhash/Makefile
@@ -1,7 +1,7 @@
 # $NetBSD$
 
 DISTNAME=	murmurhash-v1.0.1
-PKGNAME=	${DISTNAME}
+PKGNAME=	${PYPKGPREFIX}-${DISTNAME}
 PKGREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	${MASTER_SITE_GITHUB:=explosion/}
@@ -11,7 +11,7 @@ HOMEPAGE=	https://github.com/explosion/murmurhash/
 COMMENT=	TODO: Short description of the package
 LICENSE=	mit
 
-WRKSRC=	${WRKDIR}/${PKGNAME_NOREV:S/v//1}
+WRKSRC=	${WRKDIR}/${DISTNAME:S/v//1}
 USE_LANGUAGES= c c++
 
 
diff --git a/py-preshed/Makefile b/py-preshed/Makefile
index a555f1932b..4e8625c5f8 100644
--- a/py-preshed/Makefile
+++ b/py-preshed/Makefile
@@ -2,7 +2,7 @@
 
 
 DISTNAME=	preshed-v2.0.0
-PKGNAME=	${DISTNAME:S/v//1}
+PKGNAME=	${PYPKGPREFIX}-${DISTNAME:S/v//1}
 PKGREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	${MASTER_SITE_GITHUB:=explosion/}
@@ -10,11 +10,11 @@ GITHUB_PROJECT=	preshed
 
 MAINTAINER=	lntl%disroot.org@localhost
 HOMEPAGE=	https://github.com/explosion/preshed/
-COMMENT=	Short description of the package
+COMMENT=	Cython hash table mapping
 LICENSE=	mit
 
 
-WRKSRC=		${WRKDIR}/${PKGNAME_NOREV}
+WRKSRC=		${WRKDIR}/${DISTNAME:S/v//1}
 USE_LANGUAGES=	c c++
 
 
diff --git a/py-preshed/PLIST b/py-preshed/PLIST
index 41243fe791..577e58a0a4 100644
--- a/py-preshed/PLIST
+++ b/py-preshed/PLIST
@@ -1,10 +1,10 @@
 @comment $NetBSD$
-${PYSITELIB}/${PKGNAME}-py${PYVERSSUFFIX}.egg-info/PKG-INFO
-${PYSITELIB}/${PKGNAME}-py${PYVERSSUFFIX}.egg-info/SOURCES.txt
-${PYSITELIB}/${PKGNAME}-py${PYVERSSUFFIX}.egg-info/dependency_links.txt
-${PYSITELIB}/${PKGNAME}-py${PYVERSSUFFIX}.egg-info/not-zip-safe
-${PYSITELIB}/${PKGNAME}-py${PYVERSSUFFIX}.egg-info/requires.txt
-${PYSITELIB}/${PKGNAME}-py${PYVERSSUFFIX}.egg-info/top_level.txt
+${PYSITELIB}/preshed-${PKGVERSION}-py${PYVERSSUFFIX}.egg-info/PKG-INFO
+${PYSITELIB}/preshed-${PKGVERSION}-py${PYVERSSUFFIX}.egg-info/SOURCES.txt
+${PYSITELIB}/preshed-${PKGVERSION}-py${PYVERSSUFFIX}.egg-info/dependency_links.txt
+${PYSITELIB}/preshed-${PKGVERSION}-py${PYVERSSUFFIX}.egg-info/not-zip-safe
+${PYSITELIB}/preshed-${PKGVERSION}-py${PYVERSSUFFIX}.egg-info/requires.txt
+${PYSITELIB}/preshed-${PKGVERSION}-py${PYVERSSUFFIX}.egg-info/top_level.txt
 ${PYSITELIB}/preshed/__init__.pxd
 ${PYSITELIB}/preshed/__init__.py
 ${PYSITELIB}/preshed/__init__.pyc
diff --git a/py-preshed/buildlink3.mk b/py-preshed/buildlink3.mk
index d8ed778c20..d307c2f0b3 100644
--- a/py-preshed/buildlink3.mk
+++ b/py-preshed/buildlink3.mk
@@ -1,13 +1,13 @@
 # $NetBSD$
-BUILDLINK_DEPMETHOD.preshed?=	build
+BUILDLINK_DEPMETHOD.py38-preshed?=	build
 
-BUILDLINK_TREE+=	preshed
+BUILDLINK_TREE+=	py38-preshed
 
-.if !defined(PRESHED_BUILDLINK3_MK)
-PRESHED_BUILDLINK3_MK:=
+.if !defined(PY38_PRESHED_BUILDLINK3_MK)
+PY38_PRESHED_BUILDLINK3_MK:=
 
-BUILDLINK_API_DEPENDS.preshed+=	preshed>=2.0.0nb1
-BUILDLINK_PKGSRCDIR.preshed?=	../../wip/py-preshed
-.endif	# PRESHED_BUILDLINK3_MK
+BUILDLINK_API_DEPENDS.py38-preshed+=	py38-preshed>=2.0.0nb1
+BUILDLINK_PKGSRCDIR.py38-preshed?=	../../wip/py-preshed
+.endif	# PY38_PRESHED_BUILDLINK3_MK
 
-BUILDLINK_TREE+=	-preshed
+BUILDLINK_TREE+=	-py38-preshed
diff --git a/py-spacy/Makefile b/py-spacy/Makefile
index f920164dbd..50a213573a 100644
--- a/py-spacy/Makefile
+++ b/py-spacy/Makefile
@@ -1,27 +1,26 @@
 # $NetBSD$
 
-GITHUB_PROJECT=	spaCy
-PKGVERSION=	3.0.5
-DISTNAME=	${GITHUB_PROJECT}-v${PKGVERSION}
-
-
+DISTNAME=	spaCy-v3.0.5
+PKGNAME=	${PYPKGPREFIX}-${DISTNAME}
+PKGREVISION=	1
 CATEGORIES=	math
 MASTER_SITES=	${MASTER_SITE_GITHUB:=explosion/}
-DIST_SUBDIR=	${GITHUB_PROJECT}-${PKGVERSION}
-WRKSRC=	${WRKDIR}/${GITHUB_PROJECT}-${PKGVERSION}
+WRKSRC=	${WRKDIR}/${DISTNAME:S/v//1}
 
 MAINTAINER=	lntl%disroot.org@localhost
 HOMEPAGE=	https://github.com/explosion/spaCy/
 COMMENT=	Short description of the package
 LICENSE=	mit
 
-USE_TOOLS+=     gmake perl:run pkg-config
+USE_TOOLS+=     gmake 
 
-# url2pkg-marker (please do not remove this line.)
 
+BUILD_DEPENDS+= ${PYPKGPREFIX}-setuptools-[0-9]*:../../devel/py-setuptools
 
 #.include "../../devel/py-setuptools/buildlink3.mk"
 .include "../../wip/py-cymem/buildlink3.mk"
+.include "../../wip/py-preshed/buildlink3.mk"
 .include "../../devel/py-cython/buildlink3.mk"
-.include "../../lang/python/distutils.mk"
+#.include "../../lang/python/distutils.mk"
+.include "../../lang/python/egg.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/py-spacy/distinfo b/py-spacy/distinfo
index 529296eeb8..3e7f852836 100644
--- a/py-spacy/distinfo
+++ b/py-spacy/distinfo
@@ -1,6 +1,6 @@
 $NetBSD$
 
-SHA1 (spaCy-3.0.5/spaCy-v3.0.5.tar.gz) = e57edfc416a763679c024425a6a6ca0bc51a151f
-RMD160 (spaCy-3.0.5/spaCy-v3.0.5.tar.gz) = 1f7cd575fd739a3cfa30a0240d97dc11965c802b
-SHA512 (spaCy-3.0.5/spaCy-v3.0.5.tar.gz) = 0224d06b739d8499e187781d9a32bece732ff33e7ba070c5c02da72a1ccbcbd42eda3470c564ce6651e672e3c3d00442f1e0311c0e6a9ed80081a84259faaeae
-Size (spaCy-3.0.5/spaCy-v3.0.5.tar.gz) = 8775616 bytes
+SHA1 (spaCy-v3.0.5.tar.gz) = e57edfc416a763679c024425a6a6ca0bc51a151f
+RMD160 (spaCy-v3.0.5.tar.gz) = 1f7cd575fd739a3cfa30a0240d97dc11965c802b
+SHA512 (spaCy-v3.0.5.tar.gz) = 0224d06b739d8499e187781d9a32bece732ff33e7ba070c5c02da72a1ccbcbd42eda3470c564ce6651e672e3c3d00442f1e0311c0e6a9ed80081a84259faaeae
+Size (spaCy-v3.0.5.tar.gz) = 8775616 bytes
diff --git a/py-thinc/TODO b/py-thinc/TODO
index 4c33be4aac..14e53297a3 100644
--- a/py-thinc/TODO
+++ b/py-thinc/TODO
@@ -4,9 +4,9 @@ cymem>=2.0.2,<2.1.0					DONE
 preshed>=3.0.2,<3.1.0				DONE
 blis>=0.4.0,<0.8.0
 srsly>=2.4.0,<3.0.0					DONE
-wasabi>=0.8.1,<1.1.0
-catalogue>=2.0.1,<2.1.0
-ml_datasets>=0.2.0,<0.3.0
+wasabi>=0.8.1,<1.1.0				DONE
+catalogue>=2.0.1,<2.1.0				DONE
+ml_datasets>=0.2.0,<0.3.0			DONE
 # Third-party dependencies
 pydantic>=1.7.1,<1.8.0
 numpy>=1.15.0
diff --git a/py-wasabi/Makefile b/py-wasabi/Makefile
index 783cbfc57d..64d5f270e4 100644
--- a/py-wasabi/Makefile
+++ b/py-wasabi/Makefile
@@ -2,7 +2,7 @@
 
 
 DISTNAME=	wasabi-v0.8.2
-PKGNAME=	${DISTNAME}
+PKGNAME=	${PYPKGPREFIX}-${DISTNAME}
 PKGREVISION=	1
 CATEGORIES=	devel python
 MASTER_SITES=	${MASTER_SITE_GITHUB:=ines/}


Home | Main Index | Thread Index | Old Index