Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2641f647
Commit
2641f647
authored
Nov 06, 2011
by
Éric Araujo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use more standard name for one option of packaging’s install_distinfo
parent
1fe4d46a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
21 deletions
+18
-21
Lib/packaging/command/install_dist.py
Lib/packaging/command/install_dist.py
+1
-3
Lib/packaging/command/install_distinfo.py
Lib/packaging/command/install_distinfo.py
+12
-13
Lib/packaging/tests/test_command_install_distinfo.py
Lib/packaging/tests/test_command_install_distinfo.py
+5
-5
No files found.
Lib/packaging/command/install_dist.py
View file @
2641f647
...
@@ -55,9 +55,7 @@ class install_dist(Command):
...
@@ -55,9 +55,7 @@ class install_dist(Command):
(
'install-data='
,
None
,
(
'install-data='
,
None
,
"installation directory for data files"
),
"installation directory for data files"
),
# Byte-compilation options -- see install_lib.py for details, as
# Byte-compilation options -- see install_lib for details
# these are duplicated from there (but only install_lib does
# anything with them).
(
'compile'
,
'c'
,
"compile .py to .pyc [default]"
),
(
'compile'
,
'c'
,
"compile .py to .pyc [default]"
),
(
'no-compile'
,
None
,
"don't compile .py files"
),
(
'no-compile'
,
None
,
"don't compile .py files"
),
(
'optimize='
,
'O'
,
(
'optimize='
,
'O'
,
...
...
Lib/packaging/command/install_distinfo.py
View file @
2641f647
...
@@ -16,8 +16,8 @@ class install_distinfo(Command):
...
@@ -16,8 +16,8 @@ class install_distinfo(Command):
description
=
'create a .dist-info directory for the distribution'
description
=
'create a .dist-info directory for the distribution'
user_options
=
[
user_options
=
[
(
'
distinfo
-dir='
,
None
,
(
'
install
-dir='
,
None
,
"directory where the the .dist-info directory will be
install
ed"
),
"directory where the the .dist-info directory will be
creat
ed"
),
(
'installer='
,
None
,
(
'installer='
,
None
,
"the name of the installer"
),
"the name of the installer"
),
(
'requested'
,
None
,
(
'requested'
,
None
,
...
@@ -35,7 +35,7 @@ class install_distinfo(Command):
...
@@ -35,7 +35,7 @@ class install_distinfo(Command):
negative_opt
=
{
'no-requested'
:
'requested'
}
negative_opt
=
{
'no-requested'
:
'requested'
}
def
initialize_options
(
self
):
def
initialize_options
(
self
):
self
.
distinfo
_dir
=
None
self
.
install
_dir
=
None
self
.
installer
=
None
self
.
installer
=
None
self
.
requested
=
None
self
.
requested
=
None
self
.
no_record
=
None
self
.
no_record
=
None
...
@@ -46,8 +46,7 @@ class install_distinfo(Command):
...
@@ -46,8 +46,7 @@ class install_distinfo(Command):
self
.
set_undefined_options
(
'install_dist'
,
self
.
set_undefined_options
(
'install_dist'
,
'installer'
,
'requested'
,
'no_record'
)
'installer'
,
'requested'
,
'no_record'
)
self
.
set_undefined_options
(
'install_lib'
,
self
.
set_undefined_options
(
'install_lib'
,
'install_dir'
)
(
'install_dir'
,
'distinfo_dir'
))
if
self
.
installer
is
None
:
if
self
.
installer
is
None
:
# FIXME distutils or packaging?
# FIXME distutils or packaging?
...
@@ -64,26 +63,26 @@ class install_distinfo(Command):
...
@@ -64,26 +63,26 @@ class install_distinfo(Command):
basename
=
metadata
.
get_fullname
(
filesafe
=
True
)
+
".dist-info"
basename
=
metadata
.
get_fullname
(
filesafe
=
True
)
+
".dist-info"
self
.
distinfo_dir
=
os
.
path
.
join
(
self
.
distinfo
_dir
,
basename
)
self
.
install_dir
=
os
.
path
.
join
(
self
.
install
_dir
,
basename
)
def
run
(
self
):
def
run
(
self
):
target
=
self
.
distinfo
_dir
target
=
self
.
install
_dir
if
os
.
path
.
isdir
(
target
)
and
not
os
.
path
.
islink
(
target
):
if
os
.
path
.
isdir
(
target
)
and
not
os
.
path
.
islink
(
target
):
if
not
self
.
dry_run
:
if
not
self
.
dry_run
:
rmtree
(
target
)
rmtree
(
target
)
elif
os
.
path
.
exists
(
target
):
elif
os
.
path
.
exists
(
target
):
self
.
execute
(
os
.
unlink
,
(
self
.
distinfo
_dir
,),
self
.
execute
(
os
.
unlink
,
(
self
.
install
_dir
,),
"removing "
+
target
)
"removing "
+
target
)
self
.
execute
(
os
.
makedirs
,
(
target
,),
"creating "
+
target
)
self
.
execute
(
os
.
makedirs
,
(
target
,),
"creating "
+
target
)
metadata_path
=
os
.
path
.
join
(
self
.
distinfo
_dir
,
'METADATA'
)
metadata_path
=
os
.
path
.
join
(
self
.
install
_dir
,
'METADATA'
)
self
.
execute
(
self
.
distribution
.
metadata
.
write
,
(
metadata_path
,),
self
.
execute
(
self
.
distribution
.
metadata
.
write
,
(
metadata_path
,),
"creating "
+
metadata_path
)
"creating "
+
metadata_path
)
self
.
outfiles
.
append
(
metadata_path
)
self
.
outfiles
.
append
(
metadata_path
)
installer_path
=
os
.
path
.
join
(
self
.
distinfo
_dir
,
'INSTALLER'
)
installer_path
=
os
.
path
.
join
(
self
.
install
_dir
,
'INSTALLER'
)
logger
.
info
(
'creating %s'
,
installer_path
)
logger
.
info
(
'creating %s'
,
installer_path
)
if
not
self
.
dry_run
:
if
not
self
.
dry_run
:
with
open
(
installer_path
,
'w'
)
as
f
:
with
open
(
installer_path
,
'w'
)
as
f
:
...
@@ -91,7 +90,7 @@ class install_distinfo(Command):
...
@@ -91,7 +90,7 @@ class install_distinfo(Command):
self
.
outfiles
.
append
(
installer_path
)
self
.
outfiles
.
append
(
installer_path
)
if
self
.
requested
:
if
self
.
requested
:
requested_path
=
os
.
path
.
join
(
self
.
distinfo
_dir
,
'REQUESTED'
)
requested_path
=
os
.
path
.
join
(
self
.
install
_dir
,
'REQUESTED'
)
logger
.
info
(
'creating %s'
,
requested_path
)
logger
.
info
(
'creating %s'
,
requested_path
)
if
not
self
.
dry_run
:
if
not
self
.
dry_run
:
open
(
requested_path
,
'wb'
).
close
()
open
(
requested_path
,
'wb'
).
close
()
...
@@ -100,7 +99,7 @@ class install_distinfo(Command):
...
@@ -100,7 +99,7 @@ class install_distinfo(Command):
if
not
self
.
no_resources
:
if
not
self
.
no_resources
:
install_data
=
self
.
get_finalized_command
(
'install_data'
)
install_data
=
self
.
get_finalized_command
(
'install_data'
)
if
install_data
.
get_resources_out
()
!=
[]:
if
install_data
.
get_resources_out
()
!=
[]:
resources_path
=
os
.
path
.
join
(
self
.
distinfo
_dir
,
resources_path
=
os
.
path
.
join
(
self
.
install
_dir
,
'RESOURCES'
)
'RESOURCES'
)
logger
.
info
(
'creating %s'
,
resources_path
)
logger
.
info
(
'creating %s'
,
resources_path
)
if
not
self
.
dry_run
:
if
not
self
.
dry_run
:
...
@@ -114,7 +113,7 @@ class install_distinfo(Command):
...
@@ -114,7 +113,7 @@ class install_distinfo(Command):
self
.
outfiles
.
append
(
resources_path
)
self
.
outfiles
.
append
(
resources_path
)
if
not
self
.
no_record
:
if
not
self
.
no_record
:
record_path
=
os
.
path
.
join
(
self
.
distinfo
_dir
,
'RECORD'
)
record_path
=
os
.
path
.
join
(
self
.
install
_dir
,
'RECORD'
)
logger
.
info
(
'creating %s'
,
record_path
)
logger
.
info
(
'creating %s'
,
record_path
)
if
not
self
.
dry_run
:
if
not
self
.
dry_run
:
with
open
(
record_path
,
'w'
,
encoding
=
'utf-8'
)
as
f
:
with
open
(
record_path
,
'w'
,
encoding
=
'utf-8'
)
as
f
:
...
...
Lib/packaging/tests/test_command_install_distinfo.py
View file @
2641f647
...
@@ -49,7 +49,7 @@ class InstallDistinfoTestCase(support.TempdirManager,
...
@@ -49,7 +49,7 @@ class InstallDistinfoTestCase(support.TempdirManager,
cmd
=
install_distinfo
(
dist
)
cmd
=
install_distinfo
(
dist
)
dist
.
command_obj
[
'install_distinfo'
]
=
cmd
dist
.
command_obj
[
'install_distinfo'
]
=
cmd
cmd
.
distinfo
_dir
=
install_dir
cmd
.
install
_dir
=
install_dir
cmd
.
ensure_finalized
()
cmd
.
ensure_finalized
()
cmd
.
run
()
cmd
.
run
()
...
@@ -76,7 +76,7 @@ class InstallDistinfoTestCase(support.TempdirManager,
...
@@ -76,7 +76,7 @@ class InstallDistinfoTestCase(support.TempdirManager,
cmd
=
install_distinfo
(
dist
)
cmd
=
install_distinfo
(
dist
)
dist
.
command_obj
[
'install_distinfo'
]
=
cmd
dist
.
command_obj
[
'install_distinfo'
]
=
cmd
cmd
.
distinfo
_dir
=
install_dir
cmd
.
install
_dir
=
install_dir
cmd
.
installer
=
'bacon-python'
cmd
.
installer
=
'bacon-python'
cmd
.
ensure_finalized
()
cmd
.
ensure_finalized
()
cmd
.
run
()
cmd
.
run
()
...
@@ -96,7 +96,7 @@ class InstallDistinfoTestCase(support.TempdirManager,
...
@@ -96,7 +96,7 @@ class InstallDistinfoTestCase(support.TempdirManager,
cmd
=
install_distinfo
(
dist
)
cmd
=
install_distinfo
(
dist
)
dist
.
command_obj
[
'install_distinfo'
]
=
cmd
dist
.
command_obj
[
'install_distinfo'
]
=
cmd
cmd
.
distinfo
_dir
=
install_dir
cmd
.
install
_dir
=
install_dir
cmd
.
requested
=
False
cmd
.
requested
=
False
cmd
.
ensure_finalized
()
cmd
.
ensure_finalized
()
cmd
.
run
()
cmd
.
run
()
...
@@ -116,7 +116,7 @@ class InstallDistinfoTestCase(support.TempdirManager,
...
@@ -116,7 +116,7 @@ class InstallDistinfoTestCase(support.TempdirManager,
cmd
=
install_distinfo
(
dist
)
cmd
=
install_distinfo
(
dist
)
dist
.
command_obj
[
'install_distinfo'
]
=
cmd
dist
.
command_obj
[
'install_distinfo'
]
=
cmd
cmd
.
distinfo
_dir
=
install_dir
cmd
.
install
_dir
=
install_dir
cmd
.
no_record
=
True
cmd
.
no_record
=
True
cmd
.
ensure_finalized
()
cmd
.
ensure_finalized
()
cmd
.
run
()
cmd
.
run
()
...
@@ -214,7 +214,7 @@ class InstallDistinfoTestCase(support.TempdirManager,
...
@@ -214,7 +214,7 @@ class InstallDistinfoTestCase(support.TempdirManager,
cmd
=
install_distinfo
(
dist
)
cmd
=
install_distinfo
(
dist
)
dist
.
command_obj
[
'install_distinfo'
]
=
cmd
dist
.
command_obj
[
'install_distinfo'
]
=
cmd
cmd
.
distinfo
_dir
=
install_dir
cmd
.
install
_dir
=
install_dir
cmd
.
ensure_finalized
()
cmd
.
ensure_finalized
()
cmd
.
run
()
cmd
.
run
()
...
...
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