[Python-es] Cómo especificar versiones RC (en setup.py ?)

Olemis Lang (Simelix) olemis+py en gmail.com
Mie Abr 14 18:15:03 CEST 2010


2010/4/14 Rolando Espinoza La Fuente <darkrho en gmail.com>:
> ¿puedes mostrar el source de tu setup.py?
>

{{{
#!sh

$ cat setup.py
#!/usr/bin/env python

# Copyright 2009-2011 Olemis Lang <olemis at gmail.com>
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

from tracgviz.__init__ import __doc__ as DESC

versions = [
    (1, 0, 0),
    (1, 1, 0),
    (1, 2, 0),
    (1, 2, 1),
    (1, 2, 2),
    (1, 2, 3),
    (1, 3, 1),
    (1, 3, 2),
    (1, 3, 3),
    (1, 3, 4),
    (1, 4, 1),
    ]

latest = '.'.join(str(x) for x in versions[-1])
latest = '1.4.1rc1'

status = {
            'planning' :  "Development Status :: 1 - Planning",
            'pre-alpha' : "Development Status :: 2 - Pre-Alpha",
            'alpha' :     "Development Status :: 3 - Alpha",
            'beta' :      "Development Status :: 4 - Beta",
            'stable' :    "Development Status :: 5 - Production/Stable",
            'mature' :    "Development Status :: 6 - Mature",
            'inactive' :  "Development Status :: 7 - Inactive"
         }
dev_status = status["alpha"]

cats = [
    dev_status,
    "Environment :: Plugins",
    "Environment :: Web Environment",
    "Framework :: Trac",
    "Intended Audience :: Developers",
    "Intended Audience :: Information Technology",
    "Intended Audience :: Other Audience",
    "Intended Audience :: System Administrators",
    "License :: OSI Approved :: Apache Software License",
    "Natural Language :: English",
    "Natural Language :: Spanish",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 2.5",
    "Programming Language :: Python",
    "Topic :: Database",
    "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries",
    "Topic :: Internet :: WWW/HTTP :: HTTP Servers",
    "Topic :: Internet :: WWW/HTTP :: WSGI",
    "Topic :: Software Development :: Bug Tracking",
    "Topic :: Software Development :: Libraries :: Application Frameworks",
    "Topic :: Software Development :: Libraries :: Python Modules",
    "Topic :: Software Development :: User Interfaces",
    "Topic :: Software Development :: Widget Sets"
    ]

# Be compatible with older versions of Python
from sys import version
if version < '2.2.3':
    from distutils.dist import DistributionMetadata
    DistributionMetadata.classifiers = None
    DistributionMetadata.download_url = None

# Add the change log to the package description.
chglog = None
try:
    from os.path import dirname, join
    chglog = open(join(dirname(__file__), "CHANGES"))
    DESC+= ('\n\n' + chglog.read())
finally:
    if chglog:
        chglog.close()

DIST_NM = 'TracGViz'
PKG_INFO = {'tracgviz' : ('tracgviz',                     # Package dir
                            # Package data
                            ['templates/*', 'htdocs/*',
                      		    'messages/es/LC_MESSAGES/*', '../CHANGES',
                              '../COPYRIGHT', '../NOTICE', '../README',
                              '../TODO', '../examples/*'],
                          ),
            'tracgviz.testing' : ('tracgviz/testing',     # Package dir
                            # Package data
                            ['data/**'],
                          ),
            'tracgviz.ig' : ('tracgviz/ig',                     # Package dir
                            # Package data
                            ['templates/*', 'htdocs/*'],
                          ),
            }

ENTRY_POINTS = r"""
               [trac.plugins]
               tracgviz = tracgviz
               """

setup(
	name=DIST_NM,
	version=latest,
	description=DESC.split('\n', 1)[0],
	author='Olemis Lang',
	author_email='olemis en gmail.com',
	maintainer='Olemis Lang',
	maintainer_email='olemis en gmail.com',
	url='https://opensvn.csie.org/traccgi/swlcu/wiki/En/Devel/%s' % (DIST_NM,),
	download_url='http://pypi.python.org/packages/2.5/%s/%s/%s-%s-py2.5.egg' % \
	                              (DIST_NM[0], DIST_NM, DIST_NM, latest,),
	requires = ['trac', 'tracrpc', 'gviz_api', 'pygments', 'dutest'],
  install_requires = [
      'setuptools>=0.6b1',
      'Trac>=0.11',
      'TracXMLRPC<1.0.7',
      'Pygments>=1.0',
      'dutest>=0.2.3',
  ],
	package_dir = dict([p, i[0]] for p, i in PKG_INFO.iteritems()),
	packages = PKG_INFO.keys(),
	package_data = dict([p, i[1]] for p, i in PKG_INFO.iteritems()),
	include_package_data=True,
	provides = ['%s (%s)' % (p, latest) for p in PKG_INFO.keys()],
	obsoletes = ['%s (>=%s.0.0, <%s)' % (p, versions[-1][0], latest) \
	              for p in PKG_INFO.keys()],
	entry_points = ENTRY_POINTS,
	classifiers = cats,
	long_description= DESC
	)

}}}

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
La cara oculta de Fibonacci (en Python) -
http://feedproxy.google.com/~r/simelo-es/~3/SK_fIpxhZHg/la-cara-oculta-de-fibonacci-en-python.html



Más información sobre la lista de distribución Python-es