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

Including data files in the package directory #149

Merged
merged 1 commit into from
Apr 14, 2020

Conversation

migueldvb
Copy link
Contributor

The data file in the tests is not currently not installed in the package directory. Although pytest works fine from the tests directory, running the unyt.test() function gives this error message:

_________________________ test_old_registry_json __________________________

    def test_old_registry_json():
        path = os.sep.join([os.path.dirname(__file__), "old_json_registry.txt"])
>       with open(path) as f:
E       FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/site-packages/unyt-2.7.1+2.g57744cc-py3.8.egg/unyt/tests/old_json_registry.txt'

/usr/local/lib/python3.8/site-packages/unyt-2.7.1+2.g57744cc-py3.8.egg/unyt/tests/test_unit_registry.py:97: FileNotFoundError

Adding the package_data argument to the setup function to specify the files that are included in the package directory fixes the FileNotFoundError.

@ngoldbaum
Copy link
Member

Fair enough, thanks for the fix! If you’re up for it, modifying the tox config to add a test run on only one python version (no need to run it over and over for all versions) that imports unyt and runs unyt.test(), that would be awesome. I’ll merge this without the test change but it would be nice to have CI for unyt.test() so we don’t regress for another reason in the future.

@ngoldbaum ngoldbaum merged commit 080665a into yt-project:master Apr 14, 2020
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

Successfully merging this pull request may close these issues.

2 participants