diff options
author | Jannis Leidel <jannis@leidel.info> | 2009-10-08 15:11:48 +0200 |
---|---|---|
committer | Jannis Leidel <jannis@leidel.info> | 2009-10-08 15:11:48 +0200 |
commit | dcc66e813d10098aa88eaa3be169cbc2e8b301b6 (patch) | |
tree | 3934040b50ea6adb96a0ee4fe1f123785ca6037a | |
parent | 079951a1532a2c9e3295253c65e06091758f9150 (diff) | |
download | external_python_setuptools-dcc66e813d10098aa88eaa3be169cbc2e8b301b6.tar.gz external_python_setuptools-dcc66e813d10098aa88eaa3be169cbc2e8b301b6.tar.bz2 external_python_setuptools-dcc66e813d10098aa88eaa3be169cbc2e8b301b6.zip |
Added a bunch of code-block directives for better highlighting with Pygments, fixed typo
--HG--
branch : distribute
extra : rebase_source : e000e29a4c561a0397b134d2e451080b34f84b5d
-rw-r--r-- | docs/easy_install.txt | 28 | ||||
-rw-r--r-- | docs/python3.txt | 68 | ||||
-rw-r--r-- | docs/setuptools.txt | 22 |
3 files changed, 72 insertions, 46 deletions
diff --git a/docs/easy_install.txt b/docs/easy_install.txt index ff0ad3d8..b821e5ca 100644 --- a/docs/easy_install.txt +++ b/docs/easy_install.txt @@ -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 diff --git a/docs/python3.txt b/docs/python3.txt index 9b5fa797..d5c3da67 100644 --- a/docs/python3.txt +++ b/docs/python3.txt @@ -36,20 +36,21 @@ to a list of names of packages containing fixers. 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 ----------------------- @@ -96,25 +97,26 @@ install process will continue as normal, but if you want to get rid of that 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. diff --git a/docs/setuptools.txt b/docs/setuptools.txt index 7c679fd0..d5bd98b5 100644 --- a/docs/setuptools.txt +++ b/docs/setuptools.txt @@ -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` |