-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Conversation
A couple of issues here: The test here requires a kernel to be built first, so we should also probably exclude it. Also, can you install this and check that all the tests do pass? |
Not sure why this is a problem --- does it just take too long to run / too much disk? I feel like including the whole test suite in a source distribution makes sense, and it feels a bit odd to selectively remove things from a tarball that is supposed to encompass the source + everything needed to run it and ensure it works.
I think this test will automatically skip if there isn't a CUDA device. I've run it on a GPU machine and never done anything special with the extensions (i.e., explicitly compile it) and it seems to work ok? Also in favor of leaving it for the reasons above (completeness). Arguably, it's valuable information for the user if they run this test and see that it fails. |
Ah the GPU one is pre-compiled, so yes it would work on a GPU machine with the right compute requirements, so that's actually fine. We should definitely remove the |
I think this is useful for more than just users of allennlp, though --- I'm personally interested in using the pypi tarball to package allennlp for other distribution channels (particularly conda), and it's nice to be able to run the entire test suite as part of the build process to ensure that the package is correctly built. |
@nelson-liu thanks for all the build-related PRs! Can you give me a code example for what the change in this PR enables? I don't know too much about |
@schmmd this would fix #856, by just including the tests in the pip install. I'm not sure how the tests would be invoked, though; @nelson-liu will have to tell us that. |
right, so this lets you do I like @joelgrus 's suggestion of making a new command that just runs all the tests. |
btw, I more or less have code for #856 already, but the annoying thing is that all the tests have paths that are hardcoded assuming that you're running any other ideas before I take the plunge? |
can the code do an |
I'm not sure it's worth taking the plunge, and I'll defer to others about other potential solutions here, but if you do take the plunge, would switching to using |
@joelgrus awesome, that works! I'll push this up for now and you all can decide whether it's an acceptable solution and/or whether the move should be made to switching to paths in tests from something like |
btw, os.path.join is old and uncool, if we go that route we should do (in test_case.py)
and then use it like
|
@DeNeutoy doesn't like the fancy syntax =). Too much like scala? I didn't know you could do that, though, that's good to know. But I was more worried about the |
I think you can use |
pinging back about this, is there anything else that should be discussed? |
I think the only outstanding question for this PR is whether to add an |
I see. I think it's worth including for completeness of the source distribution + hopefully #1213 solves the problem of users being surprised that the tests are downloading large files and taking awhile. Besides, users who |
Deferring to @DeNeutoy, who's thought about this more than me. |
Last build-related PR, sorry! It's quite surprising to me that
setup.py
has commands for running the tests, but the tests aren't actually included in the source distribution that is uploaded to PyPI.Let me know if there's a good reason for not distributing the tests with the tarball source distribution --- afaik, distutils includes directories named
test
by default, which seems like a pretty sane decision to me.