-
-
Notifications
You must be signed in to change notification settings - Fork 471
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
[WIP] Add possibility to switch off use of external data in tests #1801
Conversation
@darcymason - this is just to show what I did. About 350 of the 2800+ plus tests seem to depend on external data and will not be run if NO_EXTERNAL_DATA is set to 1. |
a5caa01
to
5985d41
Compare
- depends on env var NO_EXTERNAL_DATA being 1 - moved all usages of get_testdata_file() into tests and fixtures - change old-style setup() to fixtures
5985d41
to
33eb8b5
Compare
Codecov Report
@@ Coverage Diff @@
## master #1801 +/- ##
==========================================
- Coverage 97.41% 97.39% -0.03%
==========================================
Files 66 66
Lines 10839 10845 +6
==========================================
+ Hits 10559 10562 +3
- Misses 280 283 +3
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Thanks for looking into this and experimenting with options.
So, any thoughts on which way to go? I've had a quick look through here and have some questions/observations, to at least help with discussion about how to approach this:
Some more nitpicking things:
This is a complex issue, again thanks for taking some steps, hopefully we can close in on some consensus. My $0.02 Cdn. |
This was not planned. I started with replacing the global calls of
Agreed. As the use case here is mainly packaging, we could indeed make different packages - with and without tests. As an aside: I'm not much in favour of deploying tests within the wheel packages (what we currently do, though not the tests in I'm inclined to think that for installing the So, at least for the 2.4 release, I tend to just remove the tests at all from packaging (not sure how to do this, but it can certainly be done).
Agreed. I added a few
Yes - but as I called fixtures in
Well, it depends. In the case of |
I'm open to that idea. I had originally always bundled tests with pydicom because I thought they might serve as a form of example for users (and the test files provided various kinds of DICOM SOP classes to experiment with). But I think we are long past that now, there is much more documentation and various blogs and other code on the internet with pydicom examples.
That's an interesting point I hadn't thought of. But this gets at what I was asking in issue #1800, if tests were really necessary. We don't release without our full CI passing, so there is no reason to run the tests on any pydicom distribution, but as you point out, that's likely only really true with pure Python packages.
One problem I realized with this, is that I still think we should be able to install pydicom without numpy, e..g. for very minimal environments like pyodide. I think if the default install is without numpy, then perhaps a set of non-numpy tests should be able to be run to ensure things work in that enviroment.
Fair point. I agree that in some cases one self-contained fixture is easier to grok than a separate setup and teardown. |
So maybe we for the release, we just can remove the tests and test data from packaging (e.g. from the manifest), change |
Possibly. I'm not clear if the manifest is enough or whether we have to specify to not include package data as well (or specifically exclude tests?). The other possibility, mentioned before, (I'll try to investigate tomorrow) is if there is a way to simply produce an sdist with and without the tests, which would solve #1800 while minimally changing everything else. |
I was reading about Python packaging for a while yesterday, my head was starting to hurt 🙉. I don't see anything simple that can produce alternate build paths, so I guess we are left with removing tests in the build for next release. I'm not even clear on how to do that with the new pyproject.toml style, so suggestions welcome. However, I've been reading up on the whole packaging ecosystem, and trying to think defensively for the longer term, I've opened a new issue to track/discuss options... Please see #1802. |
Yes, packaging in Python feels like rocket science... I also don't have a real grasp on it yet.
I think this part is still in |
There is also package discovery in
I remember having to add that, but I don't remember why. There is a syntax for finding/excluding packages, etc. that I came across but this one was the one needed in that PR. However, maybe it doesn't matter - if we move |
@darcymason - I will be travelling for a week, so from tomorrow onwards I will have no access to a computer (apart from my phone). So, if you plan to make the release soon, I won't be able to help (apart from trivial reviews). As they closed the team discussions, I find no convenient place to put this kind of information... or did we discuss this already? I dimly remember some related discussion, but it may have been elsewhere... |
Thanks for letting me know ... I do plan on releasing soon, but we'll see if I can get around to it. I'm thinking now to just leave the remaining issues tagged for this release until the next one, except to make a build without the tests. That is, unless you (or anyone else) has an urgent issue which you think should be included. |
No, I'm fine :) |
Tasks
doc/_build/html/index.html
)