Merge lp:~mcfletch/simplegc/setuptools into lp:simplegc

Proposed by Mike C. Fletcher
Status: Merged
Merged at revision: 221
Proposed branch: lp:~mcfletch/simplegc/setuptools
Merge into: lp:simplegc
Diff against target: 51 lines (+36/-0)
2 files modified
setup.py (+35/-0)
sgc/__init__.py (+1/-0)
To merge this branch: bzr merge lp:~mcfletch/simplegc/setuptools
Reviewer Review Type Date Requested Status
Sam Bull Approve
Review via email: mp+104113@code.launchpad.net

Description of the change

Hi Sam,

Suggested during review that you add a setup.py file. You'd said you'd need a sample of what it would look like.

Branch has a sample setup.py for simplegc. Value proposition is simply that it's the standard way to package Python packages, while many game devs will just copy in the package, this lets a dev use standard tools to get started playing. For many python dev's that's just going to be "pip install simplegc".

It also allows you to build the package with versioned releases in .tar.gz, .zip, and .exe formats with a simple command. Should you wish to it can also upload the packages to pypi with another command.

Anyway, up to you if you want it, just wanted to follow through with the suggestion,
Mike

To post a comment you must log in.
lp:~mcfletch/simplegc/setuptools updated
222. By Mike C. Fletcher

Sigh, forgot to check in the setup.py...

Revision history for this message
Sam Bull (dreamsorcerer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'setup.py'
2--- setup.py 1970-01-01 00:00:00 +0000
3+++ setup.py 2012-04-30 13:58:17 +0000
4@@ -0,0 +1,35 @@
5+#!/usr/bin/env python
6+"""Installs vrml scenegraph modelling engine using setuptools (eggs)
7+"""
8+try:
9+ from setuptools import setup
10+except ImportError, err:
11+ from distutils.core import setup
12+import os
13+
14+def find_version( ):
15+ for line in open( os.path.join( 'sgc', '__init__.py' )):
16+ if line.startswith( '__version__' ):
17+ return line.split( '=' )[1].strip().strip('"').strip("'")
18+ raise RuntimeError( "Unable to find __version__ declaration" )
19+version = find_version()
20+
21+if __name__ == "__main__":
22+ setup (
23+ name = "SimpleGC",
24+ version = version,
25+ description = "GUI Library for Pygame",
26+ author = "Sam Bull",
27+ options = {
28+ 'sdist': {
29+ 'formats':['gztar','zip'],
30+ },
31+ },
32+ url = "https://launchpad.net/simplegc",
33+ license = "BSD",
34+ packages = ['sgc','sgc.widgets'],
35+ package_dir = {
36+ 'sgc': 'sgc',
37+ 'sgc.widgets': os.path.join( 'sgc', 'widgets'),
38+ },
39+ )
40
41=== modified file 'sgc/__init__.py'
42--- sgc/__init__.py 2012-03-18 23:26:51 +0000
43+++ sgc/__init__.py 2012-04-30 13:58:17 +0000
44@@ -7,6 +7,7 @@
45 :py:mod:`surface<sgc.surface>`: Extended pygame.surface classes.
46
47 """
48+__version__ = '0.1.3'
49
50 import surface
51 import locals

Subscribers

People subscribed via source and target branches