#64045 closed defect (fixed)
py-distorm py-gobject py-jellyfish py-ngl py-numeric py-plumed py-pyrfc3339 py-pyrsistent py-pyzstd py-xlsx2csv: tests fail from clean state because glob is used in global part of portfile
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | catap (Kirill A. Korinsky) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | GiovanniBussi (Giovanni), jmroot (Joshua Root), kurthindenburg (Kurt Hindenburg), petrrr, stromnov (Andrey Stromnov) | |
Port: | py-distorm py-gobject py-jellyfish py-ngl py-numeric py-plumed py-pyrfc3339 py-pyrsistent py-pyzstd py-xlsx2csv |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
py-pyzstd does:
test.env PYTHONPATH=[glob -nocomplain ${worksrcpath}/build/lib*]
This won't work if the port is in a clean state at the time the portfile is parsed because ${worksrcpath} and its contents don't exist yet.
For example: sudo port clean py39-pyzstd && sudo port test py39-pyzstd
fails because PYTHONPATH
is empty:
:debug:test Environment:
:debug:test PYTHONPATH=''
:info:test test_zstd (unittest.loader._FailedTest) ... ERROR :info:test ====================================================================== :info:test ERROR: test_zstd (unittest.loader._FailedTest) :info:test ---------------------------------------------------------------------- :info:test ImportError: Failed to import test module: test_zstd :info:test Traceback (most recent call last): :info:test File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/loader.py", line 154, in loadTestsFromName :info:test module = __import__(module_name) :info:test File "/opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-ryandesign-fork_python_py-pyzstd/py39-pyzstd/work/pyzstd-0.15.0/tests/test_zstd.py", line 20, in <module> :info:test import pyzstd :info:test ModuleNotFoundError: No module named 'pyzstd' :info:test ----------------------------------------------------------------------
A subsequent sudo port test py39-pyzstd
without cleaning first succeeds.
To avoid this problem, if you need to glob
or otherwise inspect the contents of ${worksrcpath}, you can't do it in the global part of the portfile. You have to defer it to a time when ${worksrcpath} exists. In this case, you should enclose at least the test.env
line in a pre-test
block.
Change History (13)
comment:1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|
comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | GiovanniBussi jmroot kurthindenburg petrrr stromnov added |
---|---|
Port: | py-distorm py-gobject py-jellyfish py-ngl py-numeric py-plumed py-pyrfc3339 py-pyrsistent py-xlsx2csv added |
Summary: | py-pyzstd: tests fail from clean state because glob is used in global part of portfile → py-distorm py-gobject py-jellyfish py-ngl py-numeric py-plumed py-pyrfc3339 py-pyrsistent py-pyzstd py-xlsx2csv: tests fail from clean state because glob is used in global part of portfile |
comment:4 Changed 3 years ago by catap (Kirill A. Korinsky)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:5 Changed 3 years ago by catap (Kirill A. Korinsky)
comment:6 Changed 3 years ago by catap (Kirill A. Korinsky)
comment:7 Changed 3 years ago by catap (Kirill A. Korinsky)
comment:8 Changed 3 years ago by catap (Kirill A. Korinsky)
comment:9 Changed 3 years ago by catap (Kirill A. Korinsky)
comment:10 Changed 3 years ago by catap (Kirill A. Korinsky)
comment:11 Changed 3 years ago by catap (Kirill A. Korinsky)
comment:12 Changed 3 years ago by catap (Kirill A. Korinsky)
comment:13 Changed 3 years ago by catap (Kirill A. Korinsky)
Note: See
TracTickets for help on using
tickets.
This problem affects several python modules. Might as well fix them all at once.