Skip to content
Snippets Groups Projects
Verified Commit e9cedb33 authored by sunpoet's avatar sunpoet
Browse files

devel/py-comm: Convert to USE_PYTHON=pep517

- Bump PORTREVISION for dependency and package change
parent 1fc740c4
No related branches found
No related tags found
No related merge requests found
PORTNAME= comm
PORTVERSION= 0.1.2
PORTREVISION= 1
CATEGORIES= devel python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
......@@ -11,14 +12,12 @@ WWW= https://github.com/ipython/comm
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hatchling>=1.10:devel/py-hatchling@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}traitlets>=5.3:devel/py-traitlets@${PY_FLAVOR}
USES= python:3.7+
USE_PYTHON= autoplist concurrent distutils
USE_PYTHON= autoplist concurrent pep517
NO_ARCH= yes
post-patch:
@${SED} -e 's|%%PORTVERSION%%|${PORTVERSION}|' ${FILESDIR}/setup.py > ${WRKSRC}/setup.py
.include <bsd.port.mk>
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='comm',
version='%%PORTVERSION%%',
description='Jupyter Python Comm implementation, for usage in ipykernel, xeus-python etc.',
long_description="# Comm\n\nIt provides a way to register a Kernel Comm implementation, as per the Jupyter kernel protocol.\nIt also provides a base Comm implementation and a default CommManager that can be used.\n\n## Register a comm implementation in the kernel:\n\n### Case 1: Using the default CommManager and the BaseComm implementations\n\nWe provide default implementations for usage in IPython:\n\n```python\nimport comm\n\n\nclass MyCustomComm(comm.base_comm.BaseComm):\n\n def publish_msg(self, msg_type, data=None, metadata=None, buffers=None, **keys):\n # TODO implement the logic for sending comm messages through the iopub channel\n pass\n\n\ncomm.create_comm = MyCustomComm\n```\n\nThis is typically what ipykernel and JupyterLite's pyolite kernel will do.\n\n### Case 2: Providing your own comm manager creation implementation\n\n```python\nimport comm\n\ncomm.create_comm = custom_create_comm\ncomm.get_comm_manager = custom_comm_manager_getter\n```\n\nThis is typically what xeus-python does (it has its own manager implementation using xeus's C++ messaging logic).\n\n## Comm users\n\nLibraries like ipywidgets can then use the comms implementation that has been registered by the kernel:\n\n```python\nfrom comm import create_comm, get_comm_manager\n\n# Create a comm\ncomm_manager = get_comm_manager()\ncomm = create_comm()\n\ncomm_manager.register_comm(comm)\n```\n",
author='Jupyter contributors',
classifiers=[
'Framework :: Jupyter',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
],
install_requires=[
'traitlets>=5.3',
],
extras_require={
'test': [
'pytest',
],
},
packages=[
'comm',
],
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment