Page MenuHomeFreeBSD

graphics/py-wand: Add DOCS option Pass MAINTAINER'ship
Needs RevisionPublic

Authored by diizzy on Sep 20 2021, 8:55 PM.

Details

Reviewers
tcberner
arrowd
lbartoletti
koobs
Group Reviewers
Python
Summary
graphics/py-wand: Add DOCS option Pass MAINTAINER'ship

 - Add docs option from PR and make submitter maintainer
 - Simplify port by making use of default-versions in framework (thanks to tcberner)

PR: 234981
MFH: ???
Reviewed_by: ???
Differential_Revision: D32031
Test Plan
  • Compile tested on FreeBSD 13.0-STABLE #0 stable/13-n246086-a20c597c6d7 (amd64) (make, make check-plist)
  • Poudriere testport OK 12.2-RELEASE (amd64)

"make test" on Python

3.6

SKIPPED [1] tests/color_test.py:316: memory_usage is unavailable, or untestable
SKIPPED [1] tests/drawing_test.py:347: wand.drawing.Drawing.matte removed with IM 7.
SKIPPED [1] tests/drawing_test.py:360: wand.drawing.Drawing.matte removed with IM 7.
SKIPPED [1] tests/image_test.py:116: Unicode filesystem encoding needed
SKIPPED [1] tests/image_test.py:173: Unicode filesystem encoding needed
SKIPPED [1] tests/image_test.py:296: Unicode filesystem encoding needed
SKIPPED [1] tests/image_test.py:582: Numpy not available.
SKIPPED [1] tests/image_test.py:604: Numpy not available.
SKIPPED [1] tests/image_test.py:622: Numpy not available.

3.7

SKIPPED [1] tests/color_test.py:316: memory_usage is unavailable, or untestable
SKIPPED [1] tests/drawing_test.py:347: wand.drawing.Drawing.matte removed with IM 7.
SKIPPED [1] tests/drawing_test.py:360: wand.drawing.Drawing.matte removed with IM 7.
SKIPPED [1] tests/image_test.py:582: Numpy not available.
SKIPPED [1] tests/image_test.py:604: Numpy not available.
SKIPPED [1] tests/image_test.py:622: Numpy not available.

3.8

SKIPPED [1] tests/color_test.py:316: memory_usage is unavailable, or untestable
SKIPPED [1] tests/drawing_test.py:347: wand.drawing.Drawing.matte removed with IM 7.
SKIPPED [1] tests/drawing_test.py:360: wand.drawing.Drawing.matte removed with IM 7.
SKIPPED [1] tests/image_test.py:582: Numpy not available.
SKIPPED [1] tests/image_test.py:604: Numpy not available.
SKIPPED [1] tests/image_test.py:622: Numpy not available.

3.9

SKIPPED [1] tests/color_test.py:316: memory_usage is unavailable, or untestable
SKIPPED [1] tests/drawing_test.py:347: wand.drawing.Drawing.matte removed with IM 7.
SKIPPED [1] tests/drawing_test.py:360: wand.drawing.Drawing.matte removed with IM 7.
SKIPPED [1] tests/image_test.py:582: Numpy not available.
SKIPPED [1] tests/image_test.py:604: Numpy not available.
SKIPPED [1] tests/image_test.py:622: Numpy not available.

3.10

