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
01423cb5
Unverified
Kaydet (Commit)
01423cb5
authored
Şub 18, 2018
tarafından
Steve Dower
Kaydeden (comit)
GitHub
Şub 18, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Improves the ability to build in CI (GH-5728)
üst
d6ff8a70
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
12 deletions
+21
-12
script_helper.py
Lib/test/support/script_helper.py
+8
-1
test_cmd_line.py
Lib/test/test_cmd_line.py
+5
-5
find_python.bat
PCbuild/find_python.bat
+3
-3
get_externals.bat
PCbuild/get_externals.bat
+2
-2
python.props
PCbuild/python.props
+3
-1
No files found.
Lib/test/support/script_helper.py
Dosyayı görüntüle @
01423cb5
...
...
@@ -36,6 +36,11 @@ def interpreter_requires_environment():
"""
global
__cached_interp_requires_environment
if
__cached_interp_requires_environment
is
None
:
# If PYTHONHOME is set, assume that we need it
if
'PYTHONHOME'
in
os
.
environ
:
__cached_interp_requires_environment
=
True
return
True
# Try running an interpreter with -E to see if it works or not.
try
:
subprocess
.
check_call
([
sys
.
executable
,
'-E'
,
...
...
@@ -166,7 +171,9 @@ def spawn_python(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kw):
kw is extra keyword args to pass to subprocess.Popen. Returns a Popen
object.
"""
cmd_line
=
[
sys
.
executable
,
'-E'
]
cmd_line
=
[
sys
.
executable
]
if
not
interpreter_requires_environment
():
cmd_line
.
append
(
'-E'
)
cmd_line
.
extend
(
args
)
# Under Fedora (?), GNU readline can output junk on stderr when initialized,
# depending on the TERM setting. Setting TERM=vt100 is supposed to disable
...
...
Lib/test/test_cmd_line.py
Dosyayı görüntüle @
01423cb5
...
...
@@ -63,6 +63,8 @@ class CmdLineTest(unittest.TestCase):
rc
,
out
,
err
=
assert_python_ok
(
'-vv'
)
self
.
assertNotIn
(
b
'stack overflow'
,
err
)
@unittest.skipIf
(
interpreter_requires_environment
(),
'Cannot run -E tests when PYTHON env vars are required.'
)
def
test_xoptions
(
self
):
def
get_xoptions
(
*
args
):
# use subprocess module directly because test.support.script_helper adds
...
...
@@ -278,11 +280,7 @@ class CmdLineTest(unittest.TestCase):
def
test_displayhook_unencodable
(
self
):
for
encoding
in
(
'ascii'
,
'latin-1'
,
'utf-8'
):
# We are testing a PYTHON environment variable here, so we can't
# use -E, -I, or script_helper (which uses them). So instead we do
# poor-man's isolation by deleting the PYTHON vars from env.
env
=
{
key
:
value
for
(
key
,
value
)
in
os
.
environ
.
copy
()
.
items
()
if
not
key
.
startswith
(
'PYTHON'
)}
env
=
os
.
environ
.
copy
()
env
[
'PYTHONIOENCODING'
]
=
encoding
p
=
subprocess
.
Popen
(
[
sys
.
executable
,
'-i'
],
...
...
@@ -704,6 +702,8 @@ class CmdLineTest(unittest.TestCase):
self
.
assertEqual
(
proc
.
returncode
,
0
,
proc
)
@unittest.skipIf
(
interpreter_requires_environment
(),
'Cannot run -I tests when PYTHON env vars are required.'
)
class
IgnoreEnvironmentTest
(
unittest
.
TestCase
):
def
run_ignoring_vars
(
self
,
predicate
,
**
env_vars
):
...
...
PCbuild/find_python.bat
Dosyayı görüntüle @
01423cb5
...
...
@@ -31,10 +31,10 @@
@if exist "%_Py_EXTERNALS_DIR%\pythonx86\tools\python.exe" (set PYTHON="%_Py_EXTERNALS_DIR%\pythonx86\tools\python.exe") & (set _Py_Python_Source=found in externals directory) & goto :found
@rem If HOST_PYTHON is recent enough, use that
@if NOT "%HOST_PYTHON%"=="" @%HOST_PYTHON% -c "import sys; assert sys.version_info[:2] >= (3, 6)" >nul 2>nul && (set PYTHON="%HOST_PYTHON%") && (set _Py_Python_Source=found as HOST_PYTHON) && goto :found
@if NOT "%HOST_PYTHON%"=="" @%HOST_PYTHON% -
E
c "import sys; assert sys.version_info[:2] >= (3, 6)" >nul 2>nul && (set PYTHON="%HOST_PYTHON%") && (set _Py_Python_Source=found as HOST_PYTHON) && goto :found
@rem If py.exe finds a recent enough version, use that one
@py -3.6 -V >nul 2>&1 && (set PYTHON=py -3.6) && (set _Py_Python_Source=found with py.exe) && goto :found
@py -3.6 -
E
V >nul 2>&1 && (set PYTHON=py -3.6) && (set _Py_Python_Source=found with py.exe) && goto :found
@if NOT exist "%_Py_EXTERNALS_DIR%" mkdir "%_Py_EXTERNALS_DIR%"
@set _Py_NUGET=%NUGET%
...
...
@@ -50,7 +50,7 @@
@rem If it fails, retry with any available copy of Python
@powershell.exe -Command Invoke-WebRequest %_Py_NUGET_URL% -OutFile '%_Py_NUGET%'
@if errorlevel 1 (
@%_Py_HOST_PYTHON% "%~dp0\urlretrieve.py" "%_Py_NUGET_URL%" "%_Py_NUGET%"
@%_Py_HOST_PYTHON%
-E
"%~dp0\urlretrieve.py" "%_Py_NUGET_URL%" "%_Py_NUGET%"
)
)
@echo Installing Python via nuget...
...
...
PCbuild/get_externals.bat
Dosyayı görüntüle @
01423cb5
...
...
@@ -65,7 +65,7 @@ for %%e in (%libraries%) do (
git clone --depth 1 https://github.com/%ORG%/cpython-source-deps --branch %%e "%EXTERNALS_DIR%\%%e"
) else (
echo.Fetching %%e...
%PYTHON%
"%PCBUILD%\get_external.py" -O %ORG%
%%e
%PYTHON%
-E "%PCBUILD%get_external.py" -O %ORG% -e "%EXTERNALS_DIR%"
%%e
)
)
...
...
@@ -84,7 +84,7 @@ for %%b in (%binaries%) do (
git clone --depth 1 https://github.com/%ORG%/cpython-bin-deps --branch %%b "%EXTERNALS_DIR%\%%b"
) else (
echo.Fetching %%b...
%PYTHON%
"%PCBUILD%\get_external.py" -b -O %ORG%
%%b
%PYTHON%
-E "%PCBUILD%get_external.py" -b -O %ORG% -e "%EXTERNALS_DIR%"
%%b
)
)
...
...
PCbuild/python.props
Dosyayı görüntüle @
01423cb5
...
...
@@ -43,7 +43,9 @@
<BuildPath
Condition=
"$(Configuration) == 'PGInstrument'"
>
$(BuildPath)instrumented\
</BuildPath>
<!-- Directories of external projects. tcltk is handled in tcltk.props -->
<ExternalsDir>
$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals\`))
</ExternalsDir>
<ExternalsDir>
$(EXTERNALS_DIR)
</ExternalsDir>
<ExternalsDir
Condition=
"$(ExternalsDir) == ''"
>
$([System.IO.Path]::GetFullPath(`$(PySourcePath)externals`))
</ExternalsDir>
<ExternalsDir
Condition=
"!HasTrailingSlash($(ExternalsDir))"
>
$(ExternalsDir)\
</ExternalsDir>
<sqlite3Dir>
$(ExternalsDir)sqlite-3.21.0.0\
</sqlite3Dir>
<bz2Dir>
$(ExternalsDir)bzip2-1.0.6\
</bz2Dir>
<lzmaDir>
$(ExternalsDir)xz-5.2.2\
</lzmaDir>
...
...
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