question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Minimum supported version tests failing

See original GitHub issue

Following merging of PR #1909, the

https://github.com/scikit-hep/pyhf/blob/f01dcf59da10ec9313345305efc49cfb7186bf99/.github/workflows/lower-bound-requirements.yml#L1

workflow started failing for

https://github.com/scikit-hep/pyhf/blob/f01dcf59da10ec9313345305efc49cfb7186bf99/tests/test_scripts.py#L166

with

=================================== FAILURES ===================================
______________________ test_import_usingMounts[inprocess] ______________________

datadir = PosixPath('/tmp/pytest-of-runner/pytest-0/test_import_usingMounts_inproc0')
tmpdir = local('/tmp/pytest-of-runner/pytest-0/test_import_usingMounts_inproc0')
script_runner = <ScriptRunner inprocess>

    def test_import_usingMounts(datadir, tmpdir, script_runner):
        data = datadir.joinpath("xmlimport_absolutePaths")
    
        temp = tmpdir.join("parsed_output.json")
        command = f'pyhf xml2json --hide-progress -v {data}:/absolute/path/to -v {data}:/another/absolute/path/to --output-file {temp.strpath:s} {data.joinpath("config/example.xml")}'
    
        ret = script_runner.run(*shlex.split(command))
>       assert ret.success
E       assert False
E        +  where False = <pytest_console_scripts.RunResult object at 0x7f93d[84](https://github.com/scikit-hep/pyhf/runs/8031258926?check_suite_focus=true#step:6:85)a6750>.success

command    = 'pyhf xml2json --hide-progress -v /tmp/pytest-of-runner/pytest-0/test_import_usingMounts_inproc0/xmlimport_absolutePat..._output.json /tmp/pytest-of-runner/pytest-0/test_import_usingMounts_inproc0/xmlimport_absolutePaths/config/example.xml'
data       = PosixPath('/tmp/pytest-of-runner/pytest-0/test_import_usingMounts_inproc0/xmlimport_absolutePaths')
datadir    = PosixPath('/tmp/pytest-of-runner/pytest-0/test_import_usingMounts_inproc0')
ret        = <pytest_console_scripts.RunResult object at 0x7f93d84a6750>
script_runner = <ScriptRunner inprocess>
temp       = local('/tmp/pytest-of-runner/pytest-0/test_import_usingMounts_inproc0/parsed_output.json')
tmpdir     = local('/tmp/pytest-of-runner/pytest-0/test_import_usingMounts_inproc0')

tests/test_scripts.py:173: AssertionError
----------------------------- Captured stdout call -----------------------------
# Running console script: pyhf xml2json --hide-progress -v /tmp/pytest-of-runner/pytest-0/test_import_usingMounts_inproc0/xmlimport_absolutePaths:/absolute/path/to -v /tmp/pytest-of-runner/pytest-0/test_import_usingMounts_inproc0/xmlimport_absolutePaths:/another/absolute/path/to --output-file /tmp/pytest-of-runner/pytest-0/test_import_usingMounts_inproc0/parsed_output.json /tmp/pytest-of-runner/pytest-0/test_import_usingMounts_inproc0/xmlimport_absolutePaths/config/example.xml
# Script return code: 1
# Script stdout:

# Script stderr:
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pytest_console_scripts.py", line 188, in console_script
    return s()
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pyhf/cli/rootio.py", line 63, in xml2json
    validation_as_error=validation_as_error,
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/pyhf/readxml.py", line 455, in parse
    ET.parse(resolver(inp)), resolver, track_progress
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/xml/etree/ElementTree.py", line 1197, in parse
    tree.parse(source, parser)
  File "/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/xml/etree/ElementTree.py", line 5[87](https://github.com/scikit-hep/pyhf/runs/8031258926?check_suite_focus=true#step:6:88), in parse
    source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/absolute/path/to/config/example_channel.xml'

we had thought that PR #1917 would fix this, but it hasn’t. Given the core requirements of pyhf are modest

https://github.com/scikit-hep/pyhf/blob/f01dcf59da10ec9313345305efc49cfb7186bf99/tests/constraints.txt#L1-L9

it is unclear to me why the tests with these unpinned pass, but fail here.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
davidismcommented, Aug 26, 2022

I can’t really tell what’s failing here, or how it’s related to Click. Just note that Click 7.x and 8.0.x are no longer supported, we only support the latest feature branch, currently 8.1.x.

1reaction
kratsgcommented, Aug 26, 2022

Ok, this is a problem. Because this does indicate that Click is parsing the CLI arguments incorrectly if it has colons versus if it doesn’t.

FileNotFoundError: [Errno 2] No such file or directory: '/absolute/path/to/config/example_channel.xml'

should not happen at all. It should be replacing that path to the local path on disk for the file, since the whole point is to test that it’s mounting files correctly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Minimum supported Gradle version is 3.3. Current version is ...
When I today update Android Studio it write: Minimum supported Gradle version is 3.3. Current version is 3.2 how can ...
Read more >
Fix UpdateScriptTest when MINIMUM_SUPPORTED_PHP is ...
This issue has three MRs: 3265376-FAIL lowers the minimum supported PHP (and skips a couple out-of-scope tests) to demonstrate the problem in ...
Read more >
Failed to Connect Android Device | TestProject Help Center
The minimum version we support is Android 5.0 which is OS version 21. Check if the ADB can detect the device. Windows: Open...
Read more >
Minimum supported Gradle version is 6.5. Current ... - GitHub
Short test passed - there are only build and run unit tests. Long tests failed on install-missing-android-tools - it needs to upgrade cache:pull ......
Read more >
Use the Android Gradle plugin Upgrade Assistant
Important: The AGP Upgrade Assistant does not yet support projects that use Gradle Version Catalogs or buildSrc to define constants and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found