GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Should test with free-threaded interpreter on CI · Issue #2005 · gitpython-developers/GitPython

Should test with free-threaded interpreter on CI #2005

New issue
Copy link
New issue
Copy link
Closed
#2011
Closed
Should test with free-threaded interpreter on CI#2005
#2011
Copy link
Labels
acknowledgedhelp wanted

Description

@EliahKagan
EliahKagan
opened on Feb 20, 2025
Issue body actions

Since Python 3.13, CPython supports building free-threaded interpreters, i.e. builds that support running with no global interpreter lock and mostly using a combination of narrower locks and lock-free synchronization instead. I think we should test with this on CI, if feasible.

Often the reason to do so would be to find concurrency bugs that might be surfaced or exacerbated by running without a GIL. However, for GitPython, that is not my main motivation. Rather, GitPython has observable behavioral changes under some changes to the interpreter's garbage collector implementation. It seems like this sometimes happens even with modest changes to the garbage collector. For example, from #1767, referencing python/cpython#97922:

GitPython/test/test_submodule.py

Lines 988 to 992 in e034cec

# This is needed to work around a PermissionError on Windows, resembling others,
# except new in Python 3.12. (*Maybe* this could be due to changes in CPython's
# garbage collector detailed in https://github.com/python/cpython/issues/97922.)
if sys.platform == "win32" and sys.version_info >= (3, 12):
gc.collect()

I expect that differences in GC details arising from the difference between a GIL and free-threaded builds may also have relevant effects. While the need to call gc.collect in the test suite is usually confined to Windows (to force objects' __del__ method to be called, to close files, so the files can be deleted), I think it's valuable to test this on other systems as well.

Actually, I think it may be reasonable to test free-threaded builds only on Linux-based systems, at least initially. (If problems on Windows arise, then it will become more important to test them on Windows to detect regressions.) This is because such builds are easier to set up on CI on such systems, and because if something breaks on free-threaded interpreters that was already, in practice, working very well before, then that should be known.

So I think that while #1990 was certainly a blocker for this, #1955 is not, and that this could therefore be contributed at any time. However, in my opinion, #1955 is still higher priority than this, as are the other portability maintenance issues #2003 and #2004. I don't know if and when I would get to those, and I hope others will be able to help out; in view of that, it could be a while until I get to this, so I'm opening an issue so it is not forgotten.

It may also make sense to wait until the setup-python action gains the ability to install free-threaded builds. Based on actions/setup-python#771, I think that's not available yet, though based on actions/python-versions#319 being merged earlier today, it may be coming soon. However, there are also alternative actions that can install a free-threaded build, and various other installation methods that use prebuilt binaries.

Activity

  1. Byron
    added
    acknowledged
    help wanted
    on Feb 21, 2025
  2. Byron commented on Feb 21, 2025

    @Byron
    Byron
    on Feb 21, 2025
    Member
    More actions

    Thanks for bringing this up.
    I also agree that it would be sufficient to start minimal and run the test-suite on threaded python on Linux only until there is a need for more.

  3. EliahKagan
    added 5 commits that reference this issue on Mar 7, 2025

    Test on free-threaded Python

    0fac4ad

    Test on free-threaded Python

    4f013c2

    Only test free-threaded Python on Linux

    1af7fc0

    Test on free-threaded Python

    f1dbe33

    Only test free-threaded Python on Linux

    fd78857
  4. EliahKagan commented on Mar 7, 2025

    @EliahKagan
    EliahKagan
    on Mar 7, 2025
    MemberAuthor
    More actions

    I've opened #2011 for this.

    Reacted by Sebastian Thiel
  5. Byron
    added 2 commits that reference this issue on Mar 12, 2025

    Test on free-threaded Python

    c13d998

    Only test free-threaded Python on Linux

    56038c3
  6. Byron
    closed this as completedin #2011on Mar 12, 2025
  7. EliahKagan
    added 3 commits that reference this issue on May 30, 2025

    Add CI test job for no-GIL ("threaded") Python 3.13

    829d9bc

    Add CI test job for no-GIL ("threaded") Python 3.13

    8d57ac7

    Add CI test job for no-GIL ("threaded") Python 3.13

    90738a9
  8. EliahKagan
    added 3 commits that reference this issue on Mar 9, 2026

    Test free-threaded interpreter on macOS

    17ff9ac

    Test free-threaded interpreter on macOS

    9730c9d

    Test free-threaded interpreter on macOS

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgedhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.