setup.py 2.29 KB
Newer Older
Chris Wanstrath committed
1
#!/usr/bin/env python
2
# coding: utf-8
Chris Wanstrath committed
3

4
"""
5 6 7 8
This script supports installing and distributing pystache.

Below are instructions to pystache maintainers on how to push a new
version of pystache to PyPI--
9

10 11
    http://pypi.python.org/pypi/pystache

12 13 14
Create a PyPI user account.  The user account will need permissions to push
to PyPI.  A current "Package Index Owner" of pystache can grant you those
permissions.
15

16 17
When you have permissions, run the following (after preparing the release,
bumping the version number in setup.py, etc):
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

    > python setup.py publish

If you get an error like the following--

    Upload failed (401): You must be identified to edit package information

then add a file called .pyirc to your home directory with the following
contents:

    [server-login]
    username: <PyPI username>
    password: <PyPI password>

as described here, for example:

    http://docs.python.org/release/2.5.2/dist/pypirc.html
35 36

"""
Chris Wanstrath committed
37

38 39 40
import os
import sys

41

42 43 44 45
try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup
Chris Wanstrath committed
46

Kenneth Reitz committed
47

48
def publish():
49 50
    """
    Publish this package to PyPI (aka "the Cheeseshop").
Kenneth Reitz committed
51

52
    """
Kenneth Reitz committed
53
    os.system('python setup.py sdist upload')
54 55


56 57 58 59 60 61 62 63 64 65
def make_long_description():
    """
    Return the long description for the package.

    """
    long_description = open('README.rst').read() + '\n\n' + open('HISTORY.rst').read()

    return long_description


66
if sys.argv[-1] == 'publish':
67 68 69
    publish()
    sys.exit()

70 71
long_description = make_long_description()

Chris Wanstrath committed
72
setup(name='pystache',
73
      version='0.5.0-rc',
Chris Wanstrath committed
74
      description='Mustache for Python',
75
      long_description=long_description,
Chris Wanstrath committed
76 77
      author='Chris Wanstrath',
      author_email='chris@ozmm.org',
78
      maintainer='Chris Jerdonek',
Chris Wanstrath committed
79 80
      url='http://github.com/defunkt/pystache',
      packages=['pystache'],
Damien Lebrun committed
81
      license='MIT',
82
      test_suite='pystache.tests',
vrde committed
83
      entry_points = {
84 85
        'console_scripts': ['pystache=pystache.commands:main'],
      },
86
      classifiers = (
Kenneth Reitz committed
87 88 89
        'Development Status :: 4 - Beta',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python',
90
        'Programming Language :: Python :: 2.4',
Kenneth Reitz committed
91
        'Programming Language :: Python :: 2.5',
92
        'Programming Language :: Python :: 2.6',
93
        'Programming Language :: Python :: 2.7',
94
      )
Kenneth Reitz committed
95
)