Commit dcc66e81 authored by Jannis Leidel's avatar Jannis Leidel

Added a bunch of code-block directives for better highlighting with Pygments, fixed typo

--HG--
branch : distribute
extra : rebase_source : e000e29a4c561a0397b134d2e451080b34f84b5d
parent 079951a1
...@@ -330,7 +330,9 @@ to restrict downloading to hosts in your own intranet. See the section below ...@@ -330,7 +330,9 @@ to restrict downloading to hosts in your own intranet. See the section below
on `Command-Line Options`_ for more details on the ``--allow-hosts`` option. on `Command-Line Options`_ for more details on the ``--allow-hosts`` option.
By default, there are no host restrictions in effect, but you can change this By default, there are no host restrictions in effect, but you can change this
default by editing the appropriate `configuration files`_ and adding:: default by editing the appropriate `configuration files`_ and adding:
.. code-block:: ini
[easy_install] [easy_install]
allow_hosts = *.myintranet.example.com,*.python.org allow_hosts = *.myintranet.example.com,*.python.org
...@@ -411,7 +413,9 @@ generated directory listing (such as the Apache web server provides). ...@@ -411,7 +413,9 @@ generated directory listing (such as the Apache web server provides).
If you are setting up an intranet site for package downloads, you may want to If you are setting up an intranet site for package downloads, you may want to
configure the target machines to use your download site by default, adding configure the target machines to use your download site by default, adding
something like this to their `configuration files`_:: something like this to their `configuration files`_:
.. code-block:: ini
[easy_install] [easy_install]
find_links = http://mypackages.example.com/somedir/ find_links = http://mypackages.example.com/somedir/
...@@ -445,7 +449,9 @@ Controlling Build Options ...@@ -445,7 +449,9 @@ Controlling Build Options
EasyInstall respects standard distutils `Configuration Files`_, so you can use EasyInstall respects standard distutils `Configuration Files`_, so you can use
them to configure build options for packages that it installs from source. For them to configure build options for packages that it installs from source. For
example, if you are on Windows using the MinGW compiler, you can configure the example, if you are on Windows using the MinGW compiler, you can configure the
default compiler by putting something like this:: default compiler by putting something like this:
.. code-block:: ini
[build] [build]
compiler = mingw32 compiler = mingw32
...@@ -593,7 +599,9 @@ distutils configuration files, under the command heading ``easy_install``. ...@@ -593,7 +599,9 @@ distutils configuration files, under the command heading ``easy_install``.
EasyInstall will look first for a ``setup.cfg`` file in the current directory, EasyInstall will look first for a ``setup.cfg`` file in the current directory,
then a ``~/.pydistutils.cfg`` or ``$HOME\\pydistutils.cfg`` (on Unix-like OSes then a ``~/.pydistutils.cfg`` or ``$HOME\\pydistutils.cfg`` (on Unix-like OSes
and Windows, respectively), and finally a ``distutils.cfg`` file in the and Windows, respectively), and finally a ``distutils.cfg`` file in the
``distutils`` package directory. Here's a simple example:: ``distutils`` package directory. Here's a simple example:
.. code-block:: ini
[easy_install] [easy_install]
...@@ -986,7 +994,9 @@ The next step is to create or modify ``distutils.cfg`` in the ``distutils`` ...@@ -986,7 +994,9 @@ The next step is to create or modify ``distutils.cfg`` in the ``distutils``
directory of your Python library. The correct directory will be something like directory of your Python library. The correct directory will be something like
``/usr/lib/python2.X/distutils`` on most Posix systems and something like ``/usr/lib/python2.X/distutils`` on most Posix systems and something like
``C:\\Python2X\Lib\distutils`` on Windows machines. Add the following lines ``C:\\Python2X\Lib\distutils`` on Windows machines. Add the following lines
to the file, substituting the correct Python version if necessary:: to the file, substituting the correct Python version if necessary:
.. code-block:: ini
[install] [install]
install_lib = ~/lib/python2.3 install_lib = ~/lib/python2.3
...@@ -1031,7 +1041,9 @@ location, because it is already configured to process ``.pth`` files, and ...@@ -1031,7 +1041,9 @@ location, because it is already configured to process ``.pth`` files, and
EasyInstall already knows this. EasyInstall already knows this.
Before installing EasyInstall/setuptools, just create a ``~/.pydistutils.cfg`` Before installing EasyInstall/setuptools, just create a ``~/.pydistutils.cfg``
file with the following contents (or add this to the existing contents):: file with the following contents (or add this to the existing contents):
.. code-block:: ini
[install] [install]
install_lib = ~/Library/Python/$py_version_short/site-packages install_lib = ~/Library/Python/$py_version_short/site-packages
...@@ -1105,7 +1117,9 @@ Assuming that you want to install packages in a directory called ``~/py-lib``, ...@@ -1105,7 +1117,9 @@ Assuming that you want to install packages in a directory called ``~/py-lib``,
and scripts in ``~/bin``, here's what you need to do: and scripts in ``~/bin``, here's what you need to do:
First, edit ``~/.pydistutils.cfg`` to include these settings, if you don't First, edit ``~/.pydistutils.cfg`` to include these settings, if you don't
already have them:: already have them:
.. code-block:: ini
[install] [install]
install_lib = ~/py-lib install_lib = ~/py-lib
......
...@@ -38,7 +38,8 @@ A typical setup.py can look something like this:: ...@@ -38,7 +38,8 @@ A typical setup.py can look something like this::
from setuptools import setup from setuptools import setup
setup(name='your.module', setup(
name='your.module',
version = '1.0', version = '1.0',
description='This is your awesome module', description='This is your awesome module',
author='You', author='You',
...@@ -105,7 +106,8 @@ dict and pass that dict into setup():: ...@@ -105,7 +106,8 @@ dict and pass that dict into setup()::
extra['convert_2to3_doctests'] = ['src/your/module/README.txt'] extra['convert_2to3_doctests'] = ['src/your/module/README.txt']
extra['use_2to3_fixers'] = ['your.fixers'] extra['use_2to3_fixers'] = ['your.fixers']
setup(name='your.module', setup(
name='your.module',
version = '1.0', version = '1.0',
description='This is your awesome module', description='This is your awesome module',
author='You', author='You',
......
...@@ -141,7 +141,7 @@ dependencies, and perhaps some data files and scripts:: ...@@ -141,7 +141,7 @@ dependencies, and perhaps some data files and scripts::
'': ['*.txt', '*.rst'], '': ['*.txt', '*.rst'],
# And include any *.msg files found in the 'hello' package, too: # And include any *.msg files found in the 'hello' package, too:
'hello': ['*.msg'], 'hello': ['*.msg'],
} },
# metadata for upload to PyPI # metadata for upload to PyPI
author = "Me", author = "Me",
...@@ -1117,7 +1117,9 @@ if they do, it might not be the right version. Fixing this is easy; just ...@@ -1117,7 +1117,9 @@ if they do, it might not be the right version. Fixing this is easy; just
download `distribute_setup.py`_, and put it in the same directory as your ``setup.py`` download `distribute_setup.py`_, and put it in the same directory as your ``setup.py``
script. (Be sure to add it to your revision control system, too.) Then add script. (Be sure to add it to your revision control system, too.) Then add
these two lines to the very top of your setup script, before the script imports these two lines to the very top of your setup script, before the script imports
anything from setuptools:: anything from setuptools:
.. code-block:: python
import distribute_setup import distribute_setup
distribute_setup.use_setuptools() distribute_setup.use_setuptools()
...@@ -1573,7 +1575,9 @@ Managing "Continuous Releases" Using Subversion ...@@ -1573,7 +1575,9 @@ Managing "Continuous Releases" Using Subversion
If you expect your users to track in-development versions of your project via If you expect your users to track in-development versions of your project via
Subversion, there are a few additional steps you should take to ensure that Subversion, there are a few additional steps you should take to ensure that
things work smoothly with EasyInstall. First, you should add the following things work smoothly with EasyInstall. First, you should add the following
to your project's ``setup.cfg`` file:: to your project's ``setup.cfg`` file:
.. code-block:: ini
[egg_info] [egg_info]
tag_build = .dev tag_build = .dev
...@@ -1603,7 +1607,9 @@ their checkout URL (as described in the previous section) with an ...@@ -1603,7 +1607,9 @@ their checkout URL (as described in the previous section) with an
to download ``projectname==dev`` in order to get the latest in-development to download ``projectname==dev`` in order to get the latest in-development
code. Note that if your project depends on such in-progress code, you may wish code. Note that if your project depends on such in-progress code, you may wish
to specify your ``install_requires`` (or other requirements) to include to specify your ``install_requires`` (or other requirements) to include
``==dev``, e.g.:: ``==dev``, e.g.:
.. code-block:: python
install_requires = ["OtherProject>=0.2a1.dev-r143,==dev"] install_requires = ["OtherProject>=0.2a1.dev-r143,==dev"]
...@@ -2406,7 +2412,9 @@ command:: ...@@ -2406,7 +2412,9 @@ command::
python setup.py upload_docs --upload-dir=docs/build/html python setup.py upload_docs --upload-dir=docs/build/html
As with any other ``setuptools`` based command, you can define useful As with any other ``setuptools`` based command, you can define useful
defaults in the ``setup.cfg`` of your Python project, e.g.:: defaults in the ``setup.cfg`` of your Python project, e.g.:
.. code-block:: ini
[upload_docs] [upload_docs]
upload-dir = docs/build/html upload-dir = docs/build/html
...@@ -2594,7 +2602,9 @@ all the filenames within that directory (and any subdirectories thereof) that ...@@ -2594,7 +2602,9 @@ all the filenames within that directory (and any subdirectories thereof) that
are under revision control. are under revision control.
For example, if you were going to create a plugin for a revision control system For example, if you were going to create a plugin for a revision control system
called "foobar", you would write a function something like this:: called "foobar", you would write a function something like this:
.. code-block:: python
def find_files_for_foobar(dirname): def find_files_for_foobar(dirname):
# loop to yield paths that start with `dirname` # loop to yield paths that start with `dirname`
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment