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
Backport PR #11962: Fix warnings with Python 3.10 #12159
Conversation
Why does this look familiar, @eslavich ?
|
G-g-g-g-g-g-ghosts! |
Hmm, that was a failure in the original PR that apparently went away after I ignored it long enough: I don't suppose that strategy will prove effective here... |
Is there another PR need backporting or what? 🤷 |
Tests with asdf are still failing... |
@eslavich , this doesn't ring any bell at all?
|
Maybe this isn't as critical if we'll never do another v4.3.x release... Still would be nice to have closure, @eslavich . |
I spent some time today trying to reproduce this on my (macOS) laptop, no success so far. The failing tests all pass with Python 3.10, asdf master, and astropy 4.3.1. |
@eslavich , did you turn warnings into failures like we do? |
p.s. You should maybe try with this branch, not the released 4.3.1. |
Unfortunately I'm not currently able to install astropy from source with Python 3.10 due to a compiler issue that I haven't had the time to troubleshoot. This is the error in case someone has already slain this particular dragon:
|
Hmm... |
I have no clue about that error. There are Python 3.10 wheels for 5.0rc1: https://pypi.org/project/astropy/5.0rc1/#files |
Can't really say what's going wrong there, but I don't recall ever seeing it in my 3.10 builds. #if PY_VERSION_HEX >= 0x030900A4
#define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
#define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
#define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
#define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif |
This is the compiler it's using:
|
I tried fiddling with the compiler versions, to no avail, but then I deleted the The tests are still passing on my laptop with: Python 3.10 It is turning warnings into errors -- I plunked down a warning into one of the tests and got it to fail. |
Well, that's a much more up-to-date Xcode than my Mojave installation.
😮 No |
For this PR pulled into 4.3.x, I don't see any failures on testing lib/python3.10/site-packages/astropy/io/fits/tests/test_table.py::TestVLATables::test_variable_length_table_format_pd_from_list
lib/python3.10/site-packages/astropy/io/fits/tests/test_table.py::TestVLATables::test_copy_vla
lib/python3.10/site-packages/astropy/io/fits/tests/test_table.py::TestColumnFunctions::test_p_column_deepcopy
/Users/derek/lib/python3.10/site-packages/astropy/io/fits/column.py:649: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
array = np.array(array)
lib/python3.10/site-packages/astropy/io/fits/tests/test_table.py::TestVLATables::test_vla_with_gap
/opt/lib/python3.10/site-packages/_pytest/python.py:183: ResourceWarning: unclosed file <_io.FileIO name='/Users/derek/lib/python3.10/site-packages/astropy/io/fits/tests/data/theap-gap.fits' mode='rb' closefd=True>
result = testfunction(**testargs)
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/coordinates/tests/test_angle.py::test_angle
/opt/lib/python3.10/site-packages/asdf/entry_points.py:44: AsdfWarning: asdf.resource_mappings plugin from package asdf==2.8.1 failed to load:
RuntimeError: Unable to locate core schemas
warnings.warn(
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/coordinates/tests/test_angle.py: 9 warnings
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/coordinates/tests/test_earthlocation.py: 18 warnings
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/coordinates/tests/test_frames.py: 15 warnings
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/coordinates/tests/test_representation.py: 42 warnings
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/coordinates/tests/test_skycoord.py: 34 warnings
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/coordinates/tests/test_spectralcoord.py: 9 warnings
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/fits/tests/test_fits.py: 7 warnings
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/table/tests/test_table.py: 36 warnings
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/time/tests/test_time.py: 15 warnings
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/time/tests/test_timedelta.py: 36 warnings
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/transform/tests/test_transform.py: 534 warnings
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/transform/tests/test_units_mapping.py: 18 warnings
lib/python3.10/site-packages/astropy/io/misc/asdf/tags/unit/tests/test_equivalency.py: 75 warnings
/opt/lib/python3.10/site-packages/asdf/tests/httpserver.py:44: DeprecationWarning: isSet() is deprecated, use is_set() instead
while not stop_event.isSet(): |
Ah ha! Thanks @dhomeier, I had asdf installed in editable mode and that's the difference. I can reproduce this now. |
The ASDF problem is due to an issue in pytest that has been fixed in main but not yet released: It goes away when dev pytest is installed. |
I still don't understand why it is only a problem in this PR but not in |
A load order thing I wonder? The problem occurs because pytest replaces one of the importlib.resources objects with an assertion rewriting proxy that doesn't implement a new 3.10 method. If asdf is able to load the entry point before that gets subbed in, there isn't an issue. We did see this failure in the original PR but then it disappeared after the branch was updated. |
@saimn , so maybe we should just ignore that warning here? Is that possible? |
Do we still need this? I don't think we will release 4.x anymore. |
Yep, closing. |
Description
Backport PR #11962
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
Extra CI
label.no-changelog-entry-needed
label. If this is a manual backport, use theskip-changelog-checks
label unless special changelog handling is necessary.astropy-bot
check might be missing; do not let the green checkmark fool you.backport-X.Y.x
label(s) before merge.