Обсуждение: Psycopg 2.5 released

Поиск
Список
Период
Сортировка

Psycopg 2.5 released

От
Daniele Varrazzo
Дата:
We are happy to announce the release 2.5 of Psycopg. For a detailed list
of the release highlights please check the article at
<http://initd.org/psycopg/articles/2013/04/07/psycopg-25-released/>.

- Download: http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-2.5.tar.gz
- Signature: http://initd.org/psycopg/tarballs/PSYCOPG-2-5/psycopg2-2.5.tar.gz.asc

New features:

- Added JSON adaptation.
- Added support for PostgreSQL 9.2 range types .
- 'connection' and 'cursor' objects can be used in "with" statements
  as context managers as specified by a recent DBAPI  extension.
- Added 'Diagnostics' object to get extended info from a database error.
  Many thanks to Matthew Woodcraft for the implementation (ticket #149).
- Added 'connection.cursor_factory' attribute to customize the default
  object returned by 'cursor()'.
- Added support for backward scrollable cursors. Thanks to Jon Nelson
  for the initial patch (ticket #108).
- Added a simple way to customize casting of composite types into
  Python objects other than namedtuples.  Many thanks to Ronan Dunklau
  and Tobias Oberstein for the feature development.
- 'connection.reset()' implemented using 'DISCARD ALL' on server
  versions supporting it.

Bug fixes:

- Properly cleanup memory of broken connections (ticket #148).
- Fixed bad interaction of 'setup.py' with other dependencies in
  Distribute projects on Python 3 (ticket #153).

Other changes:

- Added support for Python 3.3.
- Dropped support for Python 2.4. Please use Psycopg 2.4.x if you
  need it.
- 'errorcodes' map updated to PostgreSQL 9.2.
- Dropped Zope adapter from source repository. ZPsycopgDA now has its
  own project at <http://github.com/psycopg/ZPsycopgDA>.


----

Psycopg is the most popular PostgreSQL adapter for the Python
programming language. At its core it fully implements the Python DB
API 2.0 specifications. Several extensions allow access to many of the
features offered by PostgreSQL.


Re: Psycopg 2.5 released

От
Daniele Varrazzo
Дата:
On Sun, Apr 7, 2013 at 8:19 PM, Gavin M. Roy <gmr@meetme.com> wrote:
> Awesome! I appreciate all of the work that has gone into psycopg and your
> ongoing work on it.  Any chance you'll add what's needed for native PyPy
> support any time soon?

Hi Gavin,

I'm a total supporter of psycopg for PyPy, but not being a PyPy
developer I can go up to a certain limit. I've helped developing
psycopg2-ctypes 2.4.4
(https://github.com/mvantellingen/psycopg2-ctypes), which passed the
entire psycopg 2.4.4 test suite so had our "stamp of approval". More
precisely, I've never run it on PyPy: Michael did; I run it with
regular cpython (psycopg2-ctypes is not specific for PyPy: it just
happens to be pure python so it can run either on cpython, on PyPy and
whatever flavour has a ctypes implementation)

Then some PyPy-related bugs started coming in, then there was a -cffi
implementation which is supposed to be better than -ctypes but again
I'm not a good judge for it. I was hoping that somebody caring for
PyPy fixed them but nothing happened. I've avoid adding further
features to the -ctypes project under the principle of not adding
features where there are bugs.

If I see activity again on either -ctypes and -cffi and there is some
maintainer fixing PyPy issues I'd be happy to give my part to the
project, which could be implementing the missing part in pure python,
maintaining the test suite etc. I'd be also happy to have the project
under <https://github.com/psycopg/>. But I have to see it maintained,
and now either is not the case or the people hacking on it didn't get
in touch with us.

My only requirement is that anything people want to release with the
name psycopg-myflavour 2.x.y passes the entire psycopg 2.x.y test
suite (eventually with patches that I'd be happy to include in the -c
test suite, such as skipping implementation-specific tests etc). If
somebody wants to maintain such a project he will have all my support,
help etc. But I'm not going to improvise myself as a PyPy developer.

Hope everything is clear. If you have resources to contribute in
making sure a PyPy-compatible port has the same quality we try to keep
for the C implementation I'd be happy to help with it and bless it as
I can. This mailing list is the best place to organize the work:
please feel free to forward the message to PyPy people willing to hack
with us.

Cheers,

-- Daniele


Re: Psycopg 2.5 released

От
"Gavin M. Roy"
Дата:
Awesome! I appreciate all of the work that has gone into psycopg and your ongoing work on it.  Any chance you'll add what's needed for native PyPy support any time soon?

Cheers,

Gavin

On Sunday, April 7, 2013 at 3:16 PM, Daniele Varrazzo wrote:

We are happy to announce the release 2.5 of Psycopg. For a detailed list
of the release highlights please check the article at


New features:

- Added JSON adaptation.
- Added support for PostgreSQL 9.2 range types .
- 'connection' and 'cursor' objects can be used in "with" statements
as context managers as specified by a recent DBAPI extension.
- Added 'Diagnostics' object to get extended info from a database error.
Many thanks to Matthew Woodcraft for the implementation (ticket #149).
- Added 'connection.cursor_factory' attribute to customize the default
object returned by 'cursor()'.
- Added support for backward scrollable cursors. Thanks to Jon Nelson
for the initial patch (ticket #108).
- Added a simple way to customize casting of composite types into
Python objects other than namedtuples. Many thanks to Ronan Dunklau
and Tobias Oberstein for the feature development.
- 'connection.reset()' implemented using 'DISCARD ALL' on server
versions supporting it.

Bug fixes:

- Properly cleanup memory of broken connections (ticket #148).
- Fixed bad interaction of 'setup.py' with other dependencies in
Distribute projects on Python 3 (ticket #153).

Other changes:

- Added support for Python 3.3.
- Dropped support for Python 2.4. Please use Psycopg 2.4.x if you
need it.
- 'errorcodes' map updated to PostgreSQL 9.2.
- Dropped Zope adapter from source repository. ZPsycopgDA now has its


----

Psycopg is the most popular PostgreSQL adapter for the Python
programming language. At its core it fully implements the Python DB
API 2.0 specifications. Several extensions allow access to many of the
features offered by PostgreSQL.


--
Sent via psycopg mailing list (psycopg@postgresql.org)
To make changes to your subscription:

Re: Psycopg 2.5 released

От
Julian
Дата:
Thanks for the great work!
On 08/04/13 05:16, Daniele Varrazzo wrote:
> We are happy to announce the release 2.5 of Psycopg. For a detailed list
> of the release highlights please check the article at
> <http://initd.org/psycopg/articles/2013/04/07/psycopg-25-released/>.


Re: Psycopg 2.5 released

От
Julian
Дата:
On 08/04/13 09:47, Julian wrote:
> Thanks for the great work!
> On 08/04/13 05:16, Daniele Varrazzo wrote:
>> We are happy to announce the release 2.5 of Psycopg. For a detailed list
>> of the release highlights please check the article at
>> <http://initd.org/psycopg/articles/2013/04/07/psycopg-25-released/>.
>
>
Hi,
Just an observation on your sites release notes:

"when the connection block exits normally the current transaction is
committed, if it exits with an exception instead the transaction is
rolled back, *in either case the connection is closed*."

Its not what I prefer, I went and checked anyway and it appears it
doesn't (close the connection for either commit or rollback).
Unless I've missed something.

Perhaps a last_state attribute with 'commit' or 'rollback'? (I have no
faith).

Anyhow, something to play *with*. :)

Thanks.

Jules.


Re: Psycopg 2.5 released

От
Daniele Varrazzo
Дата:
On Mon, Apr 8, 2013 at 1:57 AM, Julian <tempura@internode.on.net> wrote:

> Hi,
> Just an observation on your sites release notes:
>
> "when the connection block exits normally the current transaction is
> committed, if it exits with an exception instead the transaction is
> rolled back, *in either case the connection is closed*."
>
> Its not what I prefer, I went and checked anyway and it appears it
> doesn't (close the connection for either commit or rollback).

I think you are right: the connection is *NOT* closed after the with
block. Will fix the article, thank you very much.

-- Daniele


Re: Psycopg 2.5 released

От
Michael van Tellingen
Дата:
Hi all,

On Sun, Apr 7, 2013 at 10:07 PM, Daniele Varrazzo <daniele.varrazzo@gmail.com> wrote:
On Sun, Apr 7, 2013 at 8:19 PM, Gavin M. Roy <gmr@meetme.com> wrote:
> Awesome! I appreciate all of the work that has gone into psycopg and your
> ongoing work on it.  Any chance you'll add what's needed for native PyPy
> support any time soon?

Hi Gavin,

I'm a total supporter of psycopg for PyPy, but not being a PyPy
developer I can go up to a certain limit. I've helped developing
psycopg2-ctypes 2.4.4
(https://github.com/mvantellingen/psycopg2-ctypes), which passed the
entire psycopg 2.4.4 test suite so had our "stamp of approval". More
precisely, I've never run it on PyPy: Michael did; I run it with
regular cpython (psycopg2-ctypes is not specific for PyPy: it just
happens to be pure python so it can run either on cpython, on PyPy and
whatever flavour has a ctypes implementation)

Then some PyPy-related bugs started coming in, then there was a -cffi
implementation which is supposed to be better than -ctypes but again
I'm not a good judge for it. I was hoping that somebody caring for
PyPy fixed them but nothing happened. I've avoid adding further
features to the -ctypes project under the principle of not adding
features where there are bugs.

If I see activity again on either -ctypes and -cffi and there is some
maintainer fixing PyPy issues I'd be happy to give my part to the
project, which could be implementing the missing part in pure python,
maintaining the test suite etc. I'd be also happy to have the project
under <https://github.com/psycopg/>. But I have to see it maintained,
and now either is not the case or the people hacking on it didn't get
in touch with us.

My goal when porting psycopg2 was both as an exercise as well as seeing how fast it could be with pypy. 
In the end the performance was okayish, for some workloads it was quite fast but I never actually used it in production. The cffi port is in that aspect much more promising from what I've read. Never tried it myself though. 

Regarding further updates to psycopg2-ctypes I'm afraid I just can't find the time for it. So if anyone is interested in taking over the development the please let me know!

Regards,
Michael

Re: Psycopg 2.5 released

От
Daniele Varrazzo
Дата:
On Tue, Apr 9, 2013 at 7:59 AM, Michael van Tellingen
<michaelvantellingen@gmail.com> wrote:

> My goal when porting psycopg2 was both as an exercise as well as seeing how
> fast it could be with pypy.
> In the end the performance was okayish, for some workloads it was quite fast
> but I never actually used it in production. The cffi port is in that aspect
> much more promising from what I've read. Never tried it myself though.
>
> Regarding further updates to psycopg2-ctypes I'm afraid I just can't find
> the time for it. So if anyone is interested in taking over the development
> the please let me know!

Michael,

your past work not only has been greatly appreciated, but it's still
the base of the current ports. We are everybody fork of your repos :)

The summary of the story is: Konstantin Lopuhin has ported Michael's
psycopg2ct to cffi (https://github.com/chtd/psycopg2cffi). I've
learned from him that they are using it in production on PyPy and he's
actively maintaining it. I've also learned from Antonio Cuni that cffi
is *way* more appreciated than ctypes in PyPy world (for type safety
and jittability) so I'm convinced cffi is the way to go.

I've forked Kostia's repos
(https://github.com/dvarrazzo/psycopg2-ctypes/tree/cffi-2.5) and I'm
hacking on it to bring it at psycopg 2.5 feature level. There are only
4 tests not passing in the test suite now :)

My plan is to finish the porting, have some serious test with valgrind
and the databases grid on buildbot, after which I think we can bless
the -cffi implementation. I'm not planning to work on the -ctypes
branch anymore... but I'm not sure I want to drop entirely the idea of
a psycopg on ctypes. A pure python module only depending on the stdlib
is actually *very* appealing, but as it is now I'd derive it back from
the -cffi codebase, maybe with a compatibility layer. OTOH if cffi is
easy to install on Windows and OS X too there would be no reason for
it.

In the meantime a big thank for all your work to date.

Cheers,

-- Daniele