Skip to content

Commit

Permalink
textproc/py-pygments: Update to 2.15.0
Browse files Browse the repository at this point in the history
- Convert to PEP-517
- Add devel/py-importlib-metadata to run dependencies
  when Python version < 3.8
- Rename Project name in pyproject.toml to fix the following error
  when generating the packing list, even if the best solution would
  be to rename PORTNAME:

===> Staging for py39-pygments-2.15.0
===>   py39-pygments-2.15.0 depends on file: /usr/local/bin/python3.9 - found
===>   Generating temporary packing list
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.9/site-packages/installer/__main__.py", line 98, in <module>
    _main(sys.argv[1:], "python -m installer")
  File "/usr/local/lib/python3.9/site-packages/installer/__main__.py", line 86, in _main
    with WheelFile.open(args.wheel) as source:
  File "/usr/local/lib/python3.9/contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.9/site-packages/installer/sources.py", line 122, in open
    with zipfile.ZipFile(path) as f:
  File "/usr/local/lib/python3.9/zipfile.py", line 1248, in __init__
    self.fp = io.open(file, filemode)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/poudriere/ports/default/textproc/py-pygments/work-py39/Pygments-2.15.0/dist/pygments-2.15.0*.whl'
*** Error code 1

Release changes: https://pygments.org/docs/changelog/
  • Loading branch information
nivit committed Apr 11, 2023
1 parent 5f1b229 commit 482a9c7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
20 changes: 15 additions & 5 deletions textproc/py-pygments/Makefile
@@ -1,5 +1,5 @@
PORTNAME= pygments
DISTVERSION= 2.14.0
DISTVERSION= 2.15.0
CATEGORIES= textproc python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
Expand All @@ -12,16 +12,26 @@ WWW= https://pygments.org/
LICENSE= BSD2CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE

TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR}
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>61:devel/py-setuptools@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}wheel>0.40.0:devel/py-wheel@${PY_FLAVOR}
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}wcag-contrast-ratio>=0.9:www/py-wcag-contrast-ratio@${PY_FLAVOR}

USES= cpe python:3.6+
USE_PYTHON= autoplist concurrent distutils
USES= cpe python:3.7+
USE_PYTHON= autoplist concurrent pep517

CONFLICTS_INSTALL= py??-pygments-25

NO_ARCH= yes

# test: 4033 passed, 3 skipped, 8072 warnings
do-test:
(cd ${TEST_WRKSRC} && ${PYTHON_CMD} -m pytest -v -rs -o addopts=)

.include <bsd.port.mk>
.include <bsd.port.pre.mk>

.if ${PYTHON_REL} < 30800
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}importlib-metadata>=1.7.0:devel/py-importlib-metadata@${PY_FLAVOR}
.endif

.include <bsd.port.post.mk>
6 changes: 3 additions & 3 deletions textproc/py-pygments/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1672564497
SHA256 (Pygments-2.14.0.tar.gz) = b3ed06a9e8ac9a9aae5a6f5dbe78a8a58655d17b43b93c078f094ddc476ae297
SIZE (Pygments-2.14.0.tar.gz) = 4434562
TIMESTAMP = 1681143350
SHA256 (Pygments-2.15.0.tar.gz) = f7e36cffc4c517fbc252861b9a6e4644ca0e5abadf9a113c72d1358ad09b9500
SIZE (Pygments-2.15.0.tar.gz) = 4818485
11 changes: 11 additions & 0 deletions textproc/py-pygments/files/patch-pyproject.toml
@@ -0,0 +1,11 @@
--- pyproject.toml.orig 2023-02-25 10:36:04 UTC
+++ pyproject.toml
@@ -4,7 +4,7 @@ requires = ["setuptools >= 61"]
build-backend = "setuptools.build_meta"

[project]
-name = "Pygments"
+name = "pygments"
dynamic = ["version"]
requires-python = ">=3.7"
license = {text = "BSD-2-Clause"}

0 comments on commit 482a9c7

Please sign in to comment.