Bug 1734384

Summary: use_2to3=True is ignored
Product: [Fedora] Fedora Reporter: Jiri Popelka <jpopelka>
Component: python-setuptoolsAssignee: Fedora Infrastructure SIG <infra-sig>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 30CC: cstratak, infra-sig, lewk, mhroncok, python-sig, rbarlow, rkuska
Target Milestone: ---   
Target Release: ---   
Hardware: noarch   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-30 12:34:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jiri Popelka 2019-07-30 12:05:08 UTC
Description of problem:
"python3 setup.py test" does not run 2to3 even with use_2to3=True in setup.py

Version-Release number of selected component (if applicable):
python3-setuptools-40.8.0-1.fc30.noarch

Steps to Reproduce:
1. git clone https://github.com/PyGithub/PyGithub.git
2. cd PyGithub
3. python3 setup.py test

Actual results:
AllTests (unittest.loader._FailedTest) ... ERROR

Expected results:
Ran 564 tests in 23.589s
OK

Additional info:
https://setuptools.readthedocs.io/en/latest/python3.html#using-2to3

Comment 1 Miro Hrončok 2019-07-30 12:19:38 UTC
Fixing build/lib/github/GitCommit.py build/lib/github/Migration.py build/lib/github/PullRequestPart.py build/lib/github/AuthorizationApplication.py build/lib/github/CommitCombinedStatus.py build/lib/github/Issue.py build/lib/github/Notification.py build/lib/github/Commit.py build/lib/github/Permissions.py build/lib/github/GitignoreTemplate.py build/lib/github/UserKey.py build/lib/github/IssuePullRequest.py build/lib/github/Requester.py build/lib/github/GistComment.py build/lib/github/GitTag.py build/lib/github/GitTree.py build/lib/github/PullRequest.py build/lib/github/__init__.py build/lib/github/BranchProtection.py build/lib/github/NamedUser.py build/lib/github/Authorization.py build/lib/github/Event.py build/lib/github/Comparison.py build/lib/github/GitBlob.py build/lib/github/GitAuthor.py build/lib/github/View.py build/lib/github/GistFile.py build/lib/github/File.py build/lib/github/SourceImport.py build/lib/github/StatsContributor.py build/lib/github/GistHistoryState.py build/lib/github/RequiredPullRequestReviews.py build/lib/github/GitObject.py build/lib/github/Organization.py build/lib/github/GithubObject.py build/lib/github/PaginatedList.py build/lib/github/Rate.py build/lib/github/Plan.py build/lib/github/AuthenticatedUser.py build/lib/github/Path.py build/lib/github/Hook.py build/lib/github/Project.py build/lib/github/RateLimit.py build/lib/github/Installation.py build/lib/github/StatsCodeFrequency.py build/lib/github/InputGitTreeElement.py build/lib/github/Reaction.py build/lib/github/Repository.py build/lib/github/Referrer.py build/lib/github/GitReleaseAsset.py build/lib/github/ProjectColumn.py build/lib/github/Milestone.py build/lib/github/MainClass.py build/lib/github/License.py build/lib/github/StatsCommitActivity.py build/lib/github/Clones.py build/lib/github/Invitation.py build/lib/github/InputFileContent.py build/lib/github/ProjectCard.py build/lib/github/GithubException.py build/lib/github/CommitComment.py build/lib/github/Download.py build/lib/github/HookDescription.py build/lib/github/PullRequestReview.py build/lib/github/Gist.py build/lib/github/ContentFile.py build/lib/github/CommitStatus.py build/lib/github/CommitStats.py build/lib/github/GitRef.py build/lib/github/Tag.py build/lib/github/NotificationSubject.py build/lib/github/InstallationAuthorization.py build/lib/github/GitRelease.py build/lib/github/Stargazer.py build/lib/github/IssueEvent.py build/lib/github/RequiredStatusChecks.py build/lib/github/HookResponse.py build/lib/github/PullRequestComment.py build/lib/github/PullRequestMergeStatus.py build/lib/github/Branch.py build/lib/github/StatsParticipation.py build/lib/github/InputGitAuthor.py build/lib/github/Legacy.py build/lib/github/IssueComment.py build/lib/github/StatsPunchCard.py build/lib/github/Label.py build/lib/github/Topic.py build/lib/github/GitTreeElement.py build/lib/github/Team.py build/lib/github/Consts.py build/lib/github/RepositoryKey.py
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
Fixing build/lib/github/GitCommit.py build/lib/github/Migration.py build/lib/github/PullRequestPart.py build/lib/github/AuthorizationApplication.py build/lib/github/CommitCombinedStatus.py build/lib/github/Issue.py build/lib/github/Notification.py build/lib/github/Commit.py build/lib/github/Permissions.py build/lib/github/GitignoreTemplate.py build/lib/github/UserKey.py build/lib/github/IssuePullRequest.py build/lib/github/Requester.py build/lib/github/GistComment.py build/lib/github/GitTag.py build/lib/github/GitTree.py build/lib/github/PullRequest.py build/lib/github/__init__.py build/lib/github/BranchProtection.py build/lib/github/NamedUser.py build/lib/github/Authorization.py build/lib/github/Event.py build/lib/github/Comparison.py build/lib/github/GitBlob.py build/lib/github/GitAuthor.py build/lib/github/View.py build/lib/github/GistFile.py build/lib/github/File.py build/lib/github/SourceImport.py build/lib/github/StatsContributor.py build/lib/github/GistHistoryState.py build/lib/github/RequiredPullRequestReviews.py build/lib/github/GitObject.py build/lib/github/Organization.py build/lib/github/GithubObject.py build/lib/github/PaginatedList.py build/lib/github/Rate.py build/lib/github/Plan.py build/lib/github/AuthenticatedUser.py build/lib/github/Path.py build/lib/github/Hook.py build/lib/github/Project.py build/lib/github/RateLimit.py build/lib/github/Installation.py build/lib/github/StatsCodeFrequency.py build/lib/github/InputGitTreeElement.py build/lib/github/Reaction.py build/lib/github/Repository.py build/lib/github/Referrer.py build/lib/github/GitReleaseAsset.py build/lib/github/ProjectColumn.py build/lib/github/Milestone.py build/lib/github/MainClass.py build/lib/github/License.py build/lib/github/StatsCommitActivity.py build/lib/github/Clones.py build/lib/github/Invitation.py build/lib/github/InputFileContent.py build/lib/github/ProjectCard.py build/lib/github/GithubException.py build/lib/github/CommitComment.py build/lib/github/Download.py build/lib/github/HookDescription.py build/lib/github/PullRequestReview.py build/lib/github/Gist.py build/lib/github/ContentFile.py build/lib/github/CommitStatus.py build/lib/github/CommitStats.py build/lib/github/GitRef.py build/lib/github/Tag.py build/lib/github/NotificationSubject.py build/lib/github/InstallationAuthorization.py build/lib/github/GitRelease.py build/lib/github/Stargazer.py build/lib/github/IssueEvent.py build/lib/github/RequiredStatusChecks.py build/lib/github/HookResponse.py build/lib/github/PullRequestComment.py build/lib/github/PullRequestMergeStatus.py build/lib/github/Branch.py build/lib/github/StatsParticipation.py build/lib/github/InputGitAuthor.py build/lib/github/Legacy.py build/lib/github/IssueComment.py build/lib/github/StatsPunchCard.py build/lib/github/Label.py build/lib/github/Topic.py build/lib/github/GitTreeElement.py build/lib/github/Team.py build/lib/github/Consts.py build/lib/github/RepositoryKey.py
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma


"The test command will now first run the build command during which the code will be converted with 2to3, and the tests will then be run from the build directory, as opposed from the source directory as is normally done."

I believe that as documented, 2to3 is only called on the code, not on the tests.


Nevertheless, I can reproduce with setuptools-41.0.1 upstream, so this is not a packaging bug. Would you mind starting an upstream discussion instead?

Comment 2 Miro Hrončok 2019-07-30 12:22:05 UTC
PyGithub does this:

    python -m lib2to3 -w -n tests

https://github.com/PyGithub/PyGithub/blob/6e79d2704b8812d26435b21c1258c766418ab25e/.travis.yml#L13


See https://github.com/PyGithub/PyGithub/pull/1031 for context.

Comment 3 Jiri Popelka 2019-07-30 12:34:12 UTC
> I believe that as documented, 2to3 is only called on the code, not on the tests.

Aha, that's the missing piece. Thanks!