mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 23:00:18 +00:00
More typo, grammar, and style fixes
This commit is contained in:
+15
-15
@@ -7,7 +7,7 @@ Packaging Your Code
|
||||
|
||||
.. image:: /_static/photos/36137234682_be6898bf57_k_d.jpg
|
||||
|
||||
Package your code to share it with other developers. For example
|
||||
Package your code to share it with other developers. For example,
|
||||
to share a library for other developers to use in their application,
|
||||
or for development tools like 'py.test'.
|
||||
|
||||
@@ -18,7 +18,7 @@ large, professional systems.
|
||||
|
||||
It is a well-established convention for Python code to be shared this way.
|
||||
If your code isn't packaged on PyPI, then it will be harder
|
||||
for other developers to find it, and to use it as part of their existing
|
||||
for other developers to find it and to use it as part of their existing
|
||||
process. They will regard such projects with substantial suspicion of being
|
||||
either badly managed or abandoned.
|
||||
|
||||
@@ -57,14 +57,14 @@ Pip vs. easy_install
|
||||
--------------------
|
||||
|
||||
Use `pip <http://pypi.python.org/pypi/pip>`_. More details
|
||||
`here <http://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install>`_
|
||||
`here <http://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install>`_.
|
||||
|
||||
|
||||
Personal PyPI
|
||||
-------------
|
||||
|
||||
If you want to install packages from a source other than PyPI, (say, if
|
||||
your packages are *proprietary*), you can do it by hosting a simple http
|
||||
If you want to install packages from a source other than PyPI (say, if
|
||||
your packages are *proprietary*), you can do it by hosting a simple HTTP
|
||||
server, running from the directory which holds those packages which need to be
|
||||
installed.
|
||||
|
||||
@@ -85,9 +85,9 @@ Go to your command prompt and type:
|
||||
$ cd archive
|
||||
$ python -m SimpleHTTPServer 9000
|
||||
|
||||
This runs a simple http server running on port 9000 and will list all packages
|
||||
This runs a simple HTTP server running on port 9000 and will list all packages
|
||||
(like **MyPackage**). Now you can install **MyPackage** using any Python
|
||||
package installer. Using Pip, you would do it like:
|
||||
package installer. Using pip, you would do it like:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
@@ -95,7 +95,7 @@ package installer. Using Pip, you would do it like:
|
||||
|
||||
Having a folder with the same name as the package name is **crucial** here.
|
||||
I got fooled by that, one time. But if you feel that creating a folder called
|
||||
:file:`MyPackage` and keeping :file:`MyPackage.tar.gz` inside that, is
|
||||
:file:`MyPackage` and keeping :file:`MyPackage.tar.gz` inside that is
|
||||
*redundant*, you can still install MyPackage using:
|
||||
|
||||
.. code-block:: console
|
||||
@@ -105,7 +105,7 @@ I got fooled by that, one time. But if you feel that creating a folder called
|
||||
pypiserver
|
||||
++++++++++
|
||||
|
||||
`Pypiserver <https://pypi.python.org/pypi/pypiserver>`_ is a minimal PyPI
|
||||
`pypiserver <https://pypi.python.org/pypi/pypiserver>`_ is a minimal PyPI
|
||||
compatible server. It can be used to serve a set of packages to easy_install
|
||||
or pip. It includes helpful features like an administrative command
|
||||
(``-U``) which will update all its packages to their latest versions
|
||||
@@ -115,7 +115,7 @@ found on PyPI.
|
||||
S3-Hosted PyPi
|
||||
++++++++++++++
|
||||
|
||||
One simple option for a personal PyPi server is to use Amazon S3. A
|
||||
One simple option for a personal PyPI server is to use Amazon S3. A
|
||||
prerequisite for this is that you have an Amazon AWS account with an S3 bucket.
|
||||
|
||||
1. **Install all your requirements from PyPi or another source**
|
||||
@@ -130,8 +130,8 @@ prerequisite for this is that you have an Amazon AWS account with an S3 bucket.
|
||||
|
||||
4. **Upload the new files**
|
||||
|
||||
* Use a client like Cyberduck to sync the entire :file:`packages` folder to your s3 bucket
|
||||
* Make sure you upload :code:`packages/simple/index.html` as well as all new files and directories
|
||||
* Use a client like Cyberduck to sync the entire :file:`packages` folder to your s3 bucket.
|
||||
* Make sure you upload :code:`packages/simple/index.html` as well as all new files and directories.
|
||||
|
||||
5. **Fix new file permissions**
|
||||
|
||||
@@ -141,7 +141,7 @@ prerequisite for this is that you have an Amazon AWS account with an S3 bucket.
|
||||
|
||||
6. **All done**
|
||||
|
||||
* You can now install your package with :code:`pip install --index-url=http://your-s3-bucket/packages/simple/ YourPackage`
|
||||
* You can now install your package with :code:`pip install --index-url=http://your-s3-bucket/packages/simple/ YourPackage`.
|
||||
|
||||
.. _packaging-for-linux-distributions-ref:
|
||||
|
||||
@@ -154,7 +154,7 @@ Creating a Linux distro package is arguably the "right way" to distribute code
|
||||
on Linux.
|
||||
|
||||
Because a distribution package doesn't include the Python interpreter, it
|
||||
makes the download and install about 2MB smaller than
|
||||
makes the download and install about 2-12 MB smaller than
|
||||
:ref:`freezing your application <freezing-your-code-ref>`.
|
||||
|
||||
Also, if a distribution releases a new security update for Python, then your
|
||||
@@ -165,7 +165,7 @@ for use by distributions like Red Hat or SuSE trivially easy.
|
||||
|
||||
However, creating and maintaining the different configurations required for
|
||||
each distribution's format (e.g. .deb for Debian/Ubuntu, .rpm for Red
|
||||
Hat/Fedora, etc) is a fair amount of work. If your code is an application that
|
||||
Hat/Fedora, etc.) is a fair amount of work. If your code is an application that
|
||||
you plan to distribute on other platforms, then you'll also have to create and
|
||||
maintain the separate config required to freeze your application for Windows
|
||||
and OS X. It would be much less work to simply create and maintain a single
|
||||
|
||||
Reference in New Issue
Block a user