Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
news
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sartika Aritonang
news
Commits
8052a89b
Commit
8052a89b
authored
May 29, 2020
by
Sartika Aritonang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
4bba2a46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
metadata_legacy.py
...ackages/pip/_internal/operations/build/metadata_legacy.py
+77
-0
No files found.
stbi/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py
0 → 100644
View file @
8052a89b
"""Metadata generation logic for legacy source distributions.
"""
import
logging
import
os
from
pip._internal.exceptions
import
InstallationError
from
pip._internal.utils.setuptools_build
import
make_setuptools_egg_info_args
from
pip._internal.utils.subprocess
import
call_subprocess
from
pip._internal.utils.temp_dir
import
TempDirectory
from
pip._internal.utils.typing
import
MYPY_CHECK_RUNNING
if
MYPY_CHECK_RUNNING
:
from
pip._internal.build_env
import
BuildEnvironment
logger
=
logging
.
getLogger
(
__name__
)
def
_find_egg_info
(
directory
):
# type: (str) -> str
"""Find an .egg-info subdirectory in `directory`.
"""
filenames
=
[
f
for
f
in
os
.
listdir
(
directory
)
if
f
.
endswith
(
".egg-info"
)
]
if
not
filenames
:
raise
InstallationError
(
"No .egg-info directory found in {}"
.
format
(
directory
)
)
if
len
(
filenames
)
>
1
:
raise
InstallationError
(
"More than one .egg-info directory found in {}"
.
format
(
directory
)
)
return
os
.
path
.
join
(
directory
,
filenames
[
0
])
def
generate_metadata
(
build_env
,
# type: BuildEnvironment
setup_py_path
,
# type: str
source_dir
,
# type: str
isolated
,
# type: bool
details
,
# type: str
):
# type: (...) -> str
"""Generate metadata using setup.py-based defacto mechanisms.
Returns the generated metadata directory.
"""
logger
.
debug
(
'Running setup.py (path:
%
s) egg_info for package
%
s'
,
setup_py_path
,
details
,
)
egg_info_dir
=
TempDirectory
(
kind
=
"pip-egg-info"
,
globally_managed
=
True
)
.
path
args
=
make_setuptools_egg_info_args
(
setup_py_path
,
egg_info_dir
=
egg_info_dir
,
no_user_config
=
isolated
,
)
with
build_env
:
call_subprocess
(
args
,
cwd
=
source_dir
,
command_desc
=
'python setup.py egg_info'
,
)
# Return the .egg-info directory.
return
_find_egg_info
(
egg_info_dir
)
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