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
605d57a0
Commit
605d57a0
authored
Feb 11, 2016
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #25985: sys.version_info is now used instead of sys.version
to format short Python version.
parent
34941986
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
11 deletions
+12
-11
command/bdist_msi.py
command/bdist_msi.py
+1
-1
command/bdist_wininst.py
command/bdist_wininst.py
+1
-1
command/build.py
command/build.py
+2
-2
command/install.py
command/install.py
+2
-2
command/install_egg_info.py
command/install_egg_info.py
+2
-2
sysconfig.py
sysconfig.py
+1
-1
tests/test_build.py
tests/test_build.py
+3
-2
No files found.
command/bdist_msi.py
View file @
605d57a0
...
@@ -199,7 +199,7 @@ class bdist_msi(Command):
...
@@ -199,7 +199,7 @@ class bdist_msi(Command):
target_version
=
self
.
target_version
target_version
=
self
.
target_version
if
not
target_version
:
if
not
target_version
:
assert
self
.
skip_build
,
"Should have already checked this"
assert
self
.
skip_build
,
"Should have already checked this"
target_version
=
sys
.
version
[
0
:
3
]
target_version
=
'%d.%d'
%
sys
.
version_info
[:
2
]
plat_specifier
=
".%s-%s"
%
(
self
.
plat_name
,
target_version
)
plat_specifier
=
".%s-%s"
%
(
self
.
plat_name
,
target_version
)
build
=
self
.
get_finalized_command
(
'build'
)
build
=
self
.
get_finalized_command
(
'build'
)
build
.
build_lib
=
os
.
path
.
join
(
build
.
build_base
,
build
.
build_lib
=
os
.
path
.
join
(
build
.
build_base
,
...
...
command/bdist_wininst.py
View file @
605d57a0
...
@@ -141,7 +141,7 @@ class bdist_wininst(Command):
...
@@ -141,7 +141,7 @@ class bdist_wininst(Command):
target_version
=
self
.
target_version
target_version
=
self
.
target_version
if
not
target_version
:
if
not
target_version
:
assert
self
.
skip_build
,
"Should have already checked this"
assert
self
.
skip_build
,
"Should have already checked this"
target_version
=
sys
.
version
[
0
:
3
]
target_version
=
'%d.%d'
%
sys
.
version_info
[:
2
]
plat_specifier
=
".%s-%s"
%
(
self
.
plat_name
,
target_version
)
plat_specifier
=
".%s-%s"
%
(
self
.
plat_name
,
target_version
)
build
=
self
.
get_finalized_command
(
'build'
)
build
=
self
.
get_finalized_command
(
'build'
)
build
.
build_lib
=
os
.
path
.
join
(
build
.
build_base
,
build
.
build_lib
=
os
.
path
.
join
(
build
.
build_base
,
...
...
command/build.py
View file @
605d57a0
...
@@ -81,7 +81,7 @@ class build(Command):
...
@@ -81,7 +81,7 @@ class build(Command):
"--plat-name only supported on Windows (try "
"--plat-name only supported on Windows (try "
"using './configure --help' on your platform)"
)
"using './configure --help' on your platform)"
)
plat_specifier
=
".%s-%
s"
%
(
self
.
plat_name
,
sys
.
version
[
0
:
3
])
plat_specifier
=
".%s-%
d.%d"
%
(
self
.
plat_name
,
*
sys
.
version_info
[:
2
])
# Make it so Python 2.x and Python 2.x with --with-pydebug don't
# Make it so Python 2.x and Python 2.x with --with-pydebug don't
# share the same build directories. Doing so confuses the build
# share the same build directories. Doing so confuses the build
...
@@ -114,7 +114,7 @@ class build(Command):
...
@@ -114,7 +114,7 @@ class build(Command):
'temp'
+
plat_specifier
)
'temp'
+
plat_specifier
)
if
self
.
build_scripts
is
None
:
if
self
.
build_scripts
is
None
:
self
.
build_scripts
=
os
.
path
.
join
(
self
.
build_base
,
self
.
build_scripts
=
os
.
path
.
join
(
self
.
build_base
,
'scripts-
'
+
sys
.
version
[
0
:
3
])
'scripts-
%d.%d'
%
sys
.
version_info
[:
2
])
if
self
.
executable
is
None
:
if
self
.
executable
is
None
:
self
.
executable
=
os
.
path
.
normpath
(
sys
.
executable
)
self
.
executable
=
os
.
path
.
normpath
(
sys
.
executable
)
...
...
command/install.py
View file @
605d57a0
...
@@ -290,8 +290,8 @@ class install(Command):
...
@@ -290,8 +290,8 @@ class install(Command):
'dist_version'
:
self
.
distribution
.
get_version
(),
'dist_version'
:
self
.
distribution
.
get_version
(),
'dist_fullname'
:
self
.
distribution
.
get_fullname
(),
'dist_fullname'
:
self
.
distribution
.
get_fullname
(),
'py_version'
:
py_version
,
'py_version'
:
py_version
,
'py_version_short'
:
py_version
[
0
:
3
],
'py_version_short'
:
'%d.%d'
%
sys
.
version_info
[:
2
],
'py_version_nodot'
:
py_version
[
0
]
+
py_version
[
2
],
'py_version_nodot'
:
'%d%d'
%
sys
.
version_info
[:
2
],
'sys_prefix'
:
prefix
,
'sys_prefix'
:
prefix
,
'prefix'
:
prefix
,
'prefix'
:
prefix
,
'sys_exec_prefix'
:
exec_prefix
,
'sys_exec_prefix'
:
exec_prefix
,
...
...
command/install_egg_info.py
View file @
605d57a0
...
@@ -21,10 +21,10 @@ class install_egg_info(Command):
...
@@ -21,10 +21,10 @@ class install_egg_info(Command):
def
finalize_options
(
self
):
def
finalize_options
(
self
):
self
.
set_undefined_options
(
'install_lib'
,(
'install_dir'
,
'install_dir'
))
self
.
set_undefined_options
(
'install_lib'
,(
'install_dir'
,
'install_dir'
))
basename
=
"%s-%s-py%
s
.egg-info"
%
(
basename
=
"%s-%s-py%
d.%d
.egg-info"
%
(
to_filename
(
safe_name
(
self
.
distribution
.
get_name
())),
to_filename
(
safe_name
(
self
.
distribution
.
get_name
())),
to_filename
(
safe_version
(
self
.
distribution
.
get_version
())),
to_filename
(
safe_version
(
self
.
distribution
.
get_version
())),
sys
.
version
[:
3
]
*
sys
.
version_info
[:
2
]
)
)
self
.
target
=
os
.
path
.
join
(
self
.
install_dir
,
basename
)
self
.
target
=
os
.
path
.
join
(
self
.
install_dir
,
basename
)
self
.
outputs
=
[
self
.
target
]
self
.
outputs
=
[
self
.
target
]
...
...
sysconfig.py
View file @
605d57a0
...
@@ -70,7 +70,7 @@ def get_python_version():
...
@@ -70,7 +70,7 @@ def get_python_version():
leaving off the patchlevel. Sample return values could be '1.5'
leaving off the patchlevel. Sample return values could be '1.5'
or '2.2'.
or '2.2'.
"""
"""
return
sys
.
version
[:
3
]
return
'%d.%d'
%
sys
.
version_info
[:
2
]
def
get_python_inc
(
plat_specific
=
0
,
prefix
=
None
):
def
get_python_inc
(
plat_specific
=
0
,
prefix
=
None
):
...
...
tests/test_build.py
View file @
605d57a0
...
@@ -27,7 +27,7 @@ class BuildTestCase(support.TempdirManager,
...
@@ -27,7 +27,7 @@ class BuildTestCase(support.TempdirManager,
# build_platlib is 'build/lib.platform-x.x[-pydebug]'
# build_platlib is 'build/lib.platform-x.x[-pydebug]'
# examples:
# examples:
# build/lib.macosx-10.3-i386-2.7
# build/lib.macosx-10.3-i386-2.7
plat_spec
=
'.%s-%
s'
%
(
cmd
.
plat_name
,
sys
.
version
[
0
:
3
])
plat_spec
=
'.%s-%
d.%d'
%
(
cmd
.
plat_name
,
*
sys
.
version_info
[:
2
])
if
hasattr
(
sys
,
'gettotalrefcount'
):
if
hasattr
(
sys
,
'gettotalrefcount'
):
self
.
assertTrue
(
cmd
.
build_platlib
.
endswith
(
'-pydebug'
))
self
.
assertTrue
(
cmd
.
build_platlib
.
endswith
(
'-pydebug'
))
plat_spec
+=
'-pydebug'
plat_spec
+=
'-pydebug'
...
@@ -42,7 +42,8 @@ class BuildTestCase(support.TempdirManager,
...
@@ -42,7 +42,8 @@ class BuildTestCase(support.TempdirManager,
self
.
assertEqual
(
cmd
.
build_temp
,
wanted
)
self
.
assertEqual
(
cmd
.
build_temp
,
wanted
)
# build_scripts is build/scripts-x.x
# build_scripts is build/scripts-x.x
wanted
=
os
.
path
.
join
(
cmd
.
build_base
,
'scripts-'
+
sys
.
version
[
0
:
3
])
wanted
=
os
.
path
.
join
(
cmd
.
build_base
,
'scripts-%d.%d'
%
sys
.
version_info
[:
2
])
self
.
assertEqual
(
cmd
.
build_scripts
,
wanted
)
self
.
assertEqual
(
cmd
.
build_scripts
,
wanted
)
# executable is os.path.normpath(sys.executable)
# executable is os.path.normpath(sys.executable)
...
...
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