Skip to content

Test py311 and support pydantic 2.0 and above#97

Merged
nabobalis merged 4 commits intomainfrom
ci
Jul 10, 2023
Merged

Test py311 and support pydantic 2.0 and above#97
nabobalis merged 4 commits intomainfrom
ci

Conversation

@nabobalis
Copy link
Member

@nabobalis nabobalis commented Jul 1, 2023

Fixes #96

TODO:

  • Work out why some of the movie tests timeout

  • Work out why the screenshot return is not a URL

    • ->           raise RuntimeError(res["error"])
      E           RuntimeError: unable to open image `/var/www/api.helioviewer.org/docroot/cache/events/2023/06/16/ivo%3A%2F%2Fhelio-informatics.org%2FAR_SPoCA_20230620_232600_20230616T180346_4.png': No such file or directory @ error/blob.c/OpenBlob/2874
  • Work out what source ID 37 is and add it.

    >           assert source_id in enum_values
    E           assert 37 in [0, 1, 2, 3, 4, 5, ...]

@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2023

Codecov Report

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

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

❗ 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
@@            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 Coverage Δ
hvpy/facade.py 97.18% <ø> (ø)
hvpy/helpers.py 96.15% <ø> (+15.38%) ⬆️
hvpy/api_groups/jpeg2000/get_jp2_image.py 100.00% <100.00%> (ø)
hvpy/api_groups/jpeg2000/get_jpx.py 100.00% <100.00%> (ø)
...pi_groups/jpeg2000/get_jpx_closest_to_mid_point.py 100.00% <100.00%> (ø)
...py/api_groups/jpeg2000/tests/test_get_jp2_image.py 100.00% <100.00%> (ø)
hvpy/api_groups/jpeg2000/tests/test_get_jpx.py 100.00% <100.00%> (+10.71%) ⬆️
...peg2000/tests/test_get_jpx_closest_to_mid_point.py 100.00% <100.00%> (+10.71%) ⬆️
hvpy/api_groups/movies/queue_movie.py 100.00% <100.00%> (ø)
...y/api_groups/official_clients/get_closest_image.py 100.00% <100.00%> (ø)
... and 6 more

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

@nabobalis nabobalis changed the title Test for 311 Test py311 and support pydantic 2.0 and above Jul 1, 2023
@dgarciabriseno
Copy link
Collaborator

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.

* Add IRIS and GONG datasources

* Update timeout test to have a shorter timeout

* Fix codestyle

* Increase test timeout to 2 minutes
@dgarciabriseno
Copy link
Collaborator

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
Copy link
Member Author

Thanks, I will look into and patch it now.

@nabobalis
Copy link
Member Author

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 nabobalis merged commit fc558ac into main Jul 10, 2023
@nabobalis nabobalis deleted the ci branch July 10, 2023 21:45
@nabobalis
Copy link
Member Author

@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
Copy link
Collaborator

Yep, I can tag it.

@nabobalis
Copy link
Member Author

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
Copy link
Collaborator

Yea it doesn't reach publish with docs build failing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Pydantic 2.0

3 participants