aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-03-21 18:44:18 +0000
committerPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-03-21 19:20:45 +0000
commit26bb184591fe2b4ffb66954bbfa8d87908696eb7 (patch)
treefcc22006b512bc795ead6541133a999d328c28b8
parentdac5e30be39cab021207477d3efd4e934996c751 (diff)
downloadports-26bb184591fe2b4ffb66954bbfa8d87908696eb7.tar.gz
ports-26bb184591fe2b4ffb66954bbfa8d87908696eb7.zip
devel/py-jupyter-packaging: Convert to USE_PYTHON=pep517
- Bump PORTREVISION for dependency and package change
-rw-r--r--devel/py-jupyter-packaging/Makefile7
-rw-r--r--devel/py-jupyter-packaging/files/setup.py42
2 files changed, 3 insertions, 46 deletions
diff --git a/devel/py-jupyter-packaging/Makefile b/devel/py-jupyter-packaging/Makefile
index 8103c60fc2ef..8b5aa1fb2f90 100644
--- a/devel/py-jupyter-packaging/Makefile
+++ b/devel/py-jupyter-packaging/Makefile
@@ -1,5 +1,6 @@
PORTNAME= jupyter-packaging
PORTVERSION= 0.12.3
+PORTREVISION= 1
CATEGORIES= devel python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -12,17 +13,15 @@ WWW= https://github.com/jupyter/jupyter-packaging
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
+BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hatchling>=0.25:devel/py-hatchling@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}deprecation>=0:devel/py-deprecation@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}packaging>=0:devel/py-packaging@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}tomlkit>=0:textproc/py-tomlkit@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${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>
diff --git a/devel/py-jupyter-packaging/files/setup.py b/devel/py-jupyter-packaging/files/setup.py
deleted file mode 100644
index 64bbbf2014d8..000000000000
--- a/devel/py-jupyter-packaging/files/setup.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# -*- coding: utf-8 -*-
-from setuptools import setup
-
-setup(
- name='jupyter-packaging',
- version='%%PORTVERSION%%',
- description='Jupyter Packaging Utilities.',
- long_description='# Jupyter Packaging\n\nTools to help build and install Jupyter Python packages that require a pre-build step that may include JavaScript build steps.\n\n## Install\n\n`pip install jupyter-packaging`\n\n## Usage\n\nThere are three ways to use `jupyter-packaging` in another package.\nIn general, you should not depend on `jupyter_packaging` as a runtime dependency, only as a build dependency.\n\n### As a Build Requirement\n\nUse a `pyproject.toml` file as outlined in [pep-518](https://www.python.org/dev/peps/pep-0518/).\nAn example:\n\n```toml\n[build-system]\nrequires = ["jupyter_packaging>=0.10,<2"]\nbuild-backend = "setuptools.build_meta"\n```\n\nBelow is an example `setup.py` using the above config.\nIt assumes the rest of your metadata is in [`setup.cfg`](https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html).\nWe wrap the import in a try/catch to allow the file to be run without `jupyter_packaging`\nso that `python setup.py` can be run directly when not building.\n\n```py\nfrom setuptools import setup\n\ntry:\n from jupyter_packaging import wrap_installers, npm_builder\n builder = npm_builder()\n cmdclass = wrap_installers(pre_develop=builder, pre_dist=builder)\nexcept ImportError:\n cmdclass = {}\n\nsetup(cmdclass=cmdclass))\n```\n\n### As a Build Backend\n\nUse the `jupyter_packaging` build backend.\nThe pre-build command is specified as metadata in `pyproject.toml`:\n\n```toml\n[build-system]\nrequires = ["jupyter_packaging>=0.10,<2"]\nbuild-backend = "jupyter_packaging.build_api"\n\n[tool.jupyter-packaging.builder]\nfactory = "jupyter_packaging.npm_builder"\n\n[tool.jupyter-packaging.build-args]\nbuild_cmd = "build:src"\n```\n\nThe corresponding `setup.py` would be greatly simplified:\n\n```py\nfrom setuptools import setup\nsetup()\n```\n\nThe `tool.jupyter-packaging.builder` section expects a `func` value that points to an importable\nmodule and a function with dot separators. If not given, no pre-build function will run.\n\nThe optional `tool.jupyter-packaging.build-args` sections accepts a dict of keyword arguments to\ngive to the pre-build command.\n\nThe build backend does not handle the `develop` command (`pip install -e .`).\nIf desired, you can wrap just that command:\n\n```py\nimport setuptools\n\ntry:\n from jupyter_packaging import wrap_installers, npm_builder\n builder = npm_builder(build_cmd="build:dev")\n cmdclass = wrap_installers(pre_develop=builder)\nexcept ImportError:\n cmdclass = {}\n\nsetup(cmdclass=cmdclass))\n```\n\nThe optional `tool.jupyter-packaging.options` section accepts the following options:\n\n- `skip-if-exists`: A list of local files whose presence causes the prebuild to skip\n- `ensured-targets`: A list of local file paths that should exist when the dist commands are run\n\n### As a Vendored File\n\nVendor `setupbase.py` locally alongside `setup.py` and import the module directly.\n\n```py\nimport setuptools\nfrom setupbase import wrap_installers, npm_builder\nfunc = npm_builder()\ncmdclass = wrap_installers(post_develop=func, pre_dist=func)\nsetup(cmdclass=cmdclass)\n```\n\n## Usage Notes\n\n- This package does not work with the deprecated `python setup.py bdist_wheel` or `python setup.py sdist` commands, PyPA recommends using the [build](https://pypa-build.readthedocs.io/en/latest/index.html) package (`pip install build && python -m build .`).\n- We recommend using `include_package_data=True` and `MANIFEST.in` to control the assets included in the [package](https://setuptools.readthedocs.io/en/latest/userguide/datafiles.html).\n- Tools like [`check-manifest`](https://github.com/mgedmin/check-manifest) or [`manifix`](https://github.com/vidartf/manifix) can be used to ensure the desired assets are included.\n- Simple uses of `data_files` can be handled in `setup.cfg` or in `setup.py`. If recursive directories are needed use `get_data_files()` from this package.\n- Unfortunately `data_files` are not supported in `develop` mode (a limitation of `setuptools`). You can work around it by doing a full install (`pip install .`) before the develop install (`pip install -e .`), or by adding a script to push the data files to `sys.base_prefix`.\n\n## Development Install\n\n```bash\ngit clone https://github.com/jupyter/jupyter-packaging.git\ncd jupyter-packaging\npip install -e .[test]\npre-commit install\n```\n\nYou can test changes locally by creating a `pyproject.toml` with the following, replacing the local path to the git checkout:\n\n```toml\n[build-system]\nrequires = ["jupyter_packaging@file://<path-to-git-checkout>"]\nbuild-backend = "setuptools.build_meta"\n```\n\nNote: you need to run `pip cache remove jupyter_packaging` any time changes are made to prevent `pip` from using a cached version of the source.\n',
- author_email='Jupyter Development Team <jupyter@googlegroups.com>',
- classifiers=[
- 'Intended Audience :: Developers',
- 'Intended Audience :: Science/Research',
- 'Intended Audience :: System Administrators',
- 'License :: OSI Approved :: BSD License',
- 'Programming Language :: Python',
- 'Programming Language :: Python :: 3.7',
- 'Programming Language :: Python :: 3.8',
- 'Programming Language :: Python :: 3.9',
- 'Programming Language :: Python :: 3.10',
- ],
- install_requires=[
- 'deprecation',
- 'packaging',
- 'setuptools>=60.2.0',
- 'tomlkit',
- 'wheel',
- ],
- extras_require={
- 'test': [
- 'build',
- 'coverage',
- 'pre-commit',
- 'pytest',
- 'pytest-cov',
- 'pytest-mock',
- 'pytest-timeout',
- ],
- },
- packages=[
- 'jupyter_packaging',
- ],
-)