Skip to content

Commit 1d0931a

Browse files
committed
fill in the rest of the tutorial
1 parent 94f2b6f commit 1d0931a

File tree

1 file changed

+86
-7
lines changed

1 file changed

+86
-7
lines changed

source/tutorial.rst

Lines changed: 86 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Installation & Packaging Tutorial
33
=================================
44

5-
:Page Status: Incomplete
6-
:Last Reviewed: 2014-08-07
5+
:Page Status: Complete
6+
:Last Reviewed: 2014-08-27
77

88
.. contents::
99

@@ -276,7 +276,7 @@ Additionally, most projects will contain the following files:
276276
that contains option defaults for ``setup.py`` commands.
277277
* A `MANIFEST.in
278278
<https://github.com/pypa/sampleproject/blob/master/MANIFEST.in>`_ that defines
279-
the files that will be included in the project distribution when it's
279+
additional files to be included in the project distribution when it's
280280
packaged.
281281

282282

@@ -325,15 +325,79 @@ way is to keep the version in both ``setup.py`` and your code. If you'd rather
325325
not duplicate the value, there are a few ways to manage this. See the
326326
":ref:`Single sourcing the version`" Advanced Topics section.
327327

328-
License
329-
-------
330328

331329
Packages
332330
--------
333331

332+
from `sampleproject/setup.py
333+
<https://github.com/pypa/sampleproject/blob/master/setup.py>`_
334+
335+
::
336+
337+
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
338+
339+
It's required to list the :term:`packages <Package (Meaning #1)>` to be included
340+
in your project. Although they can be listed manually,
341+
``setuptools.find_packages`` finds them automatically. Use the ``exclude``
342+
keyword argument to omit packages that are not intended to be released and
343+
installed.
344+
345+
334346
Metadata
335347
--------
336348

349+
It's important to include various metadata about your project.
350+
351+
from `sampleproject/setup.py
352+
<https://github.com/pypa/sampleproject/blob/master/setup.py>`_
353+
354+
::
355+
356+
# A description of your project
357+
description='A sample Python project',
358+
long_description=long_description,
359+
360+
# The project's main homepage
361+
url='https://github.com/pypa/sampleproject',
362+
363+
# Author details
364+
author='The Python Packaging Authority',
365+
author_email='[email protected]',
366+
367+
# Choose your license
368+
license='MIT',
369+
370+
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
371+
classifiers=[
372+
# How mature is this project? Common values are
373+
# 3 - Alpha
374+
# 4 - Beta
375+
# 5 - Production/Stable
376+
'Development Status :: 3 - Alpha',
377+
378+
# Indicate who your project is intended for
379+
'Intended Audience :: Developers',
380+
'Topic :: Software Development :: Build Tools',
381+
382+
# Pick your license as you wish (should match "license" above)
383+
'License :: OSI Approved :: MIT License',
384+
385+
# Specify the Python versions you support here. In particular, ensure
386+
# that you indicate whether you support Python 2, Python 3 or both.
387+
'Programming Language :: Python :: 2',
388+
'Programming Language :: Python :: 2.6',
389+
'Programming Language :: Python :: 2.7',
390+
'Programming Language :: Python :: 3',
391+
'Programming Language :: Python :: 3.2',
392+
'Programming Language :: Python :: 3.3',
393+
'Programming Language :: Python :: 3.4',
394+
],
395+
396+
# What does your project relate to?
397+
keywords='sample setuptools development',
398+
399+
400+
337401
Dependencies
338402
------------
339403

@@ -414,8 +478,6 @@ For more information see the distutils section on `Installing Additional Files
414478
installed relative to "site-packages". For discussion see `wheel Issue #92
415479
<https://bitbucket.org/pypa/wheel/issue/92>`_.
416480

417-
Manifest
418-
--------
419481

420482
Scripts
421483
-------
@@ -445,6 +507,23 @@ For more information, see `Automatic Script Creation
445507
from the `setuptools docs <http://pythonhosted.org/setuptools/setuptools.html>`_.
446508

447509

510+
MANIFEST.in
511+
-----------
512+
513+
A ``MANIFEST.in`` file is needed in certain cases where you need to package
514+
additional files that ``python setup.py sdist (or bdist_wheel)`` don't
515+
automatically include.
516+
517+
To see a list of what's included by default, see the `Specifying the files to
518+
distribute
519+
<https://docs.python.org/3.4/distutils/sourcedist.html#specifying-the-files-to-distribute>`_
520+
section from the :ref:`distutils` documentation.
521+
522+
For details on writing a ``MANIFEST.in`` file, see the `The MANIFEST.in template
523+
<https://docs.python.org/2/distutils/sourcedist.html#the-manifest-in-template>`_
524+
section from the :ref:`distutils` documentation.
525+
526+
448527
Developing your project
449528
=======================
450529

0 commit comments

Comments
 (0)