Helioviewer-Project / python-api

Python wrapper around the Helioviewer API.
https://hvpy.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
6 stars 5 forks source link

Test py311 and support pydantic 2.0 and above #97

Closed nabobalis closed 11 months ago

nabobalis commented 1 year ago

Fixes https://github.com/Helioviewer-Project/python-api/issues/96

TODO:

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +1.50 :tada:

Comparison is base (69e589a) 97.44% compared to head (75a90bd) 98.95%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #97 +/- ## ========================================== + Coverage 97.44% 98.95% +1.50% ========================================== Files 38 38 Lines 941 960 +19 ========================================== + Hits 917 950 +33 + Misses 24 10 -14 ``` | [Impacted Files](https://app.codecov.io/gh/Helioviewer-Project/python-api/pull/97?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Helioviewer-Project) | Coverage Δ | | |---|---|---| | [hvpy/facade.py](https://app.codecov.io/gh/Helioviewer-Project/python-api/pull/97?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Helioviewer-Project#diff-aHZweS9mYWNhZGUucHk=) | `97.18% <ø> (ø)` | | | [hvpy/helpers.py](https://app.codecov.io/gh/Helioviewer-Project/python-api/pull/97?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Helioviewer-Project#diff-aHZweS9oZWxwZXJzLnB5) | `96.15% <ø> (+15.38%)` | :arrow_up: | | [hvpy/api\_groups/jpeg2000/get\_jp2\_image.py](https://app.codecov.io/gh/Helioviewer-Project/python-api/pull/97?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Helioviewer-Project#diff-aHZweS9hcGlfZ3JvdXBzL2pwZWcyMDAwL2dldF9qcDJfaW1hZ2UucHk=) | `100.00% <100.00%> (ø)` | | | [hvpy/api\_groups/jpeg2000/get\_jpx.py](https://app.codecov.io/gh/Helioviewer-Project/python-api/pull/97?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Helioviewer-Project#diff-aHZweS9hcGlfZ3JvdXBzL2pwZWcyMDAwL2dldF9qcHgucHk=) | `100.00% <100.00%> (ø)` | | | [...pi\_groups/jpeg2000/get\_jpx\_closest\_to\_mid\_point.py](https://app.codecov.io/gh/Helioviewer-Project/python-api/pull/97?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Helioviewer-Project#diff-aHZweS9hcGlfZ3JvdXBzL2pwZWcyMDAwL2dldF9qcHhfY2xvc2VzdF90b19taWRfcG9pbnQucHk=) | `100.00% <100.00%> (ø)` | | | [...py/api\_groups/jpeg2000/tests/test\_get\_jp2\_image.py](https://app.codecov.io/gh/Helioviewer-Project/python-api/pull/97?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Helioviewer-Project#diff-aHZweS9hcGlfZ3JvdXBzL2pwZWcyMDAwL3Rlc3RzL3Rlc3RfZ2V0X2pwMl9pbWFnZS5weQ==) | `100.00% <100.00%> (ø)` | | | [hvpy/api\_groups/jpeg2000/tests/test\_get\_jpx.py](https://app.codecov.io/gh/Helioviewer-Project/python-api/pull/97?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Helioviewer-Project#diff-aHZweS9hcGlfZ3JvdXBzL2pwZWcyMDAwL3Rlc3RzL3Rlc3RfZ2V0X2pweC5weQ==) | `100.00% <100.00%> (+10.71%)` | :arrow_up: | | [...peg2000/tests/test\_get\_jpx\_closest\_to\_mid\_point.py](https://app.codecov.io/gh/Helioviewer-Project/python-api/pull/97?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Helioviewer-Project#diff-aHZweS9hcGlfZ3JvdXBzL2pwZWcyMDAwL3Rlc3RzL3Rlc3RfZ2V0X2pweF9jbG9zZXN0X3RvX21pZF9wb2ludC5weQ==) | `100.00% <100.00%> (+10.71%)` | :arrow_up: | | [hvpy/api\_groups/movies/queue\_movie.py](https://app.codecov.io/gh/Helioviewer-Project/python-api/pull/97?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Helioviewer-Project#diff-aHZweS9hcGlfZ3JvdXBzL21vdmllcy9xdWV1ZV9tb3ZpZS5weQ==) | `100.00% <100.00%> (ø)` | | | [...y/api\_groups/official\_clients/get\_closest\_image.py](https://app.codecov.io/gh/Helioviewer-Project/python-api/pull/97?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Helioviewer-Project#diff-aHZweS9hcGlfZ3JvdXBzL29mZmljaWFsX2NsaWVudHMvZ2V0X2Nsb3Nlc3RfaW1hZ2UucHk=) | `100.00% <100.00%> (ø)` | | | ... and [6 more](https://app.codecov.io/gh/Helioviewer-Project/python-api/pull/97?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Helioviewer-Project) | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

dgarciabriseno commented 11 months ago

I made a PR to this CI branch, it fixes the test failures.

Work out why some of the movie tests timeout

There was some aggressive caching going on server side. So while the movies where done, the API would still return the cached status of "Queued" causing the test to time out when it shouldn't.

Work out what source ID 37 is and add it.

This was IRIS which I recently added to HV. My patch also includes data sources for new GONG images as well.

Work out why the screenshot return is not a URL

This was another server side issue. the png it's claiming it can't find is a little highlighted active region that gets overlayed on the screenshot. The file was in the db but wasn't on disk. I'm not sure why this happened, but it should be fixed for this and all future screenshots.

dgarciabriseno commented 11 months ago

build_docs is still failing. Looks like it has to do with the pydantic 2.0 version bump

WARNING: Failed guarded type import with ImportError("cannot import name 'AbstractSetIntStr' from 'pydantic._internal._utils' (/home/runner/work/python-api/python-api/.tox/build_docs/lib/python3.11/site-packages/pydantic/_internal/_utils.py)")
nabobalis commented 11 months ago

Thanks, I will look into and patch it now.

nabobalis commented 11 months ago

That seems like a bug upstream in pydanatic. It only creates a warning which does not affect the final documentation build.

I will try to see if I can replicate it in a simpler env and report upstream.

nabobalis commented 11 months ago

@dgarciabriseno Would you ok with doing a release of this, or shall I tag it?

Also I feel with the bump in pydanatic, a 1.1.0 version feels more appropriate?

dgarciabriseno commented 11 months ago

Yep, I can tag it.

nabobalis commented 11 months ago

I forgot to check if the release job requires the docs build to pass, if so we will need to change that and update the tagged commit.

dgarciabriseno commented 11 months ago

Yea it doesn't reach publish with docs build failing