Anonymous avatar Anonymous committed d1cbb8c

Egg support and version 0.09 release

Comments (0)

Files changed (9)

  - 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
 ------------------
+#!/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
 Download
 --------
 
-The latest source release is:
+Documentation
+^^^^^^^^^^^^^
 
-* `pygame-ctypes-0.08.tar.gz <pygame-ctypes-0.08.tar.gz>`_, includes the
+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')
+
+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
 
 
 **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
 .. _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

doc/pygame-manual.txt

+
+: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

doc/sdl-manual.txt

 :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.

pygame/pkgdata.py

 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.
 
     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:
          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',
 
 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',
+#!/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')
+    
+#!/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')
+    
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.