Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'maison.schema' #286

Closed
christianversloot opened this issue Aug 19, 2024 · 8 comments
Closed

ModuleNotFoundError: No module named 'maison.schema' #286

christianversloot opened this issue Aug 19, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@christianversloot
Copy link

christianversloot commented Aug 19, 2024

Description

With yamlfix==1.16.0 our pipelines are no longer working:

Traceback (most recent call last):
  File "/usr/local/bin/yamlfix", line 5, in <module>
    from yamlfix.entrypoints.cli import cli
  File "/usr/local/lib/python3.10/site-packages/yamlfix/__init__.py", line 10, in <module>
    from yamlfix.services import fix_code, fix_files
  File "/usr/local/lib/python3.10/site-packages/yamlfix/services.py", line 13, in <module>
    from yamlfix.adapters import SourceCodeFixer, Yaml
  File "/usr/local/lib/python3.10/site-packages/yamlfix/adapters.py", line 14, in <module>
    from yamlfix.model import YamlfixConfig, YamlNodeStyle
  File "/usr/local/lib/python3.10/site-packages/yamlfix/model.py", line 5, in <module>
    from maison.schema import ConfigSchema
ModuleNotFoundError: No module named 'maison.schema'

This presumably occurs due to a new major release (1.x -> 2.0.0) of the maison package: https://pypi.org/project/maison/#history

Steps to reproduce

  1. pip install yamlfix
  2. yamlfix --verbose --check anyyamlfile.yml

Current behavior

See above.

Desired behavior

No error.

Environment

------------------------------------------------------------------
     yamlfix: 1.16.0
     Python: 3.11.7
     Platform: Windows-10-10.0.19045-SP0
------------------------------------------------------------------
@christianversloot christianversloot added the bug Something isn't working label Aug 19, 2024
@armallen
Copy link
Contributor

Had the same issue this morning, I temporarily added explicit version restrictions as a workaround #285

@menzenski
Copy link

This is hitting us as well. Thanks for the workaround @armallen !

@christianversloot
Copy link
Author

Thanks! Let's hope it's fixed soon.
Another workaround which worked for us is ensuring that the latest 1.x version of maison was installed before attempting to install yamlfix in the pipeline. Because that version of maison is acceptable given the dependencies range, its installation is not overwritten, and it works with pip-installed yamlfix. Of course, it's a temporary fix only :)

@rafrafek
Copy link

Here it could be limited to <2.0 as a hotfix:

https://github.com/lyz-code/yamlfix/blob/main/pyproject.toml#L31

@rafrafek
Copy link

For pre-commit users:

.pre-commit-config.yaml:

  - repo: https://github.com/lyz-code/yamlfix
    rev: "1.16.0"
    hooks:
      - id: yamlfix
        additional_dependencies:
          - 'maison<2.0.0'

popescu-v added a commit to KhiopsML/khiops-python that referenced this issue Aug 19, 2024
The `maison` dependency just had a new 2.0 release with breaking changes
(https://github.com/dbatten5/maison/releases/tag/v2.0.0) which break
yamlfix (see lyz-code/yamlfix#286).
missingcharacter added a commit to missingcharacter/janky-stuff that referenced this issue Aug 19, 2024
missingcharacter added a commit to missingcharacter/fpm-my-package that referenced this issue Aug 19, 2024
manthey added a commit to girder/large_image that referenced this issue Aug 20, 2024
Pin maison so yamlfix will still work.  See
lyz-code/yamlfix#286 for details.  The pinned
packages should be unpinned when that issues is addressed.
missingcharacter added a commit to missingcharacter/dot-files that referenced this issue Aug 21, 2024
missingcharacter added a commit to missingcharacter/dot-files that referenced this issue Aug 21, 2024
@lyz-code
Copy link
Owner

Available since 1.17.0 thanks to @armallen

@nfelt14
Copy link

nfelt14 commented Aug 21, 2024

Will there be a new tag created in GitHub so that we can update pre-commit configurations?

@lyz-code
Copy link
Owner

lyz-code commented Aug 21, 2024

Oups, I forgot to push it. There you have it @nfelt14. Thanks for pointing it out

tramora pushed a commit to KhiopsML/khiops-python that referenced this issue Aug 22, 2024
The `maison` dependency just had a new 2.0 release with breaking changes
(https://github.com/dbatten5/maison/releases/tag/v2.0.0) which break
yamlfix (see lyz-code/yamlfix#286).
popescu-v added a commit to KhiopsML/khiops-python that referenced this issue Aug 22, 2024
The `maison` dependency just had a new 2.0 release with breaking changes
(https://github.com/dbatten5/maison/releases/tag/v2.0.0) which break
yamlfix (see lyz-code/yamlfix#286).
popescu-v added a commit to KhiopsML/khiops-python that referenced this issue Aug 22, 2024
The `maison` dependency just had a new 2.0 release with breaking changes
(https://github.com/dbatten5/maison/releases/tag/v2.0.0) which break
yamlfix (see lyz-code/yamlfix#286).
popescu-v added a commit to KhiopsML/khiops-python that referenced this issue Aug 22, 2024
The `maison` dependency just had a new 2.0 release with breaking changes
(https://github.com/dbatten5/maison/releases/tag/v2.0.0) which break
yamlfix (see lyz-code/yamlfix#286).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants