Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Bump yte from >=1.0,<2.0 to >=1.5.1,<2.0 (#2275)
### Description Bumps package `yte`, to enable kwarg `require_use_yte` below: https://github.com/snakemake/snakemake/blob/95b8dfefdb19945aaa038da387d6eadd653bffcd/snakemake/io.py#L1696-L1701 The try/except does not capture this because an unrecognized kwarg is not `YAMLError`, but `TypeError`. I encountered this error in the `test_schema` test suite. I do not know if it is an error encountered during normal execution of Snakemake. ### QC <!-- Make sure that you can tick the boxes below. --> * [x] The PR contains a test case for the changes or the changes are already covered by an existing test case. - Changes are covered by the failing tests which they fix (see failures below) * [x] The documentation (`docs/`) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake). ``` =================================== FAILURES =================================== _________________________________ test_config __________________________________ config_schema = local('/tmp/guix-build-snakemake-7.26.0.drv-0/pytest-of-nixbld/pytest-0/test_config0/schema/config.schema.yaml') def test_config(config_schema): config = {} > validate(config, str(config_schema), False) tests/test_schema.py:119: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ snakemake/utils.py:71: in validate schema = _load_configfile(source, filetype="Schema") _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ configpath_or_obj = '/tmp/guix-build-snakemake-7.26.0.drv-0/pytest-of-nixbld/pytest-0/test_config0/schema/config.schema.yaml' filetype = 'Schema' def _load_configfile(configpath_or_obj, filetype="Config"): "Tries to load a configfile first as JSON, then as YAML, into a dict." import yaml if isinstance(configpath_or_obj, str) or isinstance(configpath_or_obj, Path): obj = open(configpath_or_obj, encoding="utf-8") else: obj = configpath_or_obj try: with obj as f: try: return json.load(f, object_pairs_hook=collections.OrderedDict) except ValueError: f.seek(0) # try again try: import yte > return yte.process_yaml(f, require_use_yte=True) E TypeError: process_yaml() got an unexpected keyword argument 'require_use_yte' snakemake/io.py:1699: TypeError _______________________________ test_config_ref ________________________________ config_schema_ref = local('/tmp/guix-build-snakemake-7.26.0.drv-0/pytest-of-nixbld/pytest-0/test_config_ref0/schema/config.ref.schema.yaml') def test_config_ref(config_schema_ref): config = {} > validate(config, str(config_schema_ref)) tests/test_schema.py:127: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ snakemake/utils.py:71: in validate schema = _load_configfile(source, filetype="Schema") _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ configpath_or_obj = '/tmp/guix-build-snakemake-7.26.0.drv-0/pytest-of-nixbld/pytest-0/test_config_ref0/schema/config.ref.schema.yaml' filetype = 'Schema' def _load_configfile(configpath_or_obj, filetype="Config"): "Tries to load a configfile first as JSON, then as YAML, into a dict." import yaml if isinstance(configpath_or_obj, str) or isinstance(configpath_or_obj, Path): obj = open(configpath_or_obj, encoding="utf-8") else: obj = configpath_or_obj try: with obj as f: try: return json.load(f, object_pairs_hook=collections.OrderedDict) except ValueError: f.seek(0) # try again try: import yte > return yte.process_yaml(f, require_use_yte=True) E TypeError: process_yaml() got an unexpected keyword argument 'require_use_yte' snakemake/io.py:1699: TypeError ________________________________ test_dataframe ________________________________ df_schema = local('/tmp/guix-build-snakemake-7.26.0.drv-0/pytest-of-nixbld/pytest-0/test_dataframe0/schema/df.schema.yaml') def test_dataframe(df_schema): df = pd.DataFrame([{"sample": "foo", "condition": "bar"}]) > validate(df, str(df_schema), False) tests/test_schema.py:142: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ snakemake/utils.py:71: in validate schema = _load_configfile(source, filetype="Schema") _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ configpath_or_obj = '/tmp/guix-build-snakemake-7.26.0.drv-0/pytest-of-nixbld/pytest-0/test_dataframe0/schema/df.schema.yaml' filetype = 'Schema' def _load_configfile(configpath_or_obj, filetype="Config"): "Tries to load a configfile first as JSON, then as YAML, into a dict." import yaml if isinstance(configpath_or_obj, str) or isinstance(configpath_or_obj, Path): obj = open(configpath_or_obj, encoding="utf-8") else: obj = configpath_or_obj try: with obj as f: try: return json.load(f, object_pairs_hook=collections.OrderedDict) except ValueError: f.seek(0) # try again try: import yte > return yte.process_yaml(f, require_use_yte=True) E TypeError: process_yaml() got an unexpected keyword argument 'require_use_yte' snakemake/io.py:1699: TypeError ``` Co-authored-by: Johannes Köster <johannes.koester@tu-dortmund.de>
- Loading branch information