-
-
Notifications
You must be signed in to change notification settings - Fork 2k
TST: Disable IERS download for testing #10311
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
Conversation
|
Nice find! But would it be possible to go one step further in the pytest configuration in |
|
Setting |
|
I hope this works. Yet another option might be to have a doctest marking |
7f3fd24 to
3cf5386
Compare
That seems like a lot more work, as then the setting needs to be set at a per-test level. |
|
Ah, yes, and the This does look nice! But it seems the test failures are real: I guess for some tests we need to explicitly enable downloading now. (Can look later.) |
Yes. I added that as part of my todo in the original comment above. But before I spend the time fixing the tests, I need to know if we're really doing this. 😄 |
|
Fair enough to fix only once we all agree! FWIW, I'm in favour. Only tests that explicitly check for the updating should be allowed to try to get new versions. Perhaps the main question is how to do it. E.g., an alternative might be to use a configuration file in tests that turns downloading off. On balance, though, I think that what you have is better. Anyway, let's also bring in @astrofrog and @bsipocz... |
|
Looking at this again, I still like the solution. But I do worry about deleting |
Indeed if we want |
|
Okay, I'll reduce the scope when I get the chance. Thanks for the review! |
3cf5386 to
d230930
Compare
|
If this fails with the settings in |
|
Huh... The error I thought I would get didn't happen. I guess I'll fix the test failures and see what happens next. |
c8b5486 to
872b2ba
Compare
This comment has been minimized.
This comment has been minimized.
872b2ba to
a622e7e
Compare
|
Remote data job passed. |
astrofrog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me from a testing perspective, but maintainers of the relevant sub-packages should review the test updates.
| # skyfield ephemeris | ||
| try: | ||
| planets = load('de421.bsp') | ||
| ts = load.timescale() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might go against the intention here, but load.timescale(builtin=True) will suppress file download and use built-in copies of the leap second files instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was there already, just moved up so that if, somehow, skyfield tries to access the internet, we'll fail on jobs where we do not allow that. I think it is OK.
Also: the tests here are for specific times in the past, so should be OK not to update the leap-second list!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhvk , did you mean that I should have used ts = load.timescale(builtin=True) and not try to ignore its timeout error in CI? Can you please clarify? If so, I can open a follow-up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, sorry, I misunderstood here - this remains a remote-date test and what you did is exactly the right thing!
mhvk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
I must admit I'm also a bit confused that just changing astropy/conftest.py seems to solve not just the tests but also the docs, but, hey, not going to complain!
Could you open an issue for removing remote_date markers that were there just because of IERS downloads??
|
I'm merging since I think I can remove at least one |
|
Issue opened at #10457 . Thanks, everyone! |
|
@pllim - I am confused: I tried over in #10337 to remove a Now the build log is quite hard to parse, but if I do it locally I get a traceback which suggests the config change is not picked up: |
|
p.s. For now, I've just put the |
|
This is needed in LTS so I have updated the milestone and backported it. |
TST: Disable IERS download for testing
Description
This pull request is to follow-up on the idea in #10304 (comment) that we can disable auto-downloading of IERS data completely for testing purpose.
The proof-of-concept part of this is in
docs/coordinates/satellites.rstin that this fixes #10255 albeit slight changes in expected results. (This builds upon #10304 to disableof_sitedownload.)This also moves stuff fromastropy/conftest.pyup to root levelconftest.py, as stated in #10310.I took advantage of a set but unusedIf people are interested to disable it outside of testing environment, say, for computing clusters or multiprocessing, we might need to resort to setting system environment variable instead though I am not sure if even that would solve the problem for everyone because it solves the download problem but not if you still need to download something but has race condition in caching.builtins._pytest_runningvariable I saw inastropy/conftest.py.TODO
Bonus:
pathlibto handle file URIs.test_positions_skyfieldfailing CI.