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

model_catalogs doesn't import from full install #17

Open
ChrisBarker-NOAA opened this issue May 12, 2022 · 4 comments
Open

model_catalogs doesn't import from full install #17

ChrisBarker-NOAA opened this issue May 12, 2022 · 4 comments

Comments

@ChrisBarker-NOAA
Copy link
Contributor

If I do:

pip install model_catalogs

then I can't import it:

$ python -c "import model_catalogs"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/chris.barker/miniconda3/envs/gnome_test/lib/python3.8/site-packages/model_catalogs/__init__.py", line 59, in <module>
    shutil.copy(
  File "/Users/chris.barker/miniconda3/envs/gnome_test/lib/python3.8/shutil.py", line 418, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/Users/chris.barker/miniconda3/envs/gnome_test/lib/python3.8/shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/chris.barker/miniconda3/envs/gnome_test/lib/python3.8/site-packages/model_catalogs/catalogs/transform.yaml'

I think there's a data file not getting installed.

It works if you use an editable install.

@ChrisBarker-NOAA
Copy link
Contributor Author

NOTE: I added the data files, but it won't actually work correctly.

The tests fail with:
"complete" model source files are not yet available. Run model_catalogs.complete_source_catalog() to create this directory.

But that won't work with a proper install -- it will only work with an editable install.

Not too horrible while under active development -- but I think we need to be a bit more clear about code vs data, and where generated files with be stored.

@lukecampbell
Copy link
Collaborator

@ChrisBarker-NOAA is this still an issue?

@ChrisBarker-NOAA
Copy link
Contributor Author

Looks like this is working now -- closing.

@ChrisBarker-NOAA
Copy link
Contributor Author

Reopening because I just noticed that the CI tests are using an editable install for the tests:

        run: |
          python -m pip install -e . --no-deps --force-reinstall

I think the tests should probably use a regular, non-editable install, to avoid similar issues arising in the future.

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

2 participants