Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b805c47

Browse files
committed
Add examples that work on Windows to distutils docs (#1626300)
1 parent b8f2ad0 commit b805c47

2 files changed

Lines changed: 17 additions & 8 deletions

File tree

Doc/distutils/introduction.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,17 @@ Some observations:
7979
for an example)
8080

8181
To create a source distribution for this module, you would create a setup
82-
script, :file:`setup.py`, containing the above code, and run::
82+
script, :file:`setup.py`, containing the above code, and run this command from a
83+
terminal::
8384

8485
python setup.py sdist
8586

86-
which will create an archive file (e.g., tarball on Unix, ZIP file on Windows)
87+
For Windows, open a command prompt windows ("DOS box") and change the command
88+
to::
89+
90+
setup.py sdist
91+
92+
:command:`sdist` will create an archive file (e.g., tarball on Unix, ZIP file on Windows)
8793
containing your setup script :file:`setup.py`, and your module :file:`foo.py`.
8894
The archive file will be named :file:`foo-1.0.tar.gz` (or :file:`.zip`), and
8995
will unpack into a directory :file:`foo-1.0`.

Doc/install/index.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,16 @@ in the name of the downloaded archive, e.g. :file:`foo-1.0.tar.gz` or
9696
directory: :file:`foo-1.0` or :file:`widget-0.9.7`. Additionally, the
9797
distribution will contain a setup script :file:`setup.py`, and a file named
9898
:file:`README.txt` or possibly just :file:`README`, which should explain that
99-
building and installing the module distribution is a simple matter of running ::
99+
building and installing the module distribution is a simple matter of running
100+
one command from a terminal::
100101

101102
python setup.py install
102103

104+
For Windows, this command should be run from a command prompt windows ("DOS
105+
box")::
106+
107+
setup.py install
108+
103109
If all these things are true, then you already know how to build and install the
104110
modules you've just downloaded: Run the command above. Unless you need to
105111
install things in a non-standard way or customize the build process, you don't
@@ -113,14 +119,11 @@ Standard Build and Install
113119
==========================
114120

115121
As described in section :ref:`inst-new-standard`, building and installing a module
116-
distribution using the Distutils is usually one simple command::
122+
distribution using the Distutils is usually one simple command to run from a
123+
terminal::
117124

118125
python setup.py install
119126

120-
On Unix, you'd run this command from a shell prompt; on Windows, you have to
121-
open a command prompt window ("DOS box") and do it there; on Mac OS X, you open
122-
a :command:`Terminal` window to get a shell prompt.
123-
124127

125128
.. _inst-platform-variations:
126129

0 commit comments

Comments
 (0)