Fix up issues on Python 3.8

Review Request #14677 — Created Nov. 6, 2025 and updated

Information

Review Board
release-7.1.x

Reviewers

We had a bunch of issues sneak into the codebase that made it impossible
to set up or run the release-7.1.x branch against Python 3.8. This
change fixes them up:

  • Our pyproject.toml file required setuptools>=77, but the last release
    that supports 3.8 was 75.
  • Once that was fixed, I was getting errors about the format of the
    license lines.
  • There were several few places where type annonations were getting
    evaluated, primarily in generics, TypeAliases, and Pydantic models.
    We had a number of places where we had more-modern syntax (type[...],
    |-syntax for unions) or were getting things from collections.abc
    that needed to come from typing because the collections versions
    don't support subscripts for 3.8.
  • Some of the new hosting services stuff was using str.removeprefix(),
    which was introduced in Python 3.9.

Set up a Python 3.8 environment and ran unit tests.

Summary ID
Fix up issues on Python 3.8
We had a bunch of issues sneak into the codebase that made it impossible to set up or run the release-7.1.x branch against Python 3.8. This change fixes them up: - Our pyproject.toml file required setuptools>=77, but the last release that supports 3.8 was 75. - Once that was fixed, I was getting errors about the format of the license lines. - There were several few places where type annonations were getting evaluated, primarily in generics, `TypeAlias`es, and Pydantic models. We had a number of places where we had more-modern syntax (`type[...]`, `|`-syntax for unions) or were getting things from `collections.abc` that needed to come from `typing` because the collections versions don't support subscripts for 3.8. - Some of the new hosting services stuff was using `str.removeprefix()`, which was introduced in Python 3.9. Testing Done: Set up a Python 3.8 environment and ran unit tests.
yplwuvwznpyrmvrxuylzostnysstmpky
Description From Last Updated

This will be a problem. The new format is incompatible with newer setuptools (if they haven't full-on failed with the …

chipx86chipx86
Checks run (2 succeeded)
flake8 passed.
JSHint passed.
maubin
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. pyproject.toml (Diff revision 1)
     
     
     
    Show all issues

    This will be a problem.

    The new format is incompatible with newer setuptools (if they haven't full-on failed with the old format yet, they're planning to). So we can't really go with this and a >= version range for setuptools.

    Do you get any warnings right now? What do they look like? Last I messed with this, the world was in a bit of a broken state, full of bug reports, so if it's working at all now they may have reverted behavior somewhere.

    1. This is what we have in the djblets codebase currently (though that has setuptools>=74).

      With this, I can do pip install -e with nothing related to license showing up with both 3.8/setuptools 75.3.2 and 3.12/setuptools 80.9.0.

  3.