From 87bbf8fc9036ba8eb26b2ad4d0164840d033d2cc Mon Sep 17 00:00:00 2001 From: Tanner Netterville Date: Tue, 16 Feb 2016 05:04:24 -0600 Subject: [PATCH] Release 0.2.0 - Merged improvements from Wenzil's fork. Thanks Wenzil! - Update for new version of Markdown breaks backwards compatability. - Dropped test support for Python 2.6 - Fixed test suite (including Travis CI config) --- .gitignore | 5 ++++- .travis.yml | 11 +++++++---- README.markdown | 12 ++++++++++++ mdx_oembed/__init__.py | 2 +- mdx_oembed/endpoints.py | 30 +++++++++++++++--------------- setup.py | 8 ++------ tests.py | 5 ++++- 7 files changed, 45 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 1ae6ed9..4e17e26 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ .DS_Store .idea -dist +/dist +/.eggs +/venv *.pyc +*.egg *.egg-info diff --git a/.travis.yml b/.travis.yml index d6c3478..89de62b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ language: python python: - - "2.6" - - "2.7" -# command to run tests -script: python setup.py test \ No newline at end of file + - "2.7" + - "3.2" + - "3.3" + - "3.4" + - "3.5" +install: "pip install . nose mock" +script: nosetests diff --git a/README.markdown b/README.markdown index 3fcfb3d..b89e8ce 100644 --- a/README.markdown +++ b/README.markdown @@ -1,5 +1,7 @@ # Python Markdown oEmbed +[![Build Status](https://travis-ci.org/rennat/python-markdown-oembed.svg?branch=master)](https://travis-ci.org/rennat/python-markdown-oembed) + Markdown extension to allow media embedding using the oEmbed standard. ## Installation @@ -23,3 +25,13 @@ Markdown extension to allow media embedding using the oEmbed standard. ## License A Public Domain work. Do as you wish. + +## Changelog + +### 0.2.0 + +- backwards incompatible changes + - allows arbitrary endpoints ([commit](https://github.com/Wenzil/python-markdown-oembed/commit/1e89de9db5e63677e071c36503e2499bbe0792da)) + - works with modern Markdown (>=2.6) + - dropped support for python 2.6 +- added support python 3.x diff --git a/mdx_oembed/__init__.py b/mdx_oembed/__init__.py index 32a9d2a..9bac0d9 100644 --- a/mdx_oembed/__init__.py +++ b/mdx_oembed/__init__.py @@ -2,7 +2,7 @@ from mdx_oembed.extension import OEmbedExtension -VERSION = '0.1.9' +VERSION = '0.2.0' def makeExtension(**kwargs): diff --git a/mdx_oembed/endpoints.py b/mdx_oembed/endpoints.py index 370bfaa..49901f2 100644 --- a/mdx_oembed/endpoints.py +++ b/mdx_oembed/endpoints.py @@ -1,21 +1,21 @@ # -*- coding: utf-8 -*- import oembed +YOUTUBE = oembed.OEmbedEndpoint('http://www.youtube.com/oembed', [ + 'https?://(*.)?youtube.com/*', + 'https?://youtu.be/*', +]) + +FLICKR = oembed.OEmbedEndpoint('http://www.flickr.com/services/oembed/', [ + 'https?://*.flickr.com/*', +]) + +VIMEO = oembed.OEmbedEndpoint('http://vimeo.com/api/oembed.json', [ + 'https?://vimeo.com/*', +]) DEFAULT_ENDPOINTS = [ - # Youtube - oembed.OEmbedEndpoint('http://www.youtube.com/oembed', [ - 'https?://(*.)?youtube.com/*', - 'https?://youtu.be/*', - ]), - - # Flickr - oembed.OEmbedEndpoint('http://www.flickr.com/services/oembed/', [ - 'https?://*.flickr.com/*', - ]), - - # Vimeo - oembed.OEmbedEndpoint('http://vimeo.com/api/oembed.json', [ - 'https?://vimeo.com/*', - ]), + YOUTUBE, + FLICKR, + VIMEO ] diff --git a/setup.py b/setup.py index fa5dbf3..d4dc324 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ except Exception: setup( name='python-markdown-oembed', - version='0.1.9', + version='0.2.0', description="Markdown extension to allow media embedding using the oEmbed " "standard.", long_description=LONG_DESCRIPTION, @@ -42,10 +42,6 @@ setup( test_suite='nose.collector', tests_require=[ 'nose', - 'mock', - 'WebTest >= 1.2', - 'BeautifulSoup', - 'pytidylib', - 'poster' + 'mock' ] ) diff --git a/tests.py b/tests.py index bbf9c41..b3e8662 100644 --- a/tests.py +++ b/tests.py @@ -3,7 +3,9 @@ import re import unittest import markdown from mock import patch +from nose.plugins.skip import SkipTest from mdx_oembed.extension import OEMBED_LINK_RE +from mdx_oembed import endpoints class OEmbedPatternRegexTestCase(unittest.TestCase): @@ -110,6 +112,7 @@ class ProtocolVarietyTestCase(OEmbedExtensionTestCase): self.assertIn('