cd /usr/ports/graphics/py-wand/work-py310/Wand-0.6.7 && /usr/local/bin/python3.10 -m pytest -v -rs -o addopts=
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 939, in _find_spec
AttributeError: 'AssertionRewritingHook' object has no attribute 'find_spec'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.10/site-packages/pytest.py", line 102, in <module>
    raise SystemExit(pytest.main())
  File "/usr/local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 65, in main
    config = _prepareconfig(args, plugins)
  File "/usr/local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 213, in _prepareconfig
    return pluginmanager.hook.pytest_cmdline_parse(
  File "/usr/local/lib/python3.10/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/local/lib/python3.10/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/local/lib/python3.10/site-packages/pluggy/manager.py", line 84, in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
  File "/usr/local/lib/python3.10/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/usr/local/lib/python3.10/site-packages/_pytest/helpconfig.py", line 94, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/usr/local/lib/python3.10/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/local/lib/python3.10/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/usr/local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 789, in pytest_cmdline_parse
    self.parse(args)
  File "/usr/local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 997, in parse
    self._preparse(args, addopts=addopts)
  File "/usr/local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 943, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/usr/local/lib/python3.10/site-packages/pluggy/manager.py", line 299, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/usr/local/lib/python3.10/importlib/metadata/__init__.py", line 162, in load
    module = import_module(match.group('module'))
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/local/lib/python3.10/site-packages/xdist/__init__.py", line 1, in <module>
    from xdist._version import version as __version__
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 941, in _find_spec
  File "<frozen importlib._bootstrap>", line 915, in _find_spec_legacy
  File "/usr/local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 169, in find_module
    source_stat, co = _rewrite_test(self.config, fn_pypath)
  File "/usr/local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py", line 406, in _rewrite_test
    co = compile(tree, fn.strpath, "exec", dont_inherit=True)
TypeError: required field "lineno" missing from alias
*** Error code 1

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

diizzy created this revision.

fwiw, I see this at the end of the build but these errors seems to be bogus?

...
===> Creating unique files: Move MAN files needing SUFFIX
===> Creating unique files: Move files needing SUFFIX
====> Compressing man pages (compress-man)
graphics/py-wand/Makefile
23

I wonder if >=0,1 is not a typo.
>=0 should be sufficient?

You're right, I'm not sure what causes the unique files message though

diizzy added a reviewer: Python.

Change DOCS_BUILD_DEPENDS to >=0
USES= python is the same as python:3.6+ ( https://cgit.freebsd.org/ports/tree/Mk/Uses/python.mk#n27 )

diizzy retitled this revision from graphics/py-wand: Add docs, clean up Makefile to graphics/py-wand: Add docs, clean up Makefile, pass maintainership.Nov 5 2021, 8:16 AM
diizzy marked an inline comment as done.
koobs edited the test plan for this revision. (Show Details)
koobs added a subscriber: koobs.

fwiw, I see this at the end of the build but these errors seems to be bogus?

...
===> Creating unique files: Move MAN files needing SUFFIX
===> Creating unique files: Move files needing SUFFIX
====> Compressing man pages (compress-man)

USE_PYTHON=concurrent processes a Python ports pkg-plist looking for files in shared (non python version specific) locations, and renames them if necessary, allowing for multiple versions to be concurrently installed

These aren't errors, there were just no files matched for processing

Change DOCS_BUILD_DEPENDS to >=0
USES= python is the same as python:3.6+ ( https://cgit.freebsd.org/ports/tree/Mk/Uses/python.mk#n27 )

A python ports job is only to declare what versions the upstream package supports, not specify which versions should be used. What versions python.mk ends up selecting is orthogonal to what a port should specify.

In this case its -3.9 according to setup.py [1] and docs [2] (we cant specify !=X.Y with our syntax) yet, *but* 3.7-3.8 according to CI [3] and only 2.7,3.8 in tox.ini [4]

I would obtain advice from upstream, and have them clear up the ambiguity, either by adding all supported versions to CI, or updating the trove classifiers in setup.py (and adding a standard python_requires= to setup.py) for the versions they want to canonically say they support (and test for)

[1] https://github.com/emcconville/wand/blob/master/setup.py#L62-L71
[2] https://docs.wand-py.org/en/0.6.7/#requirements
[3] https://travis-ci.org/github/emcconville/wand/builds/774568825
[4] https://github.com/emcconville/wand/blob/master/tox.ini#L2

Note: @sunpoet took maintainership in dc41320718b8

Lets coordinate final MAINTAINER given the patch for the Bugzilla issue was created 2021-10-17

We should also rebase this against head if its needed

koobs retitled this revision from graphics/py-wand: Add docs, clean up Makefile, pass maintainership to graphics/py-wand: Add DOCS option Pass MAINTAINER'ship.Fri, Nov 5, 10:20 PM
koobs edited the summary of this revision. (Show Details)

Separately, I note upstream docs for installation on FreeBSD are outdated: https://docs.wand-py.org/en/0.6.7/guide/install.html#install-wand-on-freebsd

We should get that updated with a make install clean and pkg install commands

The package (sdist) ships with tests: In these cases add TEST_DEPENDS and a (do)-test target so runtime QA can be executed easily.

Dependencies (TEST_DEPENDS), ignoring non compulsory dev test dependencies:

pytest
pytest-xdist
psutil
memory_profiler (may not be compulsory, test may fail if not installed, should be made optional if so)

A standard pytest invocation should work:

do-test: cd ${WRKSRC} && ${PYTHON_CMD} -m pytest -v -rs -o addopts=

Do the tests pass for all supported Python versions? Add to TEST PLAN section

graphics/py-wand/Makefile
44

Is it possible to just have straight X11_LIB_DEPENDS= and X11_LIB_DEPENDS_OFF lines here instead of the shared/indirect variable? Prefer explicit/readability over 'deduplication'

koobs requested changes to this revision.Fri, Nov 5, 10:40 PM
This revision now requires changes to proceed.Fri, Nov 5, 10:40 PM

Note: @sunpoet took maintainership in dc41320718b8

Lets coordinate final MAINTAINER given the patch for the Bugzilla issue was created 2021-10-17

We should also rebase this against head if its needed

To be fair, the initial patch for this port was created back in 2019, people just missed it.

The patched out test fails because of policy restrictions.

Refresh patch, can't reproduce the policy issue with fresh tree so no need to patch out that specific test

Looks good, modulo adding numpy to TEST_DEPENDS

graphics/py-wand/Makefile
19

Leftover trailing \, but i would add numpy here for additional (optional) tests to be run

koobs requested changes to this revision.Thu, Nov 18, 1:10 AM
This revision now requires changes to proceed.Thu, Nov 18, 1:10 AM