Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
2bc55e48
Kaydet (Commit)
2bc55e48
authored
May 22, 2011
tarafından
Tarek Ziade
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 10126 - backported distutils fix for the enable-share mode into packaging
üst
1e045b18
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
7 deletions
+30
-7
build_ext.py
Lib/packaging/command/build_ext.py
+3
-3
__init__.py
Lib/packaging/compiler/__init__.py
+3
-3
test_command_build_ext.py
Lib/packaging/tests/test_command_build_ext.py
+24
-1
No files found.
Lib/packaging/command/build_ext.py
Dosyayı görüntüle @
2bc55e48
...
@@ -658,9 +658,9 @@ class build_ext(Command):
...
@@ -658,9 +658,9 @@ class build_ext(Command):
else
:
else
:
if
sysconfig
.
get_config_var
(
'Py_ENABLE_SHARED'
):
if
sysconfig
.
get_config_var
(
'Py_ENABLE_SHARED'
):
template
=
"python
%
d.
%
d"
pythonlib
=
'python{}.{}{}'
.
format
(
pythonlib
=
(
template
%
sys
.
hexversion
>>
24
,
(
sys
.
hexversion
>>
16
)
&
0xff
,
(
sys
.
hexversion
>>
24
,
(
sys
.
hexversion
>>
16
)
&
0xff
)
)
sys
.
abiflags
)
return
ext
.
libraries
+
[
pythonlib
]
return
ext
.
libraries
+
[
pythonlib
]
else
:
else
:
return
ext
.
libraries
return
ext
.
libraries
Lib/packaging/compiler/__init__.py
Dosyayı görüntüle @
2bc55e48
...
@@ -16,11 +16,11 @@ set_compiler, show_compilers.
...
@@ -16,11 +16,11 @@ set_compiler, show_compilers.
import
os
import
os
import
sys
import
sys
import
re
import
re
import
sysconfig
import
sysconfig
from
packaging.util
import
resolve_name
from
packaging.util
import
resolve_name
from
packaging.errors
import
PackagingPlatformError
from
packaging.errors
import
PackagingPlatformError
from
packaging
import
logger
def
customize_compiler
(
compiler
):
def
customize_compiler
(
compiler
):
"""Do any platform-specific customization of a CCompiler instance.
"""Do any platform-specific customization of a CCompiler instance.
...
@@ -274,7 +274,7 @@ def gen_lib_options(compiler, library_dirs, runtime_library_dirs, libraries):
...
@@ -274,7 +274,7 @@ def gen_lib_options(compiler, library_dirs, runtime_library_dirs, libraries):
if
lib_file
is
not
None
:
if
lib_file
is
not
None
:
lib_opts
.
append
(
lib_file
)
lib_opts
.
append
(
lib_file
)
else
:
else
:
compiler
.
warn
(
"no library file corresponding to "
logger
.
warning
(
"no library file corresponding to "
"'
%
s' found (skipping)"
%
lib
)
"'
%
s' found (skipping)"
%
lib
)
else
:
else
:
lib_opts
.
append
(
compiler
.
library_option
(
lib
))
lib_opts
.
append
(
compiler
.
library_option
(
lib
))
...
...
Lib/packaging/tests/test_command_build_ext.py
Dosyayı görüntüle @
2bc55e48
...
@@ -31,11 +31,31 @@ class BuildExtTestCase(support.TempdirManager,
...
@@ -31,11 +31,31 @@ class BuildExtTestCase(support.TempdirManager,
self
.
tmp_dir
=
self
.
mkdtemp
()
self
.
tmp_dir
=
self
.
mkdtemp
()
self
.
sys_path
=
sys
.
path
,
sys
.
path
[:]
self
.
sys_path
=
sys
.
path
,
sys
.
path
[:]
sys
.
path
.
append
(
self
.
tmp_dir
)
sys
.
path
.
append
(
self
.
tmp_dir
)
shutil
.
copy
(
_get_source_filename
(),
self
.
tmp_dir
)
filename
=
_get_source_filename
()
shutil
.
copy
(
filename
,
self
.
tmp_dir
)
self
.
old_user_base
=
site
.
USER_BASE
self
.
old_user_base
=
site
.
USER_BASE
site
.
USER_BASE
=
self
.
mkdtemp
()
site
.
USER_BASE
=
self
.
mkdtemp
()
build_ext
.
USER_BASE
=
site
.
USER_BASE
build_ext
.
USER_BASE
=
site
.
USER_BASE
def
_fixup_command
(
self
,
cmd
):
# When Python was build with --enable-shared, -L. is not good enough
# to find the libpython<blah>.so. This is because regrtest runs it
# under a tempdir, not in the top level where the .so lives. By the
# time we've gotten here, Python's already been chdir'd to the
# tempdir.
#
# To further add to the fun, we can't just add library_dirs to the
# Extension() instance because that doesn't get plumbed through to the
# final compiler command.
if
(
sysconfig
.
get_config_var
(
'Py_ENABLE_SHARED'
)
and
not
sys
.
platform
.
startswith
(
'win'
)):
runshared
=
sysconfig
.
get_config_var
(
'RUNSHARED'
)
if
runshared
is
None
:
cmd
.
library_dirs
=
[
'.'
]
else
:
name
,
equals
,
value
=
runshared
.
partition
(
'='
)
cmd
.
library_dirs
=
value
.
split
(
os
.
pathsep
)
def
test_build_ext
(
self
):
def
test_build_ext
(
self
):
global
ALREADY_TESTED
global
ALREADY_TESTED
xx_c
=
os
.
path
.
join
(
self
.
tmp_dir
,
'xxmodule.c'
)
xx_c
=
os
.
path
.
join
(
self
.
tmp_dir
,
'xxmodule.c'
)
...
@@ -43,6 +63,8 @@ class BuildExtTestCase(support.TempdirManager,
...
@@ -43,6 +63,8 @@ class BuildExtTestCase(support.TempdirManager,
dist
=
Distribution
({
'name'
:
'xx'
,
'ext_modules'
:
[
xx_ext
]})
dist
=
Distribution
({
'name'
:
'xx'
,
'ext_modules'
:
[
xx_ext
]})
dist
.
package_dir
=
self
.
tmp_dir
dist
.
package_dir
=
self
.
tmp_dir
cmd
=
build_ext
(
dist
)
cmd
=
build_ext
(
dist
)
self
.
_fixup_command
(
cmd
)
if
os
.
name
==
"nt"
:
if
os
.
name
==
"nt"
:
# On Windows, we must build a debug version iff running
# On Windows, we must build a debug version iff running
# a debug build of Python
# a debug build of Python
...
@@ -244,6 +266,7 @@ class BuildExtTestCase(support.TempdirManager,
...
@@ -244,6 +266,7 @@ class BuildExtTestCase(support.TempdirManager,
dist
=
Distribution
({
'name'
:
'xx'
,
dist
=
Distribution
({
'name'
:
'xx'
,
'ext_modules'
:
[
ext
]})
'ext_modules'
:
[
ext
]})
cmd
=
build_ext
(
dist
)
cmd
=
build_ext
(
dist
)
self
.
_fixup_command
(
cmd
)
cmd
.
ensure_finalized
()
cmd
.
ensure_finalized
()
self
.
assertEqual
(
len
(
cmd
.
get_outputs
()),
1
)
self
.
assertEqual
(
len
(
cmd
.
get_outputs
()),
1
)
...
...
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