Merge pull request #1588 from Akasurde/i_1465
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Updated documentation for Setuptools
authored by Kenneth Reitz · committed by Kenneth Reitz · parents b4240e6, 2fe8e81 · Browse files · 1 file·+13 added−18 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+13 added−18 removed
- other:+13 added−18 removed
Provenance
- Commit
e7367c9- Tree
e4bb75a- Author
Kenneth Reitz <me@kennethreitz.org>- Committer
Kenneth Reitz <me@kennethreitz.org>- Parent 1
b4240e6- Parent 2
2fe8e81
1 file changed+13 added−18 removed
modified:docs/patterns/distribute.rst+13 added-18 removed
1 .. _distribute-deployment:2 3-Deploying with Distribute3+Deploying with Setuptools4 =========================5 6-`distribute`_, formerly setuptools, is an extension library that is7-commonly used to (like the name says) distribute Python libraries and8-extensions. It extends distutils, a basic module installation system6+`Setuptools`_, is an extension library that is commonly used to7+(like the name says) distribute Python libraries and8+extensions. It extends distutils, a basic module installation system9 shipped with Python to also support various more complex constructs that10 make larger applications easier to distribute:11 12 - **support for dependencies**: a library or application can declare a14 unmodified lines27 are distributed with either distribute, the older setuptools or distutils.28 29 In this case we assume your application is called30 :file:`yourapplication.py` and you are not using a module, but a :ref:`package31-<larger-applications>`. Distributing resources with standard modules is32-not supported by `distribute`_ so we will not bother with it. If you have33-not yet converted your application into a package, head over to the34-:ref:`larger-applications` pattern to see how this can be done.31+<larger-applications>`. If you have not yet converted your application into32+a package, head over to the :ref:`larger-applications` pattern to see33+how this can be done.34 35 A working deployment with distribute is the first step into more complex36 and more automated deployment scenarios. If you want to fully automate37 the process, also read the :ref:`fabric-deployment` chapter.38 39 Basic Setup Script40 ------------------41 43-Because you have Flask running, you either have setuptools or distribute44-available on your system anyways. If you do not, fear not, there is a45-script to install it for you: `distribute_setup.py`_. Just download and42+Because you have Flask running, you have setuptools available on your system anyways.43+Flask already depends upon setuptools. If you do not, fear not, there is a44+script to install it for you: `ez_setup.py`_. Just download and45 run with your Python interpreter.46 47 Standard disclaimer applies: :ref:`you better use a virtualenv48 <virtualenv>`.1 unmodified line50 Your setup code always goes into a file named :file:`setup.py` next to your51 application. The name of the file is only convention, but because52 everybody will look for a file with that name, you better not change it.53 55-Yes, even if you are using `distribute`, you are importing from a package56-called `setuptools`. `distribute` is fully backwards compatible with57-`setuptools`, so it also uses the same import name.58-54 A basic :file:`setup.py` file for a Flask application looks like this::55 56 from setuptools import setup57 63 unmodified lines121 'SQLAlchemy>=0.6',122 'BrokenPackage>=0.7,<=1.0'123 ]124 130-I mentioned earlier that dependencies are pulled from PyPI. What if you125+As mentioned earlier, dependencies are pulled from PyPI. What if you126 want to depend on a package that cannot be found on PyPI and won't be127 because it is an internal package you don't want to share with anyone?128 Just still do as if there was a PyPI entry for it and provide a list of129 alternative locations where distribute should look for tarballs::25 unmodified lines155 folder instead of copying the data over. You can then continue to work on156 the code without having to run `install` again after each change.157 158 164-.. _distribute: https://pypi.python.org/pypi/distribute159 .. _pip: https://pypi.python.org/pypi/pip166-.. _distribute_setup.py: http://python-distribute.org/distribute_setup.py160+.. _ez_setup.py: https://bootstrap.pypa.io/ez_setup.py161+.. _Setuptools: https://pythonhosted.org/setuptools