update docs and refer to setuptools
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Corey Goldberg · committed by Corey Goldberg · parent 317d603 · Browse files · 1 file·+17 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+17 added−18 removed
- other:+17 added−18 removed
Provenance
- Commit
1cc9ccf- Tree
a674c86- Author
Corey Goldberg <corey.goldberg@lookout.com>- Committer
Corey Goldberg <corey.goldberg@lookout.com>- Parent
317d603
1 file changed+17 added−18 removed
modified:docs/patterns/distribute.rst+17 added-18 removed
2 unmodified lines3 Deploying with Setuptools4 =========================5 6 `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:7+distribute Python libraries and extensions. It extends distutils, a basic8+module installation system shipped with Python to also support various more9+complex constructs that make larger applications easier to distribute:10 11 - **support for dependencies**: a library or application can declare a12 list of other libraries it depends on which will be installed13 automatically for you.14 - **package registry**: setuptools registers your package with your15 Python installation. This makes it possible to query information16 provided by one package from another package. The best known feature of17 this system is the entry point support which allows one package to19- declare an "entry point" another package can hook into to extend the18+ declare an "entry point" that another package can hook into to extend the19 other package.21-- **installation manager**: :command:`easy_install`, which comes with distribute22- can install other libraries for you. You can also use `pip`_ which20+- **installation manager**: :command:`easy_install`, which comes with setuptools21+ can install other libraries for you. You can also use :command:`pip`_ which22 sooner or later will replace :command:`easy_install` which does more than just23 installing packages for you.24 26-Flask itself, and all the libraries you can find on the cheeseshop27-are distributed with either distribute, the older setuptools or distutils.25+Flask itself, and all the libraries you can find on PyPI are distributed with26+either setuptools or distutils.27 28 In this case we assume your application is called29 :file:`yourapplication.py` and you are not using a module, but a :ref:`package30 <larger-applications>`. If you have not yet converted your application into31 a package, head over to the :ref:`larger-applications` pattern to see32 how this can be done.33 35-A working deployment with distribute is the first step into more complex34+A working deployment with setuptools is the first step into more complex35 and more automated deployment scenarios. If you want to fully automate36 the process, also read the :ref:`fabric-deployment` chapter.37 38 Basic Setup Script25 unmodified lines64 install_requires=['Flask']65 )66 67 Please keep in mind that you have to list subpackages explicitly. If you69-want distribute to lookup the packages for you automatically, you can use68+want setuptools to lookup the packages for you automatically, you can use69 the `find_packages` function::70 71 from setuptools import setup, find_packages72 3 unmodified lines76 )77 78 Most parameters to the `setup` function should be self explanatory,79 `include_package_data` and `zip_safe` might not be.81-`include_package_data` tells distribute to look for a :file:`MANIFEST.in` file80+`include_package_data` tells setuptools to look for a :file:`MANIFEST.in` file81 and install all the entries that match as package data. We will use this82 to distribute the static files and templates along with the Python module83 (see :ref:`distributing-resources`). The `zip_safe` flag can be used to84 force or prevent zip Archive creation. In general you probably don't want7 unmodified lines92 ----------------------93 94 If you try to install the package you just created, you will notice that95 folders like :file:`static` or :file:`templates` are not installed for you. The97-reason for this is that distribute does not know which files to add for96+reason for this is that setuptools does not know which files to add for97 you. What you should do, is to create a :file:`MANIFEST.in` file next to your98 :file:`setup.py` file. This file lists all the files that should be added to99 your tarball::100 7 unmodified lines108 109 Declaring Dependencies110 ----------------------111 113-Dependencies are declared in the `install_requires` parameter as list.112+Dependencies are declared in the `install_requires` parameter as a list.113 Each item in that list is the name of a package that should be pulled from114 PyPI on installation. By default it will always use the most recent115 version, but you can also provide minimum and maximum version116 requirements. Here some examples::6 unmodified lines123 124 As mentioned earlier, dependencies are pulled from PyPI. What if you125 want to depend on a package that cannot be found on PyPI and won't be126 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::127+Just do it as if there was a PyPI entry and provide a list of128+alternative locations where setuptools should look for tarballs::129 130 dependency_links=['http://example.com/yourfiles']131 132 Make sure that page has a directory listing and the links on the page are133 pointing to the actual tarballs with their correct filenames as this is135-how distribute will find the files. If you have an internal company136-server that contains the packages, provide the URL to that server there.134+how setuptools will find the files. If you have an internal company135+server that contains the packages, provide the URL to that server.136 137 138 Installing / Developing139 -----------------------21 unmodified lines