|
Original |
Translation |
|
25
|
|
Différences selon les plateformes
|
|
26
|
You should always run the setup command from the distribution root directory, i.e. the top-level subdirectory that the module source distribution unpacks into. For example, if you've just downloaded a module source distribution :file:`foo-1.0.tar.gz` onto a Unix system, the normal thing to do is::
|
Vous devez toujours exécuter la commande "setup" à partir du répertoire racine de la distribution, à savoir le sous-répertoire de niveau supérieur à celui où se sont décompressées les sources de la distribution du module. Par exemple, si vous venez de télécharger les sources d'une distribution du module :file:`foo-1.0.tar.gz` sous un système Unix, la méthode normale consiste à faire ::
|
|
27
|
gunzip -c foo-1.0.tar.gz | tar xf - # unpacks into directory foo-1.0 cd foo-1.0 python setup.py install
|
gunzip -c foo-1.0.tar.gz | tar xf - # décompresse dans le répertoire foo-1.0 cd foo-1.0 python setup.py install
|
|
28
|
On Windows, you'd probably download :file:`foo-1.0.zip`. If you downloaded the archive file to :file:`C:\\Temp`, then it would unpack into :file:`C:\\Temp\\foo-1.0`; you can use either a archive manipulator with a graphical user interface (such as WinZip) or a command-line tool (such as :program:`unzip` or :program:`pkunzip`) to unpack the archive. Then, open a command prompt window ("DOS box"), and run::
|
Sous Windows, vous avez probablement téléchargé :file:`foo-1.0.zip`. Si vous avez téléchargé le fichier d'archive dans :file:`C:\Temp`, il se décompressera alors dans :file:`C:\Temp\foo-1.0` ; vous pouvez utiliser soit un manipulateur d'archive avec une interface graphique (comme WinZip) soit un outil de ligne de commande (telles que :program:`unzip` ou :program:`pkunzip`) pour décompresser l'archive. Ensuite, ouvrez une fenêtre d'invite de commandes ("fenêtre DOS") et exécutez ::
|
|
29
|
cd c:\Temp\foo-1.0 python setup.py install
|
cd c:\Temp\foo-1.0 python setup.py install
|
|
30
|
|
31
|
Running ``setup.py install`` builds and installs all modules in one run. If you prefer to work incrementally---especially useful if you want to customize the build process, or if things are going wrong---you can use the setup script to do one thing at a time. This is particularly helpful when the build and install will be done by different users---for example, you might want to build a module distribution and hand it off to a system administrator for installation (or do it yourself, with super-user privileges).
|
Exécuter ``setup.py install`` construit et installe tous les modules en un seul coup. Si vous préférez travailler progressivement -- ce qui est particulièrement utile si vous souhaitez personnaliser le processus de construction, ou si les choses vont mal -- vous pouvez utiliser le script de configuration pour faire une chose à la fois. Cela est particulièrement utile lorsque la construction et l'installation doit être faite par différents utilisateurs -- par exemple, vous pouvez vouloir construire une distribution d'un module et la transférer à un administrateur système pour l'installation (ou le faire vous-même, avec les privilèges de super-utilisateur).
|
|
32
|
For example, you can build everything in one step, and then install everything in a second step, by invoking the setup script twice::
|
Par exemple, vous pouvez construire tout en une seule étape et ensuite installer le tout dans une deuxième étape, en invoquant le script d'installation deux fois ::
|
|
33
|
python setup.py build python setup.py install
|
python setup.py build python setup.py install
|
|
34
|
If you do this, you will notice that running the :command:`install` command first runs the :command:`build` command, which---in this case---quickly notices that it has nothing to do, since everything in the :file:`build` directory is up-to-date.
|
Si vous faites cela, vous remarquerez que l'exécution de la commande :command:`install` lance d'abord la commande :command:`build`, qui, dans ce cas, s'aperçoit vite qu'il n'a rien à faire, puisque tout dans le dossier :file:`build` est à jour.
|