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
9dd99efb
Commit
9dd99efb
authored
Apr 05, 2009
by
Tarek Ziadé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #5095: msi missing from Distutils bdist formats
parent
ea4a61b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
33 deletions
+59
-33
command/bdist.py
command/bdist.py
+16
-33
tests/test_bdist.py
tests/test_bdist.py
+43
-0
No files found.
command/bdist.py
View file @
9dd99efb
...
...
@@ -12,7 +12,7 @@ from distutils.errors import *
from
distutils.util
import
get_platform
def
show_formats
():
def
show_formats
():
"""Print list of available formats (arguments to "--format" option).
"""
from
distutils.fancy_getopt
import
FancyGetopt
...
...
@@ -24,7 +24,7 @@ def show_formats ():
pretty_printer
.
print_help
(
"List of available distribution formats:"
)
class
bdist
(
Command
):
class
bdist
(
Command
):
description
=
"create a built (binary) distribution"
...
...
@@ -50,35 +50,28 @@ class bdist (Command):
]
# The following commands do not take a format option from bdist
no_format_option
=
(
'bdist_rpm'
,
#'bdist_sdux', 'bdist_pkgtool'
)
no_format_option
=
(
'bdist_rpm'
,)
# This won't do in reality: will need to distinguish RPM-ish Linux,
# Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
default_format
=
{
'posix'
:
'gztar'
,
'nt'
:
'zip'
,
'os2'
:
'zip'
,
}
default_format
=
{
'posix'
:
'gztar'
,
'nt'
:
'zip'
,
'os2'
:
'zip'
}
# Establish the preferred order (for the --help-formats option).
format_commands
=
[
'rpm'
,
'gztar'
,
'bztar'
,
'ztar'
,
'tar'
,
'wininst'
,
'zip'
,
#'pkgtool', 'sdux'
]
'wininst'
,
'zip'
,
'msi'
]
# And the real information.
format_command
=
{
'rpm'
:
(
'bdist_rpm'
,
"RPM distribution"
),
'zip'
:
(
'bdist_dumb'
,
"ZIP file"
),
'gztar'
:
(
'bdist_dumb'
,
"gzip'ed tar file"
),
'bztar'
:
(
'bdist_dumb'
,
"bzip2'ed tar file"
),
'ztar'
:
(
'bdist_dumb'
,
"compressed tar file"
),
'tar'
:
(
'bdist_dumb'
,
"tar file"
),
'wininst'
:
(
'bdist_wininst'
,
"Windows executable installer"
),
'zip'
:
(
'bdist_dumb'
,
"ZIP file"
),
#'pkgtool': ('bdist_pkgtool',
# "Solaris pkgtool distribution"),
#'sdux': ('bdist_sdux', "HP-UX swinstall depot"),
format_command
=
{
'rpm'
:
(
'bdist_rpm'
,
"RPM distribution"
),
'gztar'
:
(
'bdist_dumb'
,
"gzip'ed tar file"
),
'bztar'
:
(
'bdist_dumb'
,
"bzip2'ed tar file"
),
'ztar'
:
(
'bdist_dumb'
,
"compressed tar file"
),
'tar'
:
(
'bdist_dumb'
,
"tar file"
),
'wininst'
:
(
'bdist_wininst'
,
"Windows executable installer"
),
'zip'
:
(
'bdist_dumb'
,
"ZIP file"
),
'msi'
:
(
'bdist_msi'
,
"Microsoft Installer"
)
}
...
...
@@ -89,9 +82,6 @@ class bdist (Command):
self
.
dist_dir
=
None
self
.
skip_build
=
0
# initialize_options()
def
finalize_options
(
self
):
# have to finalize 'plat_name' before 'bdist_base'
if
self
.
plat_name
is
None
:
...
...
@@ -120,10 +110,7 @@ class bdist (Command):
if
self
.
dist_dir
is
None
:
self
.
dist_dir
=
"dist"
# finalize_options()
def
run
(
self
):
# Figure out which sub-commands we need to run.
commands
=
[]
for
format
in
self
.
formats
:
...
...
@@ -144,7 +131,3 @@ class bdist (Command):
if
cmd_name
in
commands
[
i
+
1
:]:
sub_cmd
.
keep_temp
=
1
self
.
run_command
(
cmd_name
)
# run()
# class bdist
tests/test_bdist.py
0 → 100644
View file @
9dd99efb
"""Tests for distutils.command.bdist."""
import
unittest
import
sys
import
os
import
tempfile
import
shutil
from
distutils.core
import
Distribution
from
distutils.command.bdist
import
bdist
from
distutils.tests
import
support
from
distutils.spawn
import
find_executable
from
distutils
import
spawn
from
distutils.errors
import
DistutilsExecError
class
BuildTestCase
(
support
.
TempdirManager
,
unittest
.
TestCase
):
def
test_formats
(
self
):
# let's create a command and make sure
# we can fix the format
pkg_pth
,
dist
=
self
.
create_dist
()
cmd
=
bdist
(
dist
)
cmd
.
formats
=
[
'msi'
]
cmd
.
ensure_finalized
()
self
.
assertEquals
(
cmd
.
formats
,
[
'msi'
])
# what format bdist offers ?
# XXX an explicit list in bdist is
# not the best way to bdist_* commands
# we should add a registry
formats
=
[
'rpm'
,
'zip'
,
'gztar'
,
'bztar'
,
'ztar'
,
'tar'
,
'wininst'
,
'msi'
]
formats
.
sort
()
founded
=
cmd
.
format_command
.
keys
()
founded
.
sort
()
self
.
assertEquals
(
founded
,
formats
)
def
test_suite
():
return
unittest
.
makeSuite
(
BuildTestCase
)
if
__name__
==
'__main__'
:
test_support
.
run_unittest
(
test_suite
())
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