From 867e1c26fe63287ecca25371bbe202905772628d Mon Sep 17 00:00:00 2001 From: Nick Timkovich Date: Wed, 1 Jun 2016 20:50:48 -0500 Subject: [PATCH 1/5] Replace dateutils with python-dateutil --- .travis.yml | 1 + setup.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 219a9a2..169bf25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ python: - "3.2" - "3.3" - "3.4" + - "3.5" before_install: pip install --quiet lxml python-dateutil diff --git a/setup.py b/setup.py index 059dcb7..0df715e 100755 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setup( url = 'http://lkiesow.github.io/python-feedgen', keywords = ['feed','ATOM','RSS','podcast'], license = 'FreeBSD and LGPLv3+', - install_requires = ['lxml', 'dateutils'], + install_requires = ['lxml', 'python-dateutil'], classifiers = [ 'Development Status :: 4 - Beta', 'Development Status :: 5 - Production/Stable', From 2e2c23d9ae007508feca2f948f5c0522da923ca2 Mon Sep 17 00:00:00 2001 From: Nick Timkovich Date: Wed, 1 Jun 2016 21:20:28 -0500 Subject: [PATCH 2/5] Add code to make wheels --- Makefile | 3 +++ setup.cfg | 2 ++ setup.py | 1 + 3 files changed, 6 insertions(+) create mode 100644 setup.cfg diff --git a/Makefile b/Makefile index b61b9b6..4ae3541 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,9 @@ doc-latexpdf: publish: sdist python setup.py register sdist upload +publish_wheel: sdist + python setup.py bdist_wheel upload + test: python -m unittest feedgen.tests.test_feed python -m unittest feedgen.tests.test_entry diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..3c6e79c --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/setup.py b/setup.py index 0df715e..a96055e 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import setuptools from distutils.core import setup import feedgen.version From 542dade8fa2ce88f5da95635b76c290af060f703 Mon Sep 17 00:00:00 2001 From: Nick Timkovich Date: Wed, 1 Jun 2016 21:33:23 -0500 Subject: [PATCH 3/5] Build and test wheel --- .travis.yml | 7 +++++-- Makefile | 6 +++--- setup.py | 14 +++++++++++++- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 169bf25..934b3bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,9 @@ python: - "3.4" - "3.5" -before_install: pip install --quiet lxml python-dateutil +before_install: + python setup.py bdist_wheel --include-test-subpackage + pip install dist/feedgen* -script: make test +script: + make test diff --git a/Makefile b/Makefile index 4ae3541..e9457b4 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ publish_wheel: sdist python setup.py bdist_wheel upload test: - python -m unittest feedgen.tests.test_feed - python -m unittest feedgen.tests.test_entry - python -m unittest feedgen.tests.test_extension + python -I -m unittest feedgen.tests.test_feed + python -I -m unittest feedgen.tests.test_entry + python -I -m unittest feedgen.tests.test_extension @rm -f tmp_Atomfeed.xml tmp_Rssfeed.xml diff --git a/setup.py b/setup.py index a96055e..fbe8984 100755 --- a/setup.py +++ b/setup.py @@ -1,13 +1,25 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import sys +MAGIC_BUILD_FLAG = '--include-test-subpackage' +if MAGIC_BUILD_FLAG in sys.argv: + sys.argv.remove(MAGIC_BUILD_FLAG) + with_tests = True +else: + with_tests = False + import setuptools from distutils.core import setup import feedgen.version +packages = ['feedgen', 'feedgen/ext'] +if with_tests: + packages.append('feedgen/tests') + setup( name = 'feedgen', - packages = ['feedgen', 'feedgen/ext'], + packages = packages, version = feedgen.version.version_full_str, description = 'Feed Generator (ATOM, RSS, Podcasts)', author = 'Lars Kiesow', From 743f9e4221b60826384c2d51d1db885782adfc60 Mon Sep 17 00:00:00 2001 From: Nick Timkovich Date: Wed, 1 Jun 2016 21:39:54 -0500 Subject: [PATCH 4/5] Fix .travis.yml settings --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 934b3bd..7776087 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,7 @@ python: - "3.5" before_install: - python setup.py bdist_wheel --include-test-subpackage - pip install dist/feedgen* + - python setup.py bdist_wheel --include-test-subpackage + - pip install dist/feedgen* -script: - make test +script: make test From a76a56e7396e2696bcb22551bd7f92755e7d0c02 Mon Sep 17 00:00:00 2001 From: Nick Timkovich Date: Wed, 1 Jun 2016 21:46:18 -0500 Subject: [PATCH 5/5] Compensate for no -I on <3.4 by just deleting the source dir for tests --- .travis.yml | 1 + Makefile | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7776087..8ea3b31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,6 @@ python: before_install: - python setup.py bdist_wheel --include-test-subpackage - pip install dist/feedgen* + - rm -rf feedgen script: make test diff --git a/Makefile b/Makefile index e9457b4..4ae3541 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ publish_wheel: sdist python setup.py bdist_wheel upload test: - python -I -m unittest feedgen.tests.test_feed - python -I -m unittest feedgen.tests.test_entry - python -I -m unittest feedgen.tests.test_extension + python -m unittest feedgen.tests.test_feed + python -m unittest feedgen.tests.test_entry + python -m unittest feedgen.tests.test_extension @rm -f tmp_Atomfeed.xml tmp_Rssfeed.xml