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 referenced this issue in rustymotors/server 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:[https://github.com/nedbat/coveragepy/issues/1799](https://togithub.com/nedbat/coveragepy/issues/1799)9

.. \_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 referenced this issue in allenporter/flux-local 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:[https://github.com/nedbat/coveragepy/issues/1799](https://togithub.com/nedbat/coveragepy/issues/1799)9

.. \_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>
ddl-cedricyoung referenced this issue in dominodatalab/cucu Jun 26, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change | Age | Adoption | Passing |
Confidence |
|---|---|---|---|---|---|---|---|
|  |  | lockFileMaintenance | All locks refreshed |  |  |  |  |
| [coverage](https://togithub.com/nedbat/coveragepy) | dependencies |
patch | `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/)
|
| [importlib-metadata](https://togithub.com/python/importlib_metadata) |
dependencies | patch | `7.2.0` -> `7.2.1` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/importlib-metadata/7.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/importlib-metadata/7.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/importlib-metadata/7.2.0/7.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/importlib-metadata/7.2.0/7.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [selenium](https://www.selenium.dev) | dependencies | minor | `4.21.0`
-> `4.22.0` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/selenium/4.22.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/selenium/4.22.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/selenium/4.21.0/4.22.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/selenium/4.21.0/4.22.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
| [tenacity](https://togithub.com/jd/tenacity) | dependencies | patch |
`8.4.1` -> `8.4.2` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/tenacity/8.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/tenacity/8.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/tenacity/8.4.1/8.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/tenacity/8.4.1/8.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

🔧 This Pull Request updates lock files to use the latest dependency
versions.

---

### 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:[https://github.com/nedbat/coveragepy/issues/1799](https://togithub.com/nedbat/coveragepy/issues/1799)9

.. \_changes\_7-5-3:

</details>

<details>
<summary>python/importlib_metadata (importlib-metadata)</summary>

###
[`v7.2.1`](https://togithub.com/python/importlib_metadata/compare/v7.2.0...v7.2.1)

[Compare
Source](https://togithub.com/python/importlib_metadata/compare/v7.2.0...v7.2.1)

</details>

<details>
<summary>jd/tenacity (tenacity)</summary>

### [`v8.4.2`](https://togithub.com/jd/tenacity/releases/tag/8.4.2):
tenacity 8.4.2

[Compare Source](https://togithub.com/jd/tenacity/compare/8.4.1...8.4.2)

#### What's Changed

- fix: Avoid overwriting local contexts with retry decorator by
[@&#8203;hasier](https://togithub.com/hasier) in
[https://github.com/jd/tenacity/pull/479](https://togithub.com/jd/tenacity/pull/479)

**Full Changelog**: jd/tenacity@8.4.1...8.4.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on monday" in timezone
America/Los_Angeles, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

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

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- 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/cerebrotech/cucu).

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

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
github-merge-queue bot referenced this issue in rustymotors/server 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:[https://github.com/nedbat/coveragepy/issues/1799](https://togithub.com/nedbat/coveragepy/issues/1799)9

.. \_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 referenced this issue in rustymotors/server 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:[https://github.com/nedbat/coveragepy/issues/1799](https://togithub.com/nedbat/coveragepy/issues/1799)9

.. \_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