Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
a2bc37a9
Unverified
Commit
a2bc37a9
authored
4 years ago
by
Michael Kriese
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(pip_setup): fix python deprecation message (#6788)
parent
779865af
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
data/extract.py
+15
-3
15 additions, 3 deletions
data/extract.py
with
15 additions
and
3 deletions
data/extract.py
+
15
−
3
View file @
a2bc37a9
from
__future__
import
print_function
import
sys
import
sys
import
imp
import
json
import
json
import
os
import
distutils.core
import
distutils.core
if
sys
.
version_info
[:
2
]
>=
(
3
,
3
):
from
importlib.machinery
import
SourceFileLoader
def
load_source
(
name
,
path
):
if
not
os
.
path
.
exists
(
path
):
return
{}
return
vars
(
SourceFileLoader
(
'
mod
'
,
path
).
load_module
())
else
:
import
imp
def
load_source
(
name
,
path
):
if
not
os
.
path
.
exists
(
path
):
return
{}
return
vars
(
imp
.
load_source
(
'
mod
'
,
path
))
try
:
try
:
import
setuptools
import
setuptools
except
ImportError
:
except
ImportError
:
...
@@ -21,7 +33,7 @@ except ImportError:
...
@@ -21,7 +33,7 @@ except ImportError:
@mock.patch.object
(
distutils
.
core
,
'
setup
'
)
@mock.patch.object
(
distutils
.
core
,
'
setup
'
)
def
invoke
(
mock1
,
mock2
):
def
invoke
(
mock1
,
mock2
):
# This is setup.py which calls setuptools.setup
# This is setup.py which calls setuptools.setup
imp
.
load_source
(
'
_target_setup_
'
,
sys
.
argv
[
-
1
])
load_source
(
'
_target_setup_
'
,
sys
.
argv
[
-
1
])
# called arguments are in `mock_setup.call_args`
# called arguments are in `mock_setup.call_args`
call_args
=
mock1
.
call_args
or
mock2
.
call_args
call_args
=
mock1
.
call_args
or
mock2
.
call_args
args
,
kwargs
=
call_args
args
,
kwargs
=
call_args
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment