Issue 278 in pyftpdlib: __ver__ is not a convention

0 views
Skip to first unread message

pyft...@googlecode.com

unread,
Jan 19, 2014, 6:27:07 AM1/19/14
to pyftpdli...@googlegroups.com
Status: New
Owner: tech...@gmail.com
Labels: Type-Defect Priority-Medium Component-Library

New issue 278 by tech...@gmail.com: __ver__ is not a convention
http://code.google.com/p/pyftpdlib/issues/detail?id=278

1. >>> import pyftpdlib
2. >>> pyftpdlib.__version__
AttributeError: 'module' object has no attribute '__version__'


__ver__ is very uncommon for Python packages. It would be nice if pyftpdlib
provided common __version__ field.

I'd add alias myself, but I am not sure what is the current backward
compatibility practice. If we decide to remove __ver__ at some point, how
do we find it? Or we just keep everything?

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

pyft...@googlecode.com

unread,
Jan 19, 2014, 6:43:20 AM1/19/14
to pyftpdli...@googlegroups.com

Comment #1 on issue 278 by g.rodola: __ver__ is not a convention
http://code.google.com/p/pyftpdlib/issues/detail?id=278

Mmmm are you really sure the most used convention is __version__ and not
__ver__ (I seem to recall the contrary)?
Not that it really matters anyway because as you also point out it is too
late as the change would not be retro compatible (__ver__ has been there
for years now).

pyft...@googlecode.com

unread,
Jan 19, 2014, 6:49:10 AM1/19/14
to pyftpdli...@googlegroups.com
Updates:
Status: Rejected

Comment #2 on issue 278 by g.rodola: __ver__ is not a convention
http://code.google.com/p/pyftpdlib/issues/detail?id=278

...also I don't think adding a __version__ alias would add any value. It
would only cause more confusion.
I'm going to close this out as rejected.

pyft...@googlecode.com

unread,
Jan 19, 2014, 7:29:54 AM1/19/14
to pyftpdli...@googlegroups.com
Updates:
Status: Reopened

Comment #3 on issue 278 by tech...@gmail.com: __ver__ is not a convention
http://code.google.com/p/pyftpdlib/issues/detail?id=278

Ok. Let's check.

>>> import sphinx
>>> sphinx.__version__
'1.1.3'

>>> import pip
>>> pip.__version__
'1.4.1'


Your turn. =)

pyft...@googlecode.com

unread,
Jan 19, 2014, 7:43:56 AM1/19/14
to pyftpdli...@googlegroups.com

Comment #4 on issue 278 by g.rodola: __ver__ is not a convention
http://code.google.com/p/pyftpdlib/issues/detail?id=278

Ok, but as I said, it's too late: checking for version at runtime only
works if both old and new versions of the module you depend from provide
the same API.
I see little value in adding __version__ in 1.3.1 but not having it in <=
1.3.0.
Whoever wants to take decisions based on pyftpdlib version will likely grep
for "__ver", and eventually find it and use it, no matter what the
recommended convention is. I see your point though: I'm only talking about
practical reasons here.

pyft...@googlecode.com

unread,
Jan 19, 2014, 7:52:37 AM1/19/14
to pyftpdli...@googlegroups.com

Comment #5 on issue 278 by tech...@gmail.com: __ver__ is not a convention
http://code.google.com/p/pyftpdlib/issues/detail?id=278

There is a lot of value if your package requires pyftpdlib > 1.3.0, so I am
for adding __version__ field and provide __ver__ alias for backward
compatibility.

__version__ is not in PEP probably, but I use it for automation. Here you
can see automated setup.py generation -
https://bitbucket.org/techtonik/astdump/ and it is only a proof of concept,
which can be extended to automatic package generation not only for PyPI,
but also for Ubuntu and other distributions.

pyft...@googlecode.com

unread,
Apr 11, 2014, 5:24:54 PM4/11/14
to pyftpdli...@googlegroups.com
Updates:
Status: WontFix

Comment #6 on issue 278 by g.rodola: __ver__ is not a convention
http://code.google.com/p/pyftpdlib/issues/detail?id=278

Closing this out as won't fix.

pyft...@googlecode.com

unread,
Apr 11, 2014, 10:00:56 PM4/11/14
to pyftpdli...@googlegroups.com

Comment #7 on issue 278 by tech...@gmail.com: __ver__ is not a convention
http://code.google.com/p/pyftpdlib/issues/detail?id=278

But why? It doesn't break anything and add consistency with other packages.

pyft...@googlecode.com

unread,
Apr 12, 2014, 5:14:24 AM4/12/14
to pyftpdli...@googlegroups.com

Comment #8 on issue 278 by g.rodola: __ver__ is not a convention
http://code.google.com/p/pyftpdlib/issues/detail?id=278

I explained why in comment #4.

pyft...@googlecode.com

unread,
Apr 14, 2014, 5:25:35 PM4/14/14
to pyftpdli...@googlegroups.com

Comment #9 on issue 278 by tech...@gmail.com: __ver__ is not a convention
http://code.google.com/p/pyftpdlib/issues/detail?id=278

> it's too late: checking for version at runtime only works if both old and
> new
> versions of the module you depend from provide the same API.

Yes, my requirement.txt contains pyftpdlib > x.x.x, so it is never too late
to add new API that doesn't break anything existing.

> hoever wants to take decisions based on pyftpdlib version will likely grep
> for "__ver"

1% likely is a bad user experience design, and it is not practical at all
for tools that need to run checks on code that is compatible with common
human conventions.

pyft...@googlecode.com

unread,
Apr 14, 2014, 7:20:44 PM4/14/14
to pyftpdli...@googlegroups.com

Comment #10 on issue 278 by gc...@loowis.durge.org: __ver__ is not a
convention
http://code.google.com/p/pyftpdlib/issues/detail?id=278

I don't have an opinion either way on this (I've not needed to read the
version number directly), but a quick google throws up
http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package
which seems to confirm that there's common conventions of using
__version__, but no 'proper standard'.

6 of one, half a dozen of the other ;-)

pyft...@googlecode.com

unread,
Apr 14, 2014, 7:28:05 PM4/14/14
to pyftpdli...@googlegroups.com

Comment #11 on issue 278 by tech...@gmail.com: __ver__ is not a convention
http://code.google.com/p/pyftpdlib/issues/detail?id=278

Upvoted SO. =)
Reply all
Reply to author
Forward
0 new messages