Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
2d607a9e
Commit
2d607a9e
authored
May 10, 2020
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Emit deprecation warning when 2to3 is used. Ref #2086.
parent
40f81af0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
setuptools/lib2to3_ex.py
setuptools/lib2to3_ex.py
+7
-0
setuptools/tests/test_test.py
setuptools/tests/test_test.py
+6
-0
No files found.
setuptools/lib2to3_ex.py
View file @
2d607a9e
...
...
@@ -7,6 +7,7 @@ Customized Mixin2to3 support:
This module raises an ImportError on Python 2.
"""
import
warnings
from
distutils.util
import
Mixin2to3
as
_Mixin2to3
from
distutils
import
log
from
lib2to3.refactor
import
RefactoringTool
,
get_fixers_from_package
...
...
@@ -33,6 +34,12 @@ class Mixin2to3(_Mixin2to3):
return
if
not
files
:
return
warnings
.
warn
(
"2to3 support is deprecated. Please migrate to "
"a single-codebase solution or roll your own "
"conversion process."
,
DeprecationWarning
)
log
.
info
(
"Fixing "
+
" "
.
join
(
files
))
self
.
__build_fixer_names
()
self
.
__exclude_fixers
()
...
...
setuptools/tests/test_test.py
View file @
2d607a9e
...
...
@@ -73,7 +73,11 @@ def quiet_log():
log
.
set_verbosity
(
0
)
ack_2to3
=
pytest
.
mark
.
filterwarnings
(
'ignore:2to3 support is deprecated'
)
@
pytest
.
mark
.
usefixtures
(
'sample_test'
,
'quiet_log'
)
@
ack_2to3
def
test_test
(
capfd
):
params
=
dict
(
name
=
'foo'
,
...
...
@@ -124,6 +128,7 @@ def test_tests_are_run_once(capfd):
@
pytest
.
mark
.
usefixtures
(
'sample_test'
)
@
ack_2to3
def
test_warns_deprecation
(
capfd
):
params
=
dict
(
name
=
'foo'
,
...
...
@@ -149,6 +154,7 @@ def test_warns_deprecation(capfd):
@
pytest
.
mark
.
usefixtures
(
'sample_test'
)
@
ack_2to3
def
test_deprecation_stderr
(
capfd
):
params
=
dict
(
name
=
'foo'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment