Commits

Jannis Leidel  committed 4ea370f

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

  • Participants
  • Parent commits 44c95b1
  • Branches 0.6-maintenance

Comments (0)

Files changed (3)

File docs/easy_install.txt

 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
 
 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/
 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
 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]
 
 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
 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
 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

File docs/python3.txt

 
 A typical setup.py can look something like this::
 
-      from setuptools import setup
-      
-      setup(name='your.module',
-            version = '1.0',
-            description='This is your awesome module',
-            author='You',
-            author_email='your@email',
-            package_dir = {'': 'src'},
-            packages = ['your', 'you.module'],
-            test_suite = 'your.module.tests',
-            use_2to3 = True,
-            convert_2to3_doctests = ['src/your/module/README.txt'],
-            use_2to3_fixers = ['your.fixers']
-            )
+    from setuptools import setup
+    
+    setup(
+        name='your.module',
+        version = '1.0',
+        description='This is your awesome module',
+        author='You',
+        author_email='your@email',
+        package_dir = {'': 'src'},
+        packages = ['your', 'you.module'],
+        test_suite = 'your.module.tests',
+        use_2to3 = True,
+        convert_2to3_doctests = ['src/your/module/README.txt'],
+        use_2to3_fixers = ['your.fixers']
+    )
 
 Differential conversion
 -----------------------
 error this is easy. Simply conditionally add the new parameters into an extra 
 dict and pass that dict into setup()::
 
-      from setuptools import setup
-      import sys
-      
-      extra = {}
-      if sys.version_info >= (3,):
-          extra['use_2to3'] = True
-          extra['convert_2to3_doctests'] = ['src/your/module/README.txt']
-          extra['use_2to3_fixers'] = ['your.fixers']
-      
-      setup(name='your.module',
-            version = '1.0',
-            description='This is your awesome module',
-            author='You',
-            author_email='your@email',
-            package_dir = {'': 'src'},
-            packages = ['your', 'you.module'],
-            test_suite = 'your.module.tests',
-            **extra
-            )
+    from setuptools import setup
+    import sys
+    
+    extra = {}
+    if sys.version_info >= (3,):
+        extra['use_2to3'] = True
+        extra['convert_2to3_doctests'] = ['src/your/module/README.txt']
+        extra['use_2to3_fixers'] = ['your.fixers']
+    
+    setup(
+        name='your.module',
+        version = '1.0',
+        description='This is your awesome module',
+        author='You',
+        author_email='your@email',
+        package_dir = {'': 'src'},
+        packages = ['your', 'you.module'],
+        test_suite = 'your.module.tests',
+        **extra
+    )
 
 This way the parameters will only be used under Python 3, where you have to
 use Distribute.

File docs/setuptools.txt

             '': ['*.txt', '*.rst'],
             # And include any *.msg files found in the 'hello' package, too:
             'hello': ['*.msg'],
-        }
+        },
 
         # metadata for upload to PyPI
         author = "Me",
 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()
 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
 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"]
 
     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
 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`