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
cf7713b4
Commit
cf7713b4
authored
Jun 27, 2016
by
Steve Dower
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include libs folder in nuget package and allow preinstalling packages
parent
f8aec6fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
11 deletions
+29
-11
Tools/msi/make_zip.py
Tools/msi/make_zip.py
+25
-9
Tools/nuget/make_pkg.proj
Tools/nuget/make_pkg.proj
+4
-2
No files found.
Tools/msi/make_zip.py
View file @
cf7713b4
...
@@ -12,9 +12,19 @@ from zipfile import ZipFile, ZIP_DEFLATED
...
@@ -12,9 +12,19 @@ from zipfile import ZipFile, ZIP_DEFLATED
import
subprocess
import
subprocess
TKTCL_RE
=
re
.
compile
(
r'^(_?tk|tcl).+\
.(pyd|dll)
', re.IGNORECASE)
TKTCL_RE
=
re
.
compile
(
r'^(_?tk|tcl).+\
.(pyd|dll)
', re.IGNORECASE)
DEBUG_RE = re.compile(r'
_d
\
.(
pyd
|
dll
|
exe
)
$
', re.IGNORECASE)
DEBUG_RE = re.compile(r'
_d
\
.(
pyd
|
dll
|
exe
|
pdb
|
lib
)
$
', re.IGNORECASE)
PYTHON_DLL_RE = re.compile(r'
python
\
d
\
d
?
\
.
dll
$
', re.IGNORECASE)
PYTHON_DLL_RE = re.compile(r'
python
\
d
\
d
?
\
.
dll
$
', re.IGNORECASE)
DEBUG_FILES = {
'
_ctypes_test
',
'
_testbuffer
',
'
_testcapi
',
'
_testimportmultiple
',
'
_testmultiphase
',
'
xxlimited
',
'
python3_dstub
',
}
EXCLUDE_FROM_LIBRARY = {
EXCLUDE_FROM_LIBRARY = {
'
__pycache__
',
'
__pycache__
',
'
ensurepip
',
'
ensurepip
',
...
@@ -30,6 +40,12 @@ EXCLUDE_FILE_FROM_LIBRARY = {
...
@@ -30,6 +40,12 @@ EXCLUDE_FILE_FROM_LIBRARY = {
'
bdist_wininst
.
py
',
'
bdist_wininst
.
py
',
}
}
EXCLUDE_FILE_FROM_LIBS = {
'
ssleay
',
'
libeay
',
'
python3stub
',
}
def is_not_debug(p):
def is_not_debug(p):
if DEBUG_RE.search(p.name):
if DEBUG_RE.search(p.name):
return False
return False
...
@@ -37,14 +53,7 @@ def is_not_debug(p):
...
@@ -37,14 +53,7 @@ def is_not_debug(p):
if TKTCL_RE.search(p.name):
if TKTCL_RE.search(p.name):
return False
return False
return p.name.lower() not in {
return p.stem.lower() not in DEBUG_FILES
'
_ctypes_test
.
pyd
',
'
_testbuffer
.
pyd
',
'
_testcapi
.
pyd
',
'
_testimportmultiple
.
pyd
',
'
_testmultiphase
.
pyd
',
'
xxlimited
.
pyd
',
}
def is_not_debug_or_python(p):
def is_not_debug_or_python(p):
return is_not_debug(p) and not PYTHON_DLL_RE.search(p.name)
return is_not_debug(p) and not PYTHON_DLL_RE.search(p.name)
...
@@ -68,6 +77,12 @@ def include_in_lib(p):
...
@@ -68,6 +77,12 @@ def include_in_lib(p):
suffix = p.suffix.lower()
suffix = p.suffix.lower()
return suffix not in {'
.
pyc
', '
.
pyo
', '
.
exe
'}
return suffix not in {'
.
pyc
', '
.
pyo
', '
.
exe
'}
def include_in_libs(p):
if not is_not_debug(p):
return False
return p.stem.lower() not in EXCLUDE_FILE_FROM_LIBS
def include_in_tools(p):
def include_in_tools(p):
if p.is_dir() and p.name.lower() in {'
scripts
', '
i18n
', '
pynche
', '
demo
', '
parser
'}:
if p.is_dir() and p.name.lower() in {'
scripts
', '
i18n
', '
pynche
', '
demo
', '
parser
'}:
return True
return True
...
@@ -84,6 +99,7 @@ FULL_LAYOUT = [
...
@@ -84,6 +99,7 @@ FULL_LAYOUT = [
('
include
/
', '
include
', '
*
.
h
', None),
('
include
/
', '
include
', '
*
.
h
', None),
('
include
/
', '
PC
', '
pyconfig
.
h
', None),
('
include
/
', '
PC
', '
pyconfig
.
h
', None),
('
Lib
/
', '
Lib
', '
**/*
', include_in_lib),
('
Lib
/
', '
Lib
', '
**/*
', include_in_lib),
('
libs
/
', '
PCBuild
/
$
arch
', '
*
.
lib
', include_in_libs),
('
Tools
/
', '
Tools
', '
**/*
', include_in_tools),
('
Tools
/
', '
Tools
', '
**/*
', include_in_tools),
]
]
...
...
Tools/nuget/make_pkg.proj
View file @
cf7713b4
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<SignOutput>
false
</SignOutput>
<SignOutput>
false
</SignOutput>
<TargetName>
$(OutputName).$(NuspecVersion)
</TargetName>
<TargetName>
$(OutputName).$(NuspecVersion)
</TargetName>
<TargetExt>
.nupkg
</TargetExt>
<TargetExt>
.nupkg
</TargetExt>
<TargetPath>
$(OutputPath)\
en-us\
$(TargetName)$(TargetExt)
</TargetPath>
<TargetPath>
$(OutputPath)\$(TargetName)$(TargetExt)
</TargetPath>
<IntermediateOutputPath>
$(IntermediateOutputPath)\nuget_$(ArchName)
</IntermediateOutputPath>
<IntermediateOutputPath>
$(IntermediateOutputPath)\nuget_$(ArchName)
</IntermediateOutputPath>
<CleanCommand>
rmdir /q/s "$(IntermediateOutputPath)"
</CleanCommand>
<CleanCommand>
rmdir /q/s "$(IntermediateOutputPath)"
</CleanCommand>
...
@@ -26,10 +26,11 @@
...
@@ -26,10 +26,11 @@
<PythonArguments>
$(PythonArguments) -t "$(IntermediateOutputPath)" -a $(ArchName)
</PythonArguments>
<PythonArguments>
$(PythonArguments) -t "$(IntermediateOutputPath)" -a $(ArchName)
</PythonArguments>
<PipArguments>
"$(IntermediateOutputPath)\python.exe" -B -c "import sys; sys.path.append(r'$(PySourcePath)\Lib'); import ensurepip; ensurepip._main()"
</PipArguments>
<PipArguments>
"$(IntermediateOutputPath)\python.exe" -B -c "import sys; sys.path.append(r'$(PySourcePath)\Lib'); import ensurepip; ensurepip._main()"
</PipArguments>
<PackageArguments
Condition=
"$(Packages) != ''"
>
"$(IntermediateOutputPath)\python.exe" -B -m pip install -U $(Packages)
</PackageArguments>
<NugetArguments>
"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).nuspec"
</NugetArguments>
<NugetArguments>
"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).nuspec"
</NugetArguments>
<NugetArguments>
$(NugetArguments) -BasePath "$(IntermediateOutputPath)"
</NugetArguments>
<NugetArguments>
$(NugetArguments) -BasePath "$(IntermediateOutputPath)"
</NugetArguments>
<NugetArguments>
$(NugetArguments) -OutputDirectory "$(OutputPath
)\en-us
"
</NugetArguments>
<NugetArguments>
$(NugetArguments) -OutputDirectory "$(OutputPath
.Trim(`\`))
"
</NugetArguments>
<NugetArguments>
$(NugetArguments) -Version "$(NuspecVersion)"
</NugetArguments>
<NugetArguments>
$(NugetArguments) -Version "$(NuspecVersion)"
</NugetArguments>
<NugetArguments>
$(NugetArguments) -NoPackageAnalysis -NonInteractive
</NugetArguments>
<NugetArguments>
$(NugetArguments) -NoPackageAnalysis -NonInteractive
</NugetArguments>
...
@@ -47,6 +48,7 @@ set VCREDIST_PATH=$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.
...
@@ -47,6 +48,7 @@ set VCREDIST_PATH=$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.
<Exec
Command=
"$(Environment)
<Exec
Command=
"$(Environment)
$(PythonArguments)"
/>
$(PythonArguments)"
/>
<Exec
Command=
"$(PipArguments)"
/>
<Exec
Command=
"$(PipArguments)"
/>
<Exec
Command=
"$(PackageArguments)"
Condition=
"$(PackageArguments) != ''"
/>
<Exec
Command=
"$(NugetArguments)"
/>
<Exec
Command=
"$(NugetArguments)"
/>
</Target>
</Target>
...
...
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