Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-113407: Fix import of unittest.mock when CPython is built without docstrings#113408

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedDec 22, 2023
edited by bedevere-appbot
Loading

Copy link
Contributor

@cjw296cjw296 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm worried about what needs these to be there in the first place breaking.

I'm also curious: why would you want to build a python distribution without docstrings?

if_CODE_SIG:
code_mock=NonCallableMock(spec_set=_CODE_ATTRS)
code_mock.__dict__["_spec_class"]=CodeType
code_mock.__dict__["_spec_signature"]=_CODE_SIG
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What functionality is lost by having_spec_class and_spec_signature missing here?
These were evidently there for a reason, but if no tests are failing without them that suggest they might be superfluous and could be dropped completely, or, more likely, that there's tests coverage that needs adding.

The backport has 100% line coverage checking as part of its CI, so I'm a little surprised.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Was not it a pure optimization in#83076? This PR simply disables it if the signature is not available and makes the code to go the old way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yeah, I guess if there's no signature available then there's no code signature available.
Where do we go to see the test suite running (and passing after this PR!) with docstrings disabled?

@serhiy-storchaka
Copy link
MemberAuthor

Building a python distribution without docstrings is a supported feature. Currently the mock module is broken in this configuration, and it affects many tests.

@cjw296
Copy link
Contributor

Building a python distribution without docstrings is a supported feature

I didn't say it wasn't, I asked why would you want to build a python distribution without docstrings.
I'm still curious :-)

@serhiy-storchaka
Copy link
MemberAuthor

I have no other reasons except supporting Python bug-free in all configurations. We do no have buildbots for all possible combinations of configuration options, so we depend on manual testing here. Time from time we test and fix builds in nonstandard configurations, but last time it was years ago. There was an old issue#81682 with an outdated PR, and it is the reason why I do this right now.

@serhiy-storchakaserhiy-storchaka merged commit0c57454 intopython:mainDec 24, 2023
@miss-islington-app
Copy link

Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@serhiy-storchakaserhiy-storchaka deleted the unittest-mock-without-docstrings branchDecember 24, 2023 11:38
@bedevere-app
Copy link

GH-113454 is a backport of this pull request to the3.12 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestDec 24, 2023
…thout docstrings (pythonGH-113408)(cherry picked from commit0c57454)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelDec 24, 2023
serhiy-storchaka added a commit that referenced this pull requestDec 24, 2023
…ithout docstrings (GH-113408) (GH-113454)(cherry picked from commit0c57454)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
ryan-duve pushed a commit to ryan-duve/cpython that referenced this pull requestDec 26, 2023
kulikjak pushed a commit to kulikjak/cpython that referenced this pull requestJan 22, 2024
aisk pushed a commit to aisk/cpython that referenced this pull requestFeb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull requestSep 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@cjw296cjw296cjw296 approved these changes

@carljmcarljmAwaiting requested review from carljm

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@serhiy-storchaka@cjw296

[8]ページ先頭

©2009-2025 Movatter.jp