Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coverage.tracer thread-safety warning with Python 3.13 free-threaded #1799

Closed
lesteve opened this issue Jun 20, 2024 · 3 comments
Closed

coverage.tracer thread-safety warning with Python 3.13 free-threaded #1799

lesteve opened this issue Jun 20, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@lesteve
Copy link

lesteve commented Jun 20, 2024

Is your feature request related to a problem? Please describe.

I am testing Python 3.13 free-threaded in joblib and I get the following warning when running the tests through pytest with the following command-line:

+ PYTEST_ADDOPTS='--cov=joblib --cov-append'
+ pytest joblib -vl --timeout=120 --junitxml=test-data.xml

Warning:

<frozen importlib._bootstrap>:488: RuntimeWarning: The global interpreter lock (GIL) has been enabled to load module 'coverage.tracer', which has not declared that it can run safely without the GIL. To override this behavior and keep the GIL disabled (at your own risk), run with PYTHON_GIL=0 or -Xgil=0.

Describe the solution you'd like

I guess coverage.tracer should declare whether it is safe or not to run without the GIL with free-threaded Python? Not an expert on this but I think the CPython doc may have more details.

Describe alternatives you've considered

I am completely fine setting the environment variable PYTHON_GIL=0. In scikit-learn test suite, this is what we currently do because Numpy also has some C extensions that still haven't declared their free-threaded safety or lack thereof.

Additional context

This is related to a concerted attempt of trying out Python 3.13 free-threaded in the Scientific Python ecosystem, see https://github.com/Quansight-Labs/free-threaded-compatibility for more details.

@nedbat
Copy link
Owner

nedbat commented Jun 20, 2024

Thanks for the link to the docs! Fixed in commit b18485e.

@nedbat nedbat closed this as completed Jun 20, 2024
@lesteve
Copy link
Author

lesteve commented Jun 21, 2024

Nice, thanks for the fix!

@nedbat
Copy link
Owner

nedbat commented Jun 22, 2024

This is now released as part of coverage 7.5.4.

github-merge-queue bot pushed a commit to rustymotors/server that referenced this issue Jun 22, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [coverage](https://togithub.com/nedbat/coveragepy) | `==7.5.3` ->
`==7.5.4` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/coverage/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/coverage/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/coverage/7.5.3/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/coverage/7.5.3/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>nedbat/coveragepy (coverage)</summary>

###
[`v7.5.4`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-754--2024-06-22)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.5.3...7.5.4)

- If you attempt to combine statement coverage data with branch coverage
data,
coverage.py used to fail with the message "Can't combine arc data with
line
data" or its reverse, "Can't combine line data with arc data." These
messages used internal terminology, making it hard for people to
understand
the problem. They are now changed to mention "branch coverage data" and
    "statement coverage data."

- Fixed a minor branch coverage problem with wildcard match/case cases
using
    names or guard clauses.

- Started testing on 3.13 free-threading (nogil) builds of Python. I'm
not
    claiming full support yet.  Closes `issue 1799`\_.

.. \_issue
1799:[nedbat/coveragepy#1799

.. \_changes\_7-5-3:

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/rustymotors/server).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTMuMiIsInVwZGF0ZWRJblZlciI6IjM3LjQxMy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
renovate bot added a commit to allenporter/flux-local that referenced this issue Jun 23, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [coverage](https://togithub.com/nedbat/coveragepy) | `==7.5.3` ->
`==7.5.4` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/coverage/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/coverage/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/coverage/7.5.3/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/coverage/7.5.3/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>nedbat/coveragepy (coverage)</summary>

###
[`v7.5.4`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-754--2024-06-22)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.5.3...7.5.4)

- If you attempt to combine statement coverage data with branch coverage
data,
coverage.py used to fail with the message "Can't combine arc data with
line
data" or its reverse, "Can't combine line data with arc data." These
messages used internal terminology, making it hard for people to
understand
the problem. They are now changed to mention "branch coverage data" and
    "statement coverage data."

- Fixed a minor branch coverage problem with wildcard match/case cases
using
    names or guard clauses.

- Started testing on 3.13 free-threading (nogil) builds of Python. I'm
not
    claiming full support yet.  Closes `issue 1799`\_.

.. \_issue
1799:[nedbat/coveragepy#1799

.. \_changes\_7-5-3:

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/allenporter/flux-local).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTMuMiIsInVwZGF0ZWRJblZlciI6IjM3LjQxMy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
github-merge-queue bot pushed a commit to rustymotors/server that referenced this issue Jun 29, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [coverage](https://togithub.com/nedbat/coveragepy) | `==7.5.3` ->
`==7.5.4` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/coverage/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/coverage/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/coverage/7.5.3/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/coverage/7.5.3/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>nedbat/coveragepy (coverage)</summary>

###
[`v7.5.4`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-754--2024-06-22)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.5.3...7.5.4)

- If you attempt to combine statement coverage data with branch coverage
data,
coverage.py used to fail with the message "Can't combine arc data with
line
data" or its reverse, "Can't combine line data with arc data." These
messages used internal terminology, making it hard for people to
understand
the problem. They are now changed to mention "branch coverage data" and
    "statement coverage data."

- Fixed a minor branch coverage problem with wildcard match/case cases
using
    names or guard clauses.

- Started testing on 3.13 free-threading (nogil) builds of Python. I'm
not
    claiming full support yet.  Closes `issue 1799`\_.

.. \_issue
1799:[nedbat/coveragepy#1799

.. \_changes\_7-5-3:

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled because a matching PR was automerged
previously.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/rustymotors/server).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTMuMiIsInVwZGF0ZWRJblZlciI6IjM3LjQyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
github-merge-queue bot pushed a commit to rustymotors/server that referenced this issue Jun 30, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [coverage](https://togithub.com/nedbat/coveragepy) | `==7.5.3` ->
`==7.5.4` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/coverage/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/coverage/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/coverage/7.5.3/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/coverage/7.5.3/7.5.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>nedbat/coveragepy (coverage)</summary>

###
[`v7.5.4`](https://togithub.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-754--2024-06-22)

[Compare
Source](https://togithub.com/nedbat/coveragepy/compare/7.5.3...7.5.4)

- If you attempt to combine statement coverage data with branch coverage
data,
coverage.py used to fail with the message "Can't combine arc data with
line
data" or its reverse, "Can't combine line data with arc data." These
messages used internal terminology, making it hard for people to
understand
the problem. They are now changed to mention "branch coverage data" and
    "statement coverage data."

- Fixed a minor branch coverage problem with wildcard match/case cases
using
    names or guard clauses.

- Started testing on 3.13 free-threading (nogil) builds of Python. I'm
not
    claiming full support yet.  Closes `issue 1799`\_.

.. \_issue
1799:[nedbat/coveragepy#1799

.. \_changes\_7-5-3:

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled because a matching PR was automerged
previously.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/rustymotors/server).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants