Permalink
Browse files

Update setup.py to fix build error and change project structure

  • Loading branch information...
1 parent 397abc5 commit de4ef62abe9f29b2fdf7c54bf87e912f4f31e1a5 @abarmat committed Dec 29, 2011
Showing with 69 additions and 85 deletions.
  1. +0 −20 COPYING
  2. +32 −0 HISTORY.rst
  3. +1 −4 oembed.py → oembed/__init__.py
  4. +36 −61 setup.py
  5. 0 oembed_test.py → tests/test_net.py
View
@@ -1,20 +0,0 @@
-Copyright (c) 2008 Ariel Barmat, abarmat@gmail.com
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
View
@@ -0,0 +1,32 @@
+History
+=======
+
+0.2.1 (2011-12-29)
+------------------
+
+* Fix build problems in setup.py
+
+0.2.0 (2011-10-20)
+------------------
+
+* Update code format
+* Improve import selection of JSON and XML libraries
+* Remove unused files
+
+0.1.2 (2009-07-28)
+------------------
+
+* Bugfix: resolved issue #1
+* Added test case to the URL matching
+
+0.1.1 (2008-09-08)
+------------------
+
+* Fixed mime-type check. It failed when more tokens where present in the content-type.
+* Added new mime-type "application/xml".
+* Changed minor error on package descriptor.
+
+0.1.0 (2008-09-05)
+------------------
+
+* First release
@@ -90,9 +90,6 @@ def json_decode(s):
import cElementTree as etree
-__author__ = 'abarmat@gmail.com'
-__version__ = '0.2.0'
-
class OEmbedError(Exception):
'''Base class for OEmbed errors'''
@@ -230,7 +227,7 @@ def __init__(self, url, urlSchemes=None):
def _initRequestHeaders(self):
self._requestHeaders = {}
- self.setUserAgent('python-oembed/' + __version__)
+ self.setUserAgent('python-oembed')
def addUrlScheme(self, url):
'''
View
@@ -1,64 +1,39 @@
-#!/usr/bin/python
-#
-# Copyright 2008 Ariel Barmat.
-
-'''The setup and build script for the python-oembed library.'''
-
-__author__ = 'abarmat@gmail.com'
-__version__ = '0.2.0'
-
-
-# The base package metadata to be used by both distutils and setuptools
-METADATA = dict(
- name = "python-oembed",
- version = __version__,
- py_modules = ['oembed'],
- author='Ariel Barmat',
- author_email='abarmat@gmail.com',
- long_description='A Python library that implements an OEmbed consumer to use with OEmbed providers.',
- license='MIT License',
- url='http://code.google.com/p/python-oembed/',
- keywords='oembed python api',
-)
-
-# Extra package metadata to be used only if setuptools is installed
-SETUPTOOLS_METADATA = dict(
- install_requires = ['setuptools', 'simplejson'],
- include_package_data = True,
- classifiers = [
- 'Development Status :: 3 - Alpha',
- 'Intended Audience :: Developers',
- 'License :: OSI Approved :: MIT License',
- 'Topic :: Software Development :: Libraries :: Python Modules',
- 'Topic :: Internet',
- ],
- test_suite = 'oembed_test.suite',
-)
+#!/usr/bin/env python
+import os
import sys
-if sys.version < '2.5':
- SETUPTOOLS_METADATA['install_requires'].append('ElementTree')
- SETUPTOOLS_METADATA['install_requires'].append('cElementTree')
-
-def Read(file):
- return open(file).read()
-
-def BuildLongDescription():
- return '\n'.join([Read('CHANGES')])
-
-def Main():
- # Build the long_description from the README and CHANGES
- METADATA['long_description'] = BuildLongDescription()
-
- # Use setuptools if available, otherwise fallback and use distutils
- try:
- import setuptools
- METADATA.update(SETUPTOOLS_METADATA)
- setuptools.setup(**METADATA)
- except ImportError:
- import distutils.core
- distutils.core.setup(**METADATA)
-
-if __name__ == '__main__':
- Main()
+try:
+ from setuptools import setup
+except ImportError:
+ from distutils.core import setup
+
+def publish():
+ """Publish to Pypi"""
+ os.system("python setup.py sdist upload")
+
+if sys.argv[-1] == "publish":
+ publish()
+ sys.exit()
+
+version = '0.2.1'
+
+setup(
+ name='python-oembed',
+ version=version,
+ description='OEmbed consumer library for Python',
+ long_description=open('README.markdown').read() + '\n\n' + open('HISTORY.rst').read(),
+ author='Ariel Barmat',
+ author_email='abarmat@gmail.com',
+ url='http://github.com/abarmat/python-oembed',
+ packages=['oembed'],
+ license='MIT',
+ classifiers = (
+ "Development Status :: 4 - Beta",
+ "License :: OSI Approved :: MIT License",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 2.5",
+ "Programming Language :: Python :: 2.6",
+ ),
+ keywords='oembed python api'
+)
File renamed without changes.

0 comments on commit de4ef62

Please sign in to comment.