tutor icon indicating copy to clipboard operation
tutor copied to clipboard

build: add python 3.12 checks alongside 3.8

Open DawoudSheraz opened this issue 1 year ago • 2 comments

For #1006

Description

  • Adds Python 3.12 checks in CI alongside 3.8
  • Fix make docs in Python 3.12

make docs in Python 3.12 was failing for various reasons for variety of items (Action, Filter, FilterCallbackFunc). Mainly, the generic type does not get translated to py:class and is instead picked up as py:data. There were a few issues on Sphinx and some related items on Stackoverflow. Everyone handled it differently in some capacity. One suggestion was to ignore some of the type params but it did not result in docs building as expected (https://github.com/overhangio/tutor/pull/1008#issuecomment-1968906467). The appropriate fix for "Action & Filter" was to add entries in autodoc_type_aliases. FilterCallbackFunc was needed to be ignore because it does not translate to a py:class.

DawoudSheraz avatar Feb 23 '24 06:02 DawoudSheraz

The docs build failure seems to be an old one https://github.com/overhangio/tutor/pull/775#issuecomment-1405208608. I will attempt a shot at fixing it.

DawoudSheraz avatar Feb 23 '24 07:02 DawoudSheraz

The docs build issue mainly happens because Sphinx is not able to correctly identify type params. It tends to translate each param variation into a separate py:class entity, thus leading into errors when running in nitpick mode. One of the ways was to ignore the patterns via nitpick_ignore_regex but it resulted in docs not building as expected.

  • https://docs.plasmapy.org/en/stable/contributing/doc_guide.html#reference-target-not-found
  • https://github.com/sphinx-doc/sphinx/issues/10974
  • https://github.com/sphinx-doc/sphinx/issues/10785
image

DawoudSheraz avatar Feb 28 '24 12:02 DawoudSheraz