pytoport icon indicating copy to clipboard operation
pytoport copied to clipboard

Support of python wheels distribution model

Open mallniya opened this issue 8 years ago • 0 comments

While packaging h2o (https://pypi.python.org/pypi/h2o/3.6.0.8) I encounter python wheels distribution model, which I knew nothing about and it seems pytoport doesn't either. Still I've found a workaround to do the trick:

# Created by: user <[email protected]>
# $FreeBSD$

PORTNAME=       h2o
PORTVERSION=    3.6.0.8
PORTREVISION=   1
CATEGORIES=     devel python
MASTER_SITES=   https://pypi.python.org/packages/2.7/h/h2o/
PKGNAMEPREFIX=  ${PYTHON_PKGNAMEPREFIX}
EXTRACT_SUFX=   -py2.py3-none-any.whl

MAINTAINER=     [email protected]
COMMENT=        H2O, Fast Scalable Machine Learning, for python

LICENSE=        APACHE20

EXTRACT_DEPENDS=${PREFIX}/bin/pip:${PORTSDIR}/devel/py-pip

RUN_DEPENDS=    ${PYTHON_SITELIBDIR}/tabulate.py:${PORTSDIR}/devel/py-tabulate \
                ${PYTHON_SITELIBDIR}/requests/__init__.py:${PORTSDIR}/www/py-requests

USES=           python

do-extract:
        ${MKDIR} ${WRKSRC}
        ${PREFIX}/bin/pip install --no-deps --isolated --ignore-installed --root=${WRKSRC}/ ${DISTDIR}/${DISTFILES}

NO_BUILD=       yes

do-install:
        ${MKDIR} ${STAGEDIR}
        cd ${WRKSRC} && ${COPYTREE_SHARE} . ${STAGEDIR}

.include <bsd.port.mk>

Though it doesn't look like absolutely generic option -- it works just fine. Can this method be included in pytoport for PyPI packages with python wheels?

mallniya avatar Mar 16 '16 13:03 mallniya