"Phillip J. Eby" <[EMAIL PROTECTED]> writes:

>>I'd like to have a mechanism that has me specify two things in *one* central
>>location:
>>
>>1. A self-chosen version number, e.g. "1.1"
>
> Put this in setup.py.
>
>
>>2. A release flag (e.g. official_release=False, meaning it's an official and
>>    not a development release)
>
> Put this in setup.cfg for a development release (or leave blank for official):
>
>    [egg_info]
>    tag_svn_revision = 1
>    tag_build = dev

Will do. But wouldn't it make sense to be able to specify the version name in
this place to?


>>Now in all other locations I'd like to get a version string that either is
>>"1.1" if release is True "1.1.dev43" (or whatever the svn revision) if release
>>is False.
>>
>>All other locations means at least setup.py and a __init__.py (via import or
>>execfile if needs be).
>
> At runtime, you can use this code to get the version of your project (or any
> other project):
>
>    from pkg_resources import require
>    __version__ = require('MyProjectname')[0].version



>
> Where 'MyProjectname' is your setup(name=...) name.  (I.e., the name of your
> distribution.)

Just to make sure because I'm not 100% clear on this and I think I have have
come across conflicting information from different sources -- if my package is
named scikits.mlabwrap and scikits is a namespace package, setup.py will have
to look like so, right?

    setup(name='sckits.mlabwrap',  # rather than just 'mlabwrap'
          namespace_packages=['scikits']
          ...
    )

and then ``require(scikits.mlabwrap)[0].version`` will get me the version
number.

As a suggestion: I think that the ``namespace_packages`` example for the
ZoperInterface project at
<http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages> would
profit from adding the ``name=`` parameter, because it is not immediately
obvious whether it should include the namespace_package or not.

> [...]

Thanks for all the info! I've tried to document the most important points
about setuptools for other scikits developers, if you or someone else who's
more knowledgable about setuptools wants to give some feedback (although it's
obviously still work in progress), here's the url:

<http://projects.scipy.org/scipy/scikits/wiki/WikiStart#Scikitsuseofsetuptools>

Thanks again for your help,

cheers

'as

>>p.s. I notice that a cc: or to: to your email address bounces -- is that
>>intended?
>
> No, and AFAIK it's not happening to anybody else.

FWIW, here's the gist of the error message:

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  [EMAIL PROTECTED]
    SMTP error from remote mail server after RCPT TO:<[EMAIL PROTECTED]>:
    host mail.telecommunity.com [209.190.5.234]: 550 <[EMAIL PROTECTED]>:
    Recipient address rejected: SPF Reports: SPF fail - not authorized

------ This is a copy of the message, including all the headers. ------

Return-path: <[EMAIL PROTECTED]>
Received: from oc.ex.ac.uk ([144.173.207.34])
        by dot.ex.ac.uk with esmtp (Exim 4.62/mail)
        id 1HnLB1-0003Br-Sq; Sun, 13 May 2007 22:00:23 +0100
To: "Phillip J. Eby" <[EMAIL PROTECTED]>
Cc: [email protected],  [EMAIL PROTECTED]
Subject: Re: [Distutils] unpacking files from and egg only for testing
References: <[EMAIL PROTECTED]>
From: Alexander Schmolck <[EMAIL PROTECTED]>
Date: Sun, 13 May 2007 22:00:23 +0100
In-Reply-To: <[EMAIL PROTECTED]> (Phillip J. Eby's message of "Sun\, 13 May 
2007 12\:23\:04 -0400")
Message-ID: <[EMAIL PROTECTED]>
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

b
-- 
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to