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

test failed with importlib_resources==6.3.1 (required by hydra-core) #637

Open
oferfrid opened this issue Mar 19, 2024 · 0 comments
Open

Comments

@oferfrid
Copy link

oferfrid commented Mar 19, 2024

reproduce:

git clone git@github.com:ashleve/lightning-hydra-template.git
cd lightning-hydra-template
virtualenv --python=/usr/bin/python3.8 venv
source venv/bin/activate.csh
pip install -r requirements.txt
python -m pytest tests/test_configs.py::test_train_config

result:

ERROR tests/test_configs.py::test_train_config - AttributeError: 'OrphanPath' object has no attribute 'exists'

self = provider=hydra, path=pkg://hydra.conf, config_path = 'train.yaml'

def is_config(self, config_path: str) -> bool:
    config_path = self._normalize_file_name(config_path)
    try:
        files = resources.files(self.path)
    except (ValueError, ModuleNotFoundError, TypeError):
        return False
    res = files.joinpath(config_path)
  ret = res.exists() and res.is_file()

E AttributeError: 'OrphanPath' object has no attribute 'exists'

venv_v203_test/lib/python3.8/site-packages/hydra/_internal/core_plugins/importlib_resources_config_source.py:87: AttributeError

pip freeze:
venv.txt

workaround:

add explicit version to requirements.txt:
importlib-resources==6.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant