databio / pypiper

Python toolkit for building restartable pipelines
http://pypiper.databio.org
BSD 2-Clause "Simplified" License
45 stars 9 forks source link

Python >= 3.9 breaks the ability to treat .keys() as a list for concatenation. #178

Closed jpsmith5 closed 2 years ago

jpsmith5 commented 2 years ago

https://github.com/databio/pypiper/blob/8f9993ab593021be022727cef60e150a764c0ac1/pypiper/utils.py#L812

Example: Fresh install of refgenie in a conda environment.

$ refgenie --version
Traceback (most recent call last):
  File "/home/user/.conda/envs/example/bin/refgenie", line 8, in <module>
    sys.exit(main())
  File "/home/user/.conda/envs/example/lib/python3.9/site-packages/refgenie/cli.py", line 37, in main
    parser = logmuse.add_logging_options(build_argparser())
  File "/home/user/.conda/envs/example/lib/python3.9/site-packages/refgenie/argparser.py", line 113, in build_argparser
    sps[BUILD_CMD] = pypiper.add_pypiper_args(
  File "/home/user/.conda/envs/example/lib/python3.9/site-packages/pypiper/utils.py", line 59, in add_pypiper_args
    args_to_add = _determine_args(
  File "/home/user/.conda/envs/example/lib/python3.9/site-packages/pypiper/utils.py", line 811, in _determine_args
    "pypiper": ["recover", "new-start", "dirty", "force-follow", "testmode"] +
TypeError: can only concatenate list (not "dict_keys") to list

Current:

LOGGING_CLI_OPTDATA.keys()

Solution (Python >= 3.5: unpack into a list literal [*newdict]):

[*LOGGING_CLI_OPTDATA]

Converting this value into a list literal resolves the concatenation error.

nsheff commented 2 years ago

Ok, the fix in 0.12.3 has be released to pypi. Can you confirm that this solves your issues?