Mercurial > pygame
changeset 2650:d1cbb8c9d94b ctypes-soc 0.09
Egg support and version 0.09 release
| author | aholkner |
|---|---|
| date | Sun, 20 Aug 2006 08:07:05 +0000 |
| parents | 9608eaab7bc8 |
| children | 4df339767e18 |
| files | CHANGELOG build_eggs.sh doc/index.txt doc/pygame-manual.txt doc/sdl-manual.txt pygame/pkgdata.py setup.py setup_pygame.py setup_sdl.py |
| diffstat | 9 files changed, 207 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGELOG Sun Aug 20 00:50:32 2006 +0000 +++ b/CHANGELOG Sun Aug 20 08:07:05 2006 +0000 @@ -6,6 +6,11 @@ - 24-bit surface to RGBX string supported if no color key is set - user post event fix for ctypes 1.0.0 - Return value of pygame.mouse.get_cursor fixed + - Support for setuptools in pkgdata.py (allow resources from .egg or .zip) + +SDL-ctypes 0.09 +--------------- + - No changes, just a version push to keep sync with Pygame-ctypes. Pygame-ctypes 0.08 ------------------
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build_eggs.sh Sun Aug 20 08:07:05 2006 +0000 @@ -0,0 +1,9 @@ +#!/bin/bash +# $Id:$ + +pythons="python2.3 python2.4 python2.5" + +for python in $pythons; do + $python setup_sdl.py bdist_egg + $python setup_pygame.py bdist_egg +done
--- a/doc/index.txt Sun Aug 20 00:50:32 2006 +0000 +++ b/doc/index.txt Sun Aug 20 08:07:05 2006 +0000 @@ -63,44 +63,82 @@ Download -------- -The latest source release is: +Documentation +^^^^^^^^^^^^^ + +Documentation is included in the source distribution under the ``doc`` +directory. It is also browseable online: + +* `Pygame-ctypes manual <pygame-manual/index.html>`_ +* `Pygame-ctypes API reference <pygame-api/index.html>`_ +* `SDL-ctypes manual <sdl-manual/index.html>`_ +* `SDL-ctypes API reference <sdl-api/index.html>`_ + +Runtime eggs +^^^^^^^^^^^^ + +Download and install `setuptools`_, then add the following to your source +to use the eggs:: + + from pkg_resources import require + require('Pygame-ctypes>=0.09') -* `pygame-ctypes-0.08.tar.gz <pygame-ctypes-0.08.tar.gz>`_, includes the +There's no need to install these eggs, just make sure they are either in +the working directory or a directory that's in ``sys.path``. + ++------------+----------------------------------------------------------------+ +|Python 2.3 || `Pygame_ctypes-0.09-py2.3.egg <Pygame_ctypes-0.09-py2.3.egg>`_| +| || `SDL_ctypes-0.09-py2.3.egg <SDL_ctypes-0.09-py2.3.egg>`_ | ++------------+----------------------------------------------------------------+ +|Python 2.4 || `Pygame_ctypes-0.09-py2.4.egg <Pygame_ctypes-0.09-py2.4.egg>`_| +| || `SDL_ctypes-0.09-py2.4.egg <SDL_ctypes-0.09-py2.4.egg>`_ | ++------------+----------------------------------------------------------------+ +|Python 2.5 || `Pygame_ctypes-0.09-py2.5.egg <Pygame_ctypes-0.09-py2.5.egg>`_| +| || `SDL_ctypes-0.09-py2.5.egg <SDL_ctypes-0.09-py2.5.egg>`_ | ++------------+----------------------------------------------------------------+ + +Source release +^^^^^^^^^^^^^^ + +The latest source release for both Pygame-ctypes and SDL-ctypes is: + +* `pygame-ctypes-0.09.tar.gz <pygame-ctypes-0.09.tar.gz>`_, includes the latest snapshot of SDL-ctypes. -In the future SDL-ctypes may also be released separately from Pygame. -In the meantime you can extract it from the same source download; there -are no dependencies of SDL-ctypes on Pygame-ctypes. +SVN Repository +^^^^^^^^^^^^^^ You can also access the SVN repository directly:: svn co svn://pygame.org/svn/pygame/branches/ctypes-soc + Installation ------------ You should generally **not** install Pygame-ctypes, as it will replace the standard Pygame package. Because Pygame-ctypes doesn't need to compile -anything, it can run straight from its own directory. +anything, it can run straight from its own directory (or from an egg, see +above). For example, on Linux, Mac OS X or Cygwin, let's say you've downloaded and -extracted the source release to ``/home/joe/pygame-ctypes-0.08``. Now you can +extracted the source release to ``/home/joe/pygame-ctypes-0.09``. Now you can run your existing Pygame games by including this path near the start of your ``PYTHONPATH``:: # Using bash: - PYTHONPATH=/home/joe/pygame-ctypes-0.08:$PYTHONPATH; export PYTHONPATH + PYTHONPATH=/home/joe/pygame-ctypes-0.09:$PYTHONPATH; export PYTHONPATH # Using csh: - setenv PYTHONPATH /home/joe/pygame-ctypes-0.08:$PYTHONPATH + setenv PYTHONPATH /home/joe/pygame-ctypes-0.09:$PYTHONPATH python mygame.py On Windows, assuming you downloaded and extracted the source release to -``c:\pygame-ctypes-0.08``:: +``c:\pygame-ctypes-0.09``:: # At the command prompt: - set PYTHONPATH=c:\pygame-ctypes-0.08 + set PYTHONPATH=c:\pygame-ctypes-0.09 python mygame.py @@ -109,15 +147,6 @@ **Mac OS X users**: you should use ``pythonw``, not ``python``. -Documentation -------------- - -Documentation is included in the source distribution under the ``doc`` -directory. It is also browseable online: - -* `Pygame-ctypes API reference <pygame-api/index.html>`_ -* `SDL-ctypes Manual <sdl-manual/index.html>`_ -* `SDL-ctypes API reference <sdl-api/index.html>`_ .. _SDL: http://www.libsdl.org .. _ctypes: http://starship.python.net/crew/theller/ctypes @@ -125,3 +154,4 @@ .. _Google Summer of Code 2006: http://code.google.com/soc .. _Pygame: http://www.pygame.org .. _Python Imaging Library: http://www.pythonware.com/library/pil +.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/pygame-manual.txt Sun Aug 20 08:07:05 2006 +0000 @@ -0,0 +1,79 @@ + +:author: Alex Holkner +:address: aholkner@cs.rmit.edu.au \\\\ + http://www.pygame.org/ctypes + +:revision: 0.09 +:date: August 2006 + +:copyright: Copyright (c) 2006 Alex Holkner. + +============= +Pygame-ctypes +============= + +--------------------- +Introduction +--------------------- + +------------ +Requirements +------------ + +* Python 2.3 or later. +* Requires `ctypes 1.0.0 <http://starship.python.net/crew/theller/ctypes/>`_. + This is included in Python 2.5, or can be installed as an extension + for older versions. +* `SDL 1.2.1 <http://www.libsdl.org>`_ or later. + +The following libraries are optional but are required for some of Pygame's +functionality: + +* `Python Imaging Library (PIL) <http://www.pythonware.com/library/pil>`_ + is required for some ``pygame.transform`` functions, for saving and + loading images other than BMP, and speeds up other image functions. +* `SDL_image <http://www.libsdl.org/projects/SDL_image>`_ can be used + in place of PIL for loading some image types. +* `SDL_ttf <http://www.libsdl.org/projects/SDL_ttf>`_ is required for all + ``pygame.font`` functions. +* `SDL_mixer <http://www.libsdl.org/projects/SDL_ttf>`_ is required for + all ``pygame.mixer`` functions. + +Any of the following array modules can be used for the ``pygame.surfarray`` +and ``pygame.sndarray`` functions, and for speeding up some image +operations: + +* `NumPy <http://numpy.scipy.org/>`_ (recommended) +* `Numeric <http://numpy.scipy.org/>`_ +* `numarray <http://www.stsci.edu/resources/software_hardware/numarray>`_ + +------------------------------------ +Distributing your Pygame-ctypes game +------------------------------------ + +Using eggs +---------- + +With this option your distribution will include all +necessary dependencies on Pygame-ctypes, with the exception of the platform +libraries (ctypes, SDL, SDL_ttf, SDL_mixer, SDL_image, PIL). + +1. Download `setuptools`_ and copy ``pkg_resources.py`` into your + game's folder. Alternatively, you can require that your end-users + have ``setuptools`` installed. +2. Optionally include ``Pygame_ctypes-0.09-py2.4.egg`` and + ``SDL_ctypes-0.09-py2.4.egg`` in your game's folder. Including these adds + to the size of your distribution. If you don't include them they will be + located on PyPI and downloaded automatically the first time your game is + run. +3. In your game's source code, before you ``import pygame``, add the + following:: + + from pkg_resources import require + require('Pygame-ctypes>=0.09') + +That's it! Now bundle the two eggs and ``pkg_resources.py`` with the +rest of your game; it can be run without any installation or fiddling +with ``PYTHONPATH``. + +.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
--- a/doc/sdl-manual.txt Sun Aug 20 00:50:32 2006 +0000 +++ b/doc/sdl-manual.txt Sun Aug 20 08:07:05 2006 +0000 @@ -3,7 +3,7 @@ :address: aholkner@cs.rmit.edu.au \\\\ http://www.pygame.org/ctypes -:revision: 0.08 +:revision: 0.09 :date: August 2006 :copyright: Copyright (c) 2006 Alex Holkner.
--- a/pygame/pkgdata.py Sun Aug 20 00:50:32 2006 +0000 +++ b/pygame/pkgdata.py Sun Aug 20 08:07:05 2006 +0000 @@ -21,6 +21,13 @@ import os from cStringIO import StringIO +try: + # Try to use setuptools if available. + from pkg_resources import resource_stream + _have_resource_stream = True +except ImportError: + _have_resource_stream = False + def getResource(identifier, pkgname=__name__): """Acquire a readable object for a given package name and identifier. @@ -39,6 +46,10 @@ be handing data off to a C API. """ + # Prefer setuptools + if _have_resource_stream: + return resource_stream(pkgname, identifier) + mod = sys.modules[pkgname] fn = getattr(mod, '__file__', None) if fn is None:
--- a/setup.py Sun Aug 20 00:50:32 2006 +0000 +++ b/setup.py Sun Aug 20 08:07:05 2006 +0000 @@ -130,6 +130,11 @@ description='SDL-ctypes manual', chdir='', rest_howto='sdl-manual.txt'), + 'build_doc_pygame_manual' : make_doc_command( + name='pygame-manual', + description='Pygame-ctypes manual', + chdir='', + rest_howto='pygame-manual.txt'), 'build_doc_index': make_doc_command( name='index', description='documentation index', @@ -144,7 +149,7 @@ setup( name='pygame-ctypes', - version='0.08', + version='0.09', description='Python game and multimedia package', author='Alex Holkner', author_email='aholkner@cs.rmit.edu.au',
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup_pygame.py Sun Aug 20 08:07:05 2006 +0000 @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +''' +''' + +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from setuptools import setup, find_packages + +setup( + name='Pygame-ctypes', + version='0.09', + packages=['pygame'], + install_requires=['SDL-ctypes>=0.09'], + package_data = { + 'pygame': ['*.bmp', '*.ttf'] + }, + zip_safe=True, + description='Python game and multimedia package', + author='Alex Holkner', + author_email='aholkner@cs.rmit.edu.au', + url='http://www.pygame.org/ctypes', + license='LGPL') +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/setup_sdl.py Sun Aug 20 08:07:05 2006 +0000 @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +''' +''' + +__docformat__ = 'restructuredtext' +__version__ = '$Id$' + +from setuptools import setup, find_packages + +setup( + name='SDL-ctypes', + version='0.09', + packages=['SDL'], + zip_safe=True, + description='Python game and multimedia package', + author='Alex Holkner', + author_email='aholkner@cs.rmit.edu.au', + url='http://www.pygame.org/ctypes', + license='LGPL') +
