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
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
default by editing the appropriate `configuration files`_ and adding::
default by editing the appropriate `configuration files`_ and adding:
.. code-block:: ini
[easy_install]
allow_hosts = *.myintranet.example.com,*.python.org
......@@ -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
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]
find_links = http://mypackages.example.com/somedir/
......@@ -445,7 +449,9 @@ Controlling Build Options
EasyInstall respects standard distutils `Configuration Files`_, so you can use
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
default compiler by putting something like this::
default compiler by putting something like this:
.. code-block:: ini
[build]
compiler = mingw32
......@@ -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,
then a ``~/.pydistutils.cfg`` or ``$HOME\\pydistutils.cfg`` (on Unix-like OSes
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]
......@@ -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
``/usr/lib/python2.X/distutils`` on most Posix systems and something like
``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_lib = ~/lib/python2.3
......@@ -1031,7 +1041,9 @@ location, because it is already configured to process ``.pth`` files, and
EasyInstall already knows this.
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_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``,
and scripts in ``~/bin``, here's what you need to do:
First, edit ``~/.pydistutils.cfg`` to include these settings, if you don't
already have them::
already have them:
.. code-block:: ini
[install]
install_lib = ~/py-lib
......
......@@ -38,7 +38,8 @@ A typical setup.py can look something like this::
from setuptools import setup
setup(name='your.module',
setup(
name='your.module',
version = '1.0',
description='This is your awesome module',
author='You',
......@@ -105,7 +106,8 @@ dict and pass that dict into setup()::
extra['convert_2to3_doctests'] = ['src/your/module/README.txt']
extra['use_2to3_fixers'] = ['your.fixers']
setup(name='your.module',
setup(
name='your.module',
version = '1.0',
description='This is your awesome module',
author='You',
......
......@@ -141,7 +141,7 @@ dependencies, and perhaps some data files and scripts::
'': ['*.txt', '*.rst'],
# And include any *.msg files found in the 'hello' package, too:
'hello': ['*.msg'],
}
},
# metadata for upload to PyPI
author = "Me",
......@@ -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``
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
anything from setuptools::
anything from setuptools:
.. code-block:: python
import distribute_setup
distribute_setup.use_setuptools()
......@@ -1573,7 +1575,9 @@ Managing "Continuous Releases" Using Subversion
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
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]
tag_build = .dev
......@@ -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
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
``==dev``, e.g.::
``==dev``, e.g.:
.. code-block:: python
install_requires = ["OtherProject>=0.2a1.dev-r143,==dev"]
......@@ -2406,7 +2412,9 @@ command::
python setup.py upload_docs --upload-dir=docs/build/html
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-dir = docs/build/html
......@@ -2594,7 +2602,9 @@ all the filenames within that directory (and any subdirectories thereof) that
are under revision control.
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):
# 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