python/pyperformance

--manifest flag doesn't work on Windows

gvanrossum opened this issue · 2 comments

I tried this on the pyston macro-benchmarks.

PS C:\Users\gvanrossum\python-macrobenchmarks> py -m pyperformance list --manifest C:\Users\gvanrossum\python-macrobenchmarks\benchmarks\MANIFEST
Traceback (most recent call last):
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\__main__.py", line 2, in <module>
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\__main__.py", line 2, in <module>
    pyperformance.cli.main()
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\cli.py", line 313, in main
    _main()
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\cli.py", line 301, in _main
    benchmarks = _benchmarks_from_options(options)
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\cli.py", line 218, in _benchmarks_from_options  
    return _select_benchmarks(options.benchmarks, manifest)
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\cli.py", line 235, in _select_benchmarks        
    if name in manifest.groups and op == '-':
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\_manifest.py", line 99, in groups
    names = set(self._get_tags())
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\_manifest.py", line 188, in _get_tags
    self._tags = _get_tags(self._byname.values())
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\_manifest.py", line 373, in _get_tags
    for tag in getattr(bench, 'tags', ()):
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\_benchmark.py", line 140, in tags
    return self._get_metadata_value('tags', ())
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\_benchmark.py", line 133, in _get_metadata_value    self._init_metadata()
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\_benchmark.py", line 122, in _init_metadata     
    self._metadata, _ = _benchmark_metadata.load_metadata(
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\_benchmark_metadata.py", line 71, in load_metadata
    base, basefile = _resolve_base(
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\_benchmark_metadata.py", line 176, in _resolve_base
    return load_metadata(metabase, defaults)
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\_benchmark_metadata.py", line 54, in load_metadata
    data, filename = _pyproject_toml.load_pyproject_toml(
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\_pyproject_toml.py", line 87, in load_pyproject_toml
    data = parse_pyproject_toml(text, rootdir, name,
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\pyperformance\_pyproject_toml.py", line 55, in parse_pyproject_toml
    data = toml.loads(text)
  File "C:\Users\gvanrossum\AppData\Local\Programs\Python\Python310\lib\site-packages\toml\decoder.py", line 260, in loads
    raise TomlDecodeError("Found invalid character in key name: '" +
toml.decoder.TomlDecodeError: Found invalid character in key name: '/'. Try quoting the key name. (line 1 column 3 char 2)
PS C:\Users\gvanrossum\python-macrobenchmarks>

Using run instead of list gives a similar traceback.

I tried it with the head of both repo pypeformance and python-macrobenchmarks and it worked. Can you try again? @gvanrossum

I expect it was fixed by #194.