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
495e4bf6
Commit
495e4bf6
authored
Oct 11, 2012
by
Jesus Cea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Closes #16135: Removal of OS/2 support (distutils)
parent
ff678506
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
7 additions
and
425 deletions
+7
-425
ccompiler.py
ccompiler.py
+1
-4
command/bdist.py
command/bdist.py
+1
-2
command/bdist_dumb.py
command/bdist_dumb.py
+1
-7
command/build_ext.py
command/build_ext.py
+1
-25
command/install.py
command/install.py
+0
-15
emxccompiler.py
emxccompiler.py
+0
-315
spawn.py
spawn.py
+1
-23
sysconfig.py
sysconfig.py
+0
-24
tests/test_bdist_dumb.py
tests/test_bdist_dumb.py
+0
-2
tests/test_install.py
tests/test_install.py
+1
-1
tests/test_util.py
tests/test_util.py
+1
-1
util.py
util.py
+0
-6
No files found.
ccompiler.py
View file @
495e4bf6
...
@@ -351,7 +351,7 @@ class CCompiler:
...
@@ -351,7 +351,7 @@ class CCompiler:
return
macros
,
objects
,
extra
,
pp_opts
,
build
return
macros
,
objects
,
extra
,
pp_opts
,
build
def
_get_cc_args
(
self
,
pp_opts
,
debug
,
before
):
def
_get_cc_args
(
self
,
pp_opts
,
debug
,
before
):
# works for unixccompiler,
emxccompiler,
cygwinccompiler
# works for unixccompiler, cygwinccompiler
cc_args
=
pp_opts
+
[
'-c'
]
cc_args
=
pp_opts
+
[
'-c'
]
if
debug
:
if
debug
:
cc_args
[:
0
]
=
[
'-g'
]
cc_args
[:
0
]
=
[
'-g'
]
...
@@ -926,7 +926,6 @@ _default_compilers = (
...
@@ -926,7 +926,6 @@ _default_compilers = (
# on a cygwin built python we can use gcc like an ordinary UNIXish
# on a cygwin built python we can use gcc like an ordinary UNIXish
# compiler
# compiler
(
'cygwin.*'
,
'unix'
),
(
'cygwin.*'
,
'unix'
),
(
'os2emx'
,
'emx'
),
# OS name mappings
# OS name mappings
(
'posix'
,
'unix'
),
(
'posix'
,
'unix'
),
...
@@ -968,8 +967,6 @@ compiler_class = { 'unix': ('unixccompiler', 'UnixCCompiler',
...
@@ -968,8 +967,6 @@ compiler_class = { 'unix': ('unixccompiler', 'UnixCCompiler',
"Mingw32 port of GNU C Compiler for Win32"
),
"Mingw32 port of GNU C Compiler for Win32"
),
'bcpp'
:
(
'bcppcompiler'
,
'BCPPCompiler'
,
'bcpp'
:
(
'bcppcompiler'
,
'BCPPCompiler'
,
"Borland C++ Compiler"
),
"Borland C++ Compiler"
),
'emx'
:
(
'emxccompiler'
,
'EMXCCompiler'
,
"EMX port of GNU C Compiler for OS/2"
),
}
}
def
show_compilers
():
def
show_compilers
():
...
...
command/bdist.py
View file @
495e4bf6
...
@@ -52,8 +52,7 @@ class bdist(Command):
...
@@ -52,8 +52,7 @@ class bdist(Command):
# This won't do in reality: will need to distinguish RPM-ish Linux,
# This won't do in reality: will need to distinguish RPM-ish Linux,
# Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
# Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
default_format
=
{
'posix'
:
'gztar'
,
default_format
=
{
'posix'
:
'gztar'
,
'nt'
:
'zip'
,
'nt'
:
'zip'
}
'os2'
:
'zip'
}
# Establish the preferred order (for the --help-formats option).
# Establish the preferred order (for the --help-formats option).
format_commands
=
[
'rpm'
,
'gztar'
,
'bztar'
,
'ztar'
,
'tar'
,
format_commands
=
[
'rpm'
,
'gztar'
,
'bztar'
,
'ztar'
,
'tar'
,
...
...
command/bdist_dumb.py
View file @
495e4bf6
...
@@ -38,8 +38,7 @@ class bdist_dumb(Command):
...
@@ -38,8 +38,7 @@ class bdist_dumb(Command):
boolean_options
=
[
'keep-temp'
,
'skip-build'
,
'relative'
]
boolean_options
=
[
'keep-temp'
,
'skip-build'
,
'relative'
]
default_format
=
{
'posix'
:
'gztar'
,
default_format
=
{
'posix'
:
'gztar'
,
'nt'
:
'zip'
,
'nt'
:
'zip'
}
'os2'
:
'zip'
}
def
initialize_options
(
self
):
def
initialize_options
(
self
):
self
.
bdist_dir
=
None
self
.
bdist_dir
=
None
...
@@ -85,11 +84,6 @@ class bdist_dumb(Command):
...
@@ -85,11 +84,6 @@ class bdist_dumb(Command):
archive_basename
=
"%s.%s"
%
(
self
.
distribution
.
get_fullname
(),
archive_basename
=
"%s.%s"
%
(
self
.
distribution
.
get_fullname
(),
self
.
plat_name
)
self
.
plat_name
)
# OS/2 objects to any ":" characters in a filename (such as when
# a timestamp is used in a version) so change them to hyphens.
if
os
.
name
==
"os2"
:
archive_basename
=
archive_basename
.
replace
(
":"
,
"-"
)
pseudoinstall_root
=
os
.
path
.
join
(
self
.
dist_dir
,
archive_basename
)
pseudoinstall_root
=
os
.
path
.
join
(
self
.
dist_dir
,
archive_basename
)
if
not
self
.
relative
:
if
not
self
.
relative
:
archive_root
=
self
.
bdist_dir
archive_root
=
self
.
bdist_dir
...
...
command/build_ext.py
View file @
495e4bf6
...
@@ -223,11 +223,6 @@ class build_ext(Command):
...
@@ -223,11 +223,6 @@ class build_ext(Command):
self
.
library_dirs
.
append
(
os
.
path
.
join
(
sys
.
exec_prefix
,
self
.
library_dirs
.
append
(
os
.
path
.
join
(
sys
.
exec_prefix
,
'PC'
,
'VC6'
))
'PC'
,
'VC6'
))
# OS/2 (EMX) doesn't support Debug vs Release builds, but has the
# import libraries in its "Config" subdirectory
if
os
.
name
==
'os2'
:
self
.
library_dirs
.
append
(
os
.
path
.
join
(
sys
.
exec_prefix
,
'Config'
))
# for extensions under Cygwin and AtheOS Python's library directory must be
# for extensions under Cygwin and AtheOS Python's library directory must be
# appended to library_dirs
# appended to library_dirs
if
sys
.
platform
[:
6
]
==
'cygwin'
or
sys
.
platform
[:
6
]
==
'atheos'
:
if
sys
.
platform
[:
6
]
==
'cygwin'
or
sys
.
platform
[:
6
]
==
'atheos'
:
...
@@ -613,9 +608,6 @@ class build_ext(Command):
...
@@ -613,9 +608,6 @@ class build_ext(Command):
return
fn
return
fn
else
:
else
:
return
"swig.exe"
return
"swig.exe"
elif
os
.
name
==
"os2"
:
# assume swig available in the PATH.
return
"swig.exe"
else
:
else
:
raise
DistutilsPlatformError
(
raise
DistutilsPlatformError
(
"I don't know how to find (much less run) SWIG "
"I don't know how to find (much less run) SWIG "
...
@@ -666,9 +658,6 @@ class build_ext(Command):
...
@@ -666,9 +658,6 @@ class build_ext(Command):
"""
"""
from
distutils.sysconfig
import
get_config_var
from
distutils.sysconfig
import
get_config_var
ext_path
=
ext_name
.
split
(
'.'
)
ext_path
=
ext_name
.
split
(
'.'
)
# OS/2 has an 8 character module (extension) limit :-(
if
os
.
name
==
"os2"
:
ext_path
[
len
(
ext_path
)
-
1
]
=
ext_path
[
len
(
ext_path
)
-
1
][:
8
]
# extensions in debug_mode are named 'module_d.pyd' under windows
# extensions in debug_mode are named 'module_d.pyd' under windows
so_ext
=
get_config_var
(
'SO'
)
so_ext
=
get_config_var
(
'SO'
)
if
os
.
name
==
'nt'
and
self
.
debug
:
if
os
.
name
==
'nt'
and
self
.
debug
:
...
@@ -689,7 +678,7 @@ class build_ext(Command):
...
@@ -689,7 +678,7 @@ class build_ext(Command):
def
get_libraries
(
self
,
ext
):
def
get_libraries
(
self
,
ext
):
"""Return the list of libraries to link against when building a
"""Return the list of libraries to link against when building a
shared extension. On most platforms, this is just 'ext.libraries';
shared extension. On most platforms, this is just 'ext.libraries';
on Windows
and OS/2
, we add the Python library (eg. python20.dll).
on Windows, we add the Python library (eg. python20.dll).
"""
"""
# The python library is always needed on Windows. For MSVC, this
# The python library is always needed on Windows. For MSVC, this
# is redundant, since the library is mentioned in a pragma in
# is redundant, since the library is mentioned in a pragma in
...
@@ -709,19 +698,6 @@ class build_ext(Command):
...
@@ -709,19 +698,6 @@ class build_ext(Command):
return
ext
.
libraries
+
[
pythonlib
]
return
ext
.
libraries
+
[
pythonlib
]
else
:
else
:
return
ext
.
libraries
return
ext
.
libraries
elif
sys
.
platform
==
"os2emx"
:
# EMX/GCC requires the python library explicitly, and I
# believe VACPP does as well (though not confirmed) - AIM Apr01
template
=
"python%d%d"
# debug versions of the main DLL aren't supported, at least
# not at this time - AIM Apr01
#if self.debug:
# template = template + '_d'
pythonlib
=
(
template
%
(
sys
.
hexversion
>>
24
,
(
sys
.
hexversion
>>
16
)
&
0xff
))
# don't extend ext.libraries, it may be shared with other
# extensions, it is a reference to the original list
return
ext
.
libraries
+
[
pythonlib
]
elif
sys
.
platform
[:
6
]
==
"cygwin"
:
elif
sys
.
platform
[:
6
]
==
"cygwin"
:
template
=
"python%d.%d"
template
=
"python%d.%d"
pythonlib
=
(
template
%
pythonlib
=
(
template
%
...
...
command/install.py
View file @
495e4bf6
...
@@ -58,13 +58,6 @@ INSTALL_SCHEMES = {
...
@@ -58,13 +58,6 @@ INSTALL_SCHEMES = {
'data'
:
'$base'
,
'data'
:
'$base'
,
},
},
'nt'
:
WINDOWS_SCHEME
,
'nt'
:
WINDOWS_SCHEME
,
'os2'
:
{
'purelib'
:
'$base/Lib/site-packages'
,
'platlib'
:
'$base/Lib/site-packages'
,
'headers'
:
'$base/Include/$dist_name'
,
'scripts'
:
'$base/Scripts'
,
'data'
:
'$base'
,
},
}
}
# user site schemes
# user site schemes
...
@@ -86,14 +79,6 @@ if HAS_USER_SITE:
...
@@ -86,14 +79,6 @@ if HAS_USER_SITE:
'data'
:
'$userbase'
,
'data'
:
'$userbase'
,
}
}
INSTALL_SCHEMES
[
'os2_home'
]
=
{
'purelib'
:
'$usersite'
,
'platlib'
:
'$usersite'
,
'headers'
:
'$userbase/include/python$py_version_short/$dist_name'
,
'scripts'
:
'$userbase/bin'
,
'data'
:
'$userbase'
,
}
# The keys to an installation scheme; if any new types of files are to be
# The keys to an installation scheme; if any new types of files are to be
# installed, be sure to add an entry to every installation scheme above,
# installed, be sure to add an entry to every installation scheme above,
# and to SCHEME_KEYS here.
# and to SCHEME_KEYS here.
...
...
emxccompiler.py
deleted
100644 → 0
View file @
ff678506
This diff is collapsed.
Click to expand it.
spawn.py
View file @
495e4bf6
...
@@ -32,8 +32,6 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
...
@@ -32,8 +32,6 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0):
_spawn_posix
(
cmd
,
search_path
,
dry_run
=
dry_run
)
_spawn_posix
(
cmd
,
search_path
,
dry_run
=
dry_run
)
elif
os
.
name
==
'nt'
:
elif
os
.
name
==
'nt'
:
_spawn_nt
(
cmd
,
search_path
,
dry_run
=
dry_run
)
_spawn_nt
(
cmd
,
search_path
,
dry_run
=
dry_run
)
elif
os
.
name
==
'os2'
:
_spawn_os2
(
cmd
,
search_path
,
dry_run
=
dry_run
)
else
:
else
:
raise
DistutilsPlatformError
(
raise
DistutilsPlatformError
(
"don't know how to spawn programs on platform '%s'"
%
os
.
name
)
"don't know how to spawn programs on platform '%s'"
%
os
.
name
)
...
@@ -74,26 +72,6 @@ def _spawn_nt(cmd, search_path=1, verbose=0, dry_run=0):
...
@@ -74,26 +72,6 @@ def _spawn_nt(cmd, search_path=1, verbose=0, dry_run=0):
raise
DistutilsExecError
(
raise
DistutilsExecError
(
"command '%s' failed with exit status %d"
%
(
cmd
[
0
],
rc
))
"command '%s' failed with exit status %d"
%
(
cmd
[
0
],
rc
))
def
_spawn_os2
(
cmd
,
search_path
=
1
,
verbose
=
0
,
dry_run
=
0
):
executable
=
cmd
[
0
]
if
search_path
:
# either we find one or it stays the same
executable
=
find_executable
(
executable
)
or
executable
log
.
info
(
' '
.
join
([
executable
]
+
cmd
[
1
:]))
if
not
dry_run
:
# spawnv for OS/2 EMX requires a full path to the .exe
try
:
rc
=
os
.
spawnv
(
os
.
P_WAIT
,
executable
,
cmd
)
except
OSError
as
exc
:
# this seems to happen when the command isn't found
raise
DistutilsExecError
(
"command '%s' failed: %s"
%
(
cmd
[
0
],
exc
.
args
[
-
1
]))
if
rc
!=
0
:
# and this reflects the command running but failing
log
.
debug
(
"command '%s' failed with exit status %d"
%
(
cmd
[
0
],
rc
))
raise
DistutilsExecError
(
"command '%s' failed with exit status %d"
%
(
cmd
[
0
],
rc
))
if
sys
.
platform
==
'darwin'
:
if
sys
.
platform
==
'darwin'
:
from
distutils
import
sysconfig
from
distutils
import
sysconfig
_cfg_target
=
None
_cfg_target
=
None
...
@@ -180,7 +158,7 @@ def find_executable(executable, path=None):
...
@@ -180,7 +158,7 @@ def find_executable(executable, path=None):
paths
=
path
.
split
(
os
.
pathsep
)
paths
=
path
.
split
(
os
.
pathsep
)
base
,
ext
=
os
.
path
.
splitext
(
executable
)
base
,
ext
=
os
.
path
.
splitext
(
executable
)
if
(
sys
.
platform
==
'win32'
or
os
.
name
==
'os2'
)
and
(
ext
!=
'.exe'
):
if
(
sys
.
platform
==
'win32'
)
and
(
ext
!=
'.exe'
):
executable
=
executable
+
'.exe'
executable
=
executable
+
'.exe'
if
not
os
.
path
.
isfile
(
executable
):
if
not
os
.
path
.
isfile
(
executable
):
...
...
sysconfig.py
View file @
495e4bf6
...
@@ -110,8 +110,6 @@ def get_python_inc(plat_specific=0, prefix=None):
...
@@ -110,8 +110,6 @@ def get_python_inc(plat_specific=0, prefix=None):
return
os
.
path
.
join
(
prefix
,
"include"
,
python_dir
)
return
os
.
path
.
join
(
prefix
,
"include"
,
python_dir
)
elif
os
.
name
==
"nt"
:
elif
os
.
name
==
"nt"
:
return
os
.
path
.
join
(
prefix
,
"include"
)
return
os
.
path
.
join
(
prefix
,
"include"
)
elif
os
.
name
==
"os2"
:
return
os
.
path
.
join
(
prefix
,
"Include"
)
else
:
else
:
raise
DistutilsPlatformError
(
raise
DistutilsPlatformError
(
"I don't know where Python installs its C header files "
"I don't know where Python installs its C header files "
...
@@ -153,11 +151,6 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
...
@@ -153,11 +151,6 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
return
prefix
return
prefix
else
:
else
:
return
os
.
path
.
join
(
prefix
,
"Lib"
,
"site-packages"
)
return
os
.
path
.
join
(
prefix
,
"Lib"
,
"site-packages"
)
elif
os
.
name
==
"os2"
:
if
standard_lib
:
return
os
.
path
.
join
(
prefix
,
"Lib"
)
else
:
return
os
.
path
.
join
(
prefix
,
"Lib"
,
"site-packages"
)
else
:
else
:
raise
DistutilsPlatformError
(
raise
DistutilsPlatformError
(
"I don't know where Python installs its library "
"I don't know where Python installs its library "
...
@@ -492,23 +485,6 @@ def _init_nt():
...
@@ -492,23 +485,6 @@ def _init_nt():
_config_vars = g
_config_vars = g
def _init_os2():
"""Initialize the module as appropriate for OS/2"""
g = {}
# set basic install directories
g['LIBDEST'] = get_python_lib(plat_specific=0, standard_lib=1)
g['BINLIBDEST'] = get_python_lib(plat_specific=1, standard_lib=1)
# XXX hmmm.. a normal install puts include files here
g['INCLUDEPY'] = get_python_inc(plat_specific=0)
g['SO'] = '.pyd'
g['EXE'] = "
.
exe
"
global _config_vars
_config_vars = g
def get_config_vars(*args):
def get_config_vars(*args):
"""With no arguments, return a dictionary of all configuration
"""With no arguments, return a dictionary of all configuration
variables relevant for the current platform. Generally this includes
variables relevant for the current platform. Generally this includes
...
...
tests/test_bdist_dumb.py
View file @
495e4bf6
...
@@ -75,8 +75,6 @@ class BuildDumbTestCase(support.TempdirManager,
...
@@ -75,8 +75,6 @@ class BuildDumbTestCase(support.TempdirManager,
# see what we have
# see what we have
dist_created
=
os
.
listdir
(
os
.
path
.
join
(
pkg_dir
,
'dist'
))
dist_created
=
os
.
listdir
(
os
.
path
.
join
(
pkg_dir
,
'dist'
))
base
=
"%s.%s.zip"
%
(
dist
.
get_fullname
(),
cmd
.
plat_name
)
base
=
"%s.%s.zip"
%
(
dist
.
get_fullname
(),
cmd
.
plat_name
)
if
os
.
name
==
'os2'
:
base
=
base
.
replace
(
':'
,
'-'
)
self
.
assertEqual
(
dist_created
,
[
base
])
self
.
assertEqual
(
dist_created
,
[
base
])
...
...
tests/test_install.py
View file @
495e4bf6
...
@@ -94,7 +94,7 @@ class InstallTestCase(support.TempdirManager,
...
@@ -94,7 +94,7 @@ class InstallTestCase(support.TempdirManager,
self
.
addCleanup
(
cleanup
)
self
.
addCleanup
(
cleanup
)
for
key
in
(
'nt_user'
,
'unix_user'
,
'os2_home'
):
for
key
in
(
'nt_user'
,
'unix_user'
):
self
.
assertIn
(
key
,
INSTALL_SCHEMES
)
self
.
assertIn
(
key
,
INSTALL_SCHEMES
)
dist
=
Distribution
({
'name'
:
'xx'
})
dist
=
Distribution
({
'name'
:
'xx'
})
...
...
tests/test_util.py
View file @
495e4bf6
...
@@ -236,7 +236,7 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
...
@@ -236,7 +236,7 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
self
.
assertRaises
(
DistutilsPlatformError
,
self
.
assertRaises
(
DistutilsPlatformError
,
change_root
,
'c:
\
\
root'
,
'its
\
\
here'
)
change_root
,
'c:
\
\
root'
,
'its
\
\
here'
)
# XXX platforms to be covered:
os2,
mac
# XXX platforms to be covered: mac
def
test_check_environ
(
self
):
def
test_check_environ
(
self
):
util
.
_environ_checked
=
0
util
.
_environ_checked
=
0
...
...
util.py
View file @
495e4bf6
...
@@ -154,12 +154,6 @@ def change_root (new_root, pathname):
...
@@ -154,12 +154,6 @@ def change_root (new_root, pathname):
path = path[1:]
path = path[1:]
return os.path.join(new_root, path)
return os.path.join(new_root, path)
elif os.name == '
os2
':
(drive, path) = os.path.splitdrive(pathname)
if path[0] == os.sep:
path = path[1:]
return os.path.join(new_root, path)
else:
else:
raise DistutilsPlatformError("nothing known about platform '
%
s
'" % os.name)
raise DistutilsPlatformError("nothing known about platform '
%
s
'" % os.name)
...
...
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