[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Merging the ctypes python bindings to trunk

From: David James <james82_at_gmail.com>
Date: Sun, 21 Sep 2008 15:05:18 -0700

Dear Subversion Developers,

At long last, the ctypes python bindings are ready to merge to trunk.

The new ctypes Python bindings offer the following advantages over the
old SWIG Python bindings:
  1. First and foremost, the ctypes bindings are complete and are
generated entirely automatically. They offer complete access to all
functionality provided by the Subversion library, so there is nothing
that you won't be able to do. New features should be available in the
ctypes bindings immediately.
  2. The ctypes bindings are straightforward, and don't have any
special "transformation" rules. All of the documentation for the
Subversion C library applies equally to the ctypes bindings.
  3. The ctypes bindings are pure python and cross-platform. You can
generate the function definitions on one platform and copy them to
another platform without incident. In other words, your users don't
need a compiler to install the binding.
  4. The ctypes bindings are both forward and backward compatible with
different versions of Subversion and different libraries, as long as
the functions you use in your programs have compatible definitions.
  5. Besides the low-level bindings, the ctypes bindings have high
level classes which make it easy to access common Subversion
functionality in a Pythonic way. These classes do not offer complete
access to all Subversion features, but they are often more convenient
and easier to use than the raw ctypes library.

NOTE: The bindings have been tested on Mac OS X, Linux, and Windows.
To test on Windows, I build the csvn Python bindings on Linux and then
copy the generated Python files to Windows.

I'd like to merge the ctypes python bindings to trunk using the
following command:
$ svn cp http://svn.collab.net/repos/svn/branches/ctypes-python-bindings
http://svn.collab.net/repos/svn/trunk/subversion/bindings/ctypes-python-bindings

At first, the only way to install the ctypes python bindings will be
to follow the instructions listed in the README. After we merge to
trunk, I'd like to address the tasks listed in
http://svn.collab.net/repos/svn/branches/ctypes-python-bindings/TODO,
so that folks can install the bindings using standard make targets.
Jeremy Whitlock has volunteered to help with this process (Thanks
Jeremy!).

To help answer common questions, I've included a little FAQ document
about the ctypes python bindings below.

----------------------------------------------------------------------

Q. Will the Python SWIG bindings be deprecated?

A. This is up for discussion. I do think we should encourage folks to
move to the new ctypes bindings, especially for new systems. However,
we should also understand that many people may not want to port their
old code.

In any case, I expect that there will still be some demand for bug
fixes and features in the old bindings. In my opinion, folks who are
interested in still working on the old bindings are welcome to
continue their work. However, we should also try to update our
documentation to encourage folks to move to the new ctypes bindings.

----------------------------------------------------------------------

Q. Can I upgrade to the latest ctypes python bindings without
upgrading Subversion?

A. Yes. The current ctypes python bindings work with Subversion 1.4 or
later. The new bindings can be installed separately from Subversion
and will work with the version of Subversion you have installed.

----------------------------------------------------------------------

Q. Is it really safe to use function definitions generated on
different platforms on my machine?

A. As long as you are careful to avoid using any incompatible
functions, it is safe to use the same function definitions with
different platforms, different versions of Subversion and even with
different dependencies.

If you try to access a function which is not available on your
platform, Python will throw an exception and explain that the function
is not available. On the other hand, if the function is available but
the function definition differs across platforms in an incompatible
way, your program may crash or behave incorrectly.

----------------------------------------------------------------------

Q. APR 0.x is not binary compatible with APR 1.x. If I generate
bindings for APR 1.x, and use them with APR 0.x (or vice versa) can I
run into issues?

A. Yes. As discussed above, if you access a function which differs in
an incompatible way, you will run into issues. However, if you are
careful, and only use functions that have compatible definitions, you
can safely use the same function definitions for both versions of APR.

----------------------------------------------------------------------

Let me know if you have more questions.

Cheers,

David

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-09-22 00:05:32 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.