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

Include test data in PyPi tarballs #21

Closed
Atemu opened this issue Feb 7, 2020 · 7 comments
Closed

Include test data in PyPi tarballs #21

Atemu opened this issue Feb 7, 2020 · 7 comments

Comments

@Atemu
Copy link

Atemu commented Feb 7, 2020

I'm trying to package jc for Nix and would prefer to run the tests but they fail because they can't find their test data.

@kellyjonbrazil
Copy link
Owner

Hi Atemu, aren't all of the tests and fixtures available by cloning this repository?

@Atemu
Copy link
Author

Atemu commented Feb 7, 2020

Yes but I'd rather use PyPi as the source because that'd allow you to update the package by version number instead of git revision (e.g. "1.7.1" vs. "77d334f7f386f79ec0571325500054fdab207f31").

See the comment in https://github.com/NixOS/nixpkgs/blob/db427f7f5ebee23823bf65c74b901b3c8ed6f4f5/pkgs/development/python-modules/jc/default.nix, it makes things clearer and easier to read.

Also, I think that if tests are included in a distribution of source code, you should be able to run them successfully.

@kellyjonbrazil
Copy link
Owner

Gotcha - I opened the package zip and I see the tests are there but not the fixtures since setup.py only includes python files by default. Looks like there are a couple of options to add the fixtures in. I'll research the best approach (MANIFEST.in vs package_data in setup.py)

@kellyjonbrazil
Copy link
Owner

Hi Atemu,

I think I have the test fixtures added in v1.7.2, now available on pypi. Could you let me know if that works for you or if I need to make any more adjustments?

Thanks,
kb

@Atemu
Copy link
Author

Atemu commented Feb 9, 2020

It works, thank you!

@Atemu Atemu closed this as completed Feb 9, 2020
@kellyjonbrazil
Copy link
Owner

kellyjonbrazil commented May 7, 2020

@Atemu I am considering removing the tests from the package since it looks like they are polluting the top-level python site-packages on install. Would that be ok? I need to do this for homebrew and fedora packaging.

see: #58

@Atemu
Copy link
Author

Atemu commented May 7, 2020

It'd be a very minor inconvenience for me but that's not a good reason to make packaging for other projects harder.

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