From e46ab8e890bd87924554c17aa7f474b08aa185fe Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sun, 19 Jun 2016 19:59:24 +0900 Subject: [PATCH 1/8] Update .travis.yml --- .travis.yml | 24 ++++++++++++++++++------ tox.ini | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index fdcc48a..635178f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,19 @@ language: python -env: - - TOXENV=py25 - - TOXENV=py26 - - TOXENV=py27 - - TOXENV=py33 - - TOXENV=py34 +matrix: + include: + - python: 2.5 + env: TOXENV=python2.5 + - python: 2.6 + env: TOXENV=python2.6 + - python: 2.7 + env: TOXENV=python2.7 + - python: 3.3 + env: TOXENV=python3.3 + - python: 3.4 + env: TOXENV=python3.4 + - python: 3.5 + env: TOXENV=python3.5 os: - linux @@ -20,3 +28,7 @@ script: after_success: - coveralls + +notifications: + slack: + secure: NfS1a6caCCDIgC/1MgNqD8e3IR9E5lKn8VA5KsdY8hBxYXHEYxZ52DaX+fIDifW5Pz7QG0NMHUfn5OiAbJOtRDqFLt0DN/cgzMoN4E+obhRzWx6JhYBMHQTE2qe7LnzIqmnWHoYP2K0HUcnyRMp8teIw8To89LwkyVD6G9oMlERCtTGzORpwtqPJKeNrjkDA2fbmlmca4HI0BCbkl8aWVfNvdEka/z09s/XzkMYbuhpJWnyFfARDQS5zmdZCEtWUbQbQsWvl9z+d2JISgzYzrQOIV9f8BFZTvPq6KUlsnPpR8O3nBr5Q61i51awd8HhH6zjn8jKoJVLdrjt1HPSWgWZx/BUqGKBa6PVrkZVwOQx+eNYyCIYEv38ViYAayO6c5Yt/LCsNg2h4Nyl6UM7OwTEN6Z+L1+ke70mWnmRHvYdIBbszvkF6H6BRF+1Yj//Yr7fx33yXzKEhIIyZ94zbwu6YqdPhuROSIHv5lCe5+dT8uYWNNF0QH46GcWC9/2kapO1ySu3iBOFzPxyDnxaBzzqazARKl/fibpbnMvzyKZnd1moHrWGSePKzF5ynGSxSzxctSf7Da683dl3jmqBUcTsDP7IEcj6LkJCF2/Q8ZexX6Kn0zULP+QNOisdt89gHFjHHA6PUD4g7qWXWsB/8y51HUtW7EiaoLjsAdaAHN8w= diff --git a/tox.ini b/tox.ini index b9038f4..f8fb546 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{25,26,27,33,34} +envlist = python{2.5,2.6,2.7,3.3,3.4,3.5} [testenv] deps = From c6b350e004cf45fcc5c2dd6309d06f42a7eb8179 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sun, 19 Jun 2016 20:01:52 +0900 Subject: [PATCH 2/8] Minimize Appveyor tests --- appveyor.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e11e736..caab818 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,10 +1,7 @@ build: false environment: matrix: - - PYTHON: "C:/Python26-x64" - PYTHON: "C:/Python27-x64" - - PYTHON: "C:/Python33-x64" - - PYTHON: "C:/Python34-x64" - PYTHON: "C:/Python35-x64" init: From 0f3a5955994ada53683c2555ff181a18bd9c445f Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sun, 19 Jun 2016 20:03:01 +0900 Subject: [PATCH 3/8] Drop support for Python 2.5 --- .travis.yml | 2 -- setup.py | 1 - tox.ini | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 635178f..feeae12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,6 @@ language: python matrix: include: - - python: 2.5 - env: TOXENV=python2.5 - python: 2.6 env: TOXENV=python2.6 - python: 2.7 diff --git a/setup.py b/setup.py index 83a42c0..96a39cd 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,6 @@ "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", diff --git a/tox.ini b/tox.ini index f8fb546..e05f6e6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = python{2.5,2.6,2.7,3.3,3.4,3.5} +envlist = python{2.6,2.7,3.3,3.4,3.5} [testenv] deps = From 479815534fb94da3f121a032cd669ac59c67bca6 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sun, 19 Jun 2016 20:18:54 +0900 Subject: [PATCH 4/8] Add a notification to Slack --- appveyor.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index caab818..8c1d1a5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,3 +16,9 @@ install: test_script: - "%PYTHON%/python.exe setup.py test" + +notifications: + - provider: Slack + auth_token: + secure: JyTQAtBzpPYiWK3eRTz/U+rvmAKopqIWE19ti4vSL/IRygV3jUVUkwET1VyTlrqOeYfNx3Kfcp7eUmHCHxFCgw== + channel: notifications From dde0aa94406c37ec46e83191baa7088a69993ac8 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sun, 19 Jun 2016 21:47:20 +0900 Subject: [PATCH 5/8] Make pytest-runner a conditional requirement Check for pytest-runner only if setup.py was invoked with 'test' argument. #20 --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 96a39cd..8421739 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ from __future__ import with_statement +import sys import os.path import setuptools @@ -6,6 +7,10 @@ MISC_DIR = "misc" REQUIREMENT_DIR = "requirements" +needs_pytest = set(['pytest', 'test', 'ptr']).intersection(sys.argv) +pytest_runner = ['pytest-runner'] if needs_pytest else [] + + with open("README.rst") as fp: long_description = fp.read() @@ -31,7 +36,7 @@ include_package_data=True, install_requires=install_requires, packages=setuptools.find_packages(exclude=['test*']), - setup_requires=["pytest-runner"], + setup_requires=pytest_runner, tests_require=tests_require, classifiers=[ "Development Status :: 4 - Beta", From b533c18e3265ba2456ab737f120749ecb9b16d78 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sun, 19 Jun 2016 21:55:12 +0900 Subject: [PATCH 6/8] Update docs --- docs/conf.py | 9 ++- docs/make_readme.py | 70 +++++++++++++++++++ docs/pages/installation.rst | 2 +- .../badges.txt} | 14 ---- docs/pages/introduction/index.rst | 10 +++ docs/pages/introduction/summary.txt | 3 + docs/pages/links.rst | 2 + 7 files changed, 92 insertions(+), 18 deletions(-) create mode 100644 docs/make_readme.py rename docs/pages/{introduction.rst => introduction/badges.txt} (70%) create mode 100644 docs/pages/introduction/index.rst create mode 100644 docs/pages/introduction/summary.txt diff --git a/docs/conf.py b/docs/conf.py index 91f736e..d6264e3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -373,10 +373,13 @@ .. |True| replace:: :py:obj:`True` .. |None| replace:: :py:obj:`None` -.. |int| replace:: :py:class:`str` -.. |float| replace:: :py:class:`str` -.. |str| replace:: :py:class:`str` .. |bool| replace:: :py:class:`bool` +.. |dict| replace:: :py:class:`dict` +.. |int| replace:: :py:class:`int` +.. |list| replace:: :py:class:`list` +.. |float| replace:: :py:class:`float` +.. |str| replace:: :py:class:`str` +.. |tuple| replace:: :py:obj:`tuple` """ module = u""" diff --git a/docs/make_readme.py b/docs/make_readme.py new file mode 100644 index 0000000..d35b909 --- /dev/null +++ b/docs/make_readme.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +# encoding: utf-8 + +""" +.. codeauthor:: Tsuyoshi Hombashi +""" + +import sys + +import readmemaker + + +PROJECT_NAME = "DateTimeRange" +OUTPUT_DIR = ".." + + +def write_examples(maker): + maker.set_indent_level(0) + maker.write_chapter("Examples") + + example_file_list = [ + "Create_and_convert_to_string.rst", + "Get_iterator.rst", + "Test_whether_a_value_within_the_time_range.rst", + "Test_whether_a_value_intersect_the_time_range.rst", + "Make_an_intersected_time_range.rst", + "Make_an_encompassed_time_range.rst", + "Truncate_time_range.rst", + ] + + for example_file in example_file_list: + maker.write_example_file(example_file) + + maker.inc_indent_level() + maker.write_chapter("For more information") + maker.write_line_list([ + "More examples are available at ", + "http://datetimerange.readthedocs.org/en/latest/pages/examples/index.html", + "", + "Examples with IPython Notebook is also available at ", + "http://nbviewer.jupyter.org/github/thombashi/%s/tree/master/ipynb/DateTimeRange.ipynb" % ( + PROJECT_NAME), + ]) + + +def main(): + maker = readmemaker.ReadmeMaker(PROJECT_NAME, OUTPUT_DIR) + + maker.write_introduction_file("badges.txt") + + maker.inc_indent_level() + maker.write_chapter("Summary") + maker.write_introduction_file("summary.txt") + + write_examples(maker) + + maker.write_file( + maker.doc_page_root_dir_path.joinpath("installation.rst")) + + maker.set_indent_level(0) + maker.write_chapter("Documentation") + maker.write_line_list([ + "http://datetimerange.readthedocs.org/en/latest/", + ]) + + return 0 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/docs/pages/installation.rst b/docs/pages/installation.rst index 34a0fdf..da04bd3 100644 --- a/docs/pages/installation.rst +++ b/docs/pages/installation.rst @@ -9,7 +9,7 @@ Installation Dependencies ============ -Python 2.5+ or 3.3+ +Python 2.6+ or 3.3+ - `python-dateutil `__ - `pytz `__ diff --git a/docs/pages/introduction.rst b/docs/pages/introduction/badges.txt similarity index 70% rename from docs/pages/introduction.rst rename to docs/pages/introduction/badges.txt index ade55a5..99b89f9 100644 --- a/docs/pages/introduction.rst +++ b/docs/pages/introduction/badges.txt @@ -1,6 +1,3 @@ -DateTimeRange -============= - .. image:: https://img.shields.io/pypi/pyversions/DateTimeRange.svg :target: https://pypi.python.org/pypi/DateTimeRange .. image:: https://travis-ci.org/thombashi/DateTimeRange.svg?branch=master @@ -9,14 +6,3 @@ DateTimeRange :target: https://ci.appveyor.com/project/thombashi/datetimerange/branch/master .. image:: https://coveralls.io/repos/github/thombashi/DateTimeRange/badge.svg?branch=master :target: https://coveralls.io/github/thombashi/DateTimeRange?branch=master - - -Summary -------- - -DateTimeRange is a python library to handle routine work associated with a time range, -such as test whether a time is within the time range, -get time range intersection, truncating the time range, etc. - - - diff --git a/docs/pages/introduction/index.rst b/docs/pages/introduction/index.rst new file mode 100644 index 0000000..c6bbe79 --- /dev/null +++ b/docs/pages/introduction/index.rst @@ -0,0 +1,10 @@ +DateTimeRange +============= + +.. include:: badges.txt + + +Summary +------- + +.. include:: summary.txt diff --git a/docs/pages/introduction/summary.txt b/docs/pages/introduction/summary.txt new file mode 100644 index 0000000..cd16529 --- /dev/null +++ b/docs/pages/introduction/summary.txt @@ -0,0 +1,3 @@ +DateTimeRange is a python library to handle routine work associated with a time range, +such as test whether a time is within the time range, +get time range intersection, truncating the time range, etc. \ No newline at end of file diff --git a/docs/pages/links.rst b/docs/pages/links.rst index 8ece393..23fbe27 100644 --- a/docs/pages/links.rst +++ b/docs/pages/links.rst @@ -5,5 +5,7 @@ Links - https://pip.pypa.io/en/stable/ - GitHub repository - https://github.com/thombashi/DateTimeRange +- Issue tracker + - https://github.com/thombashi/DateTimeRange/issues - PyPI - https://pypi.python.org/pypi/DateTimeRange From 01612c222fa0c8527977e2b4d06d27e9aa488cca Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sun, 19 Jun 2016 21:55:31 +0900 Subject: [PATCH 7/8] Update README --- README.rst | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index eb99b31..5ca86e2 100644 --- a/README.rst +++ b/README.rst @@ -10,7 +10,6 @@ DateTimeRange .. image:: https://coveralls.io/repos/github/thombashi/DateTimeRange/badge.svg?branch=master :target: https://coveralls.io/github/thombashi/DateTimeRange?branch=master - Summary ------- @@ -18,12 +17,8 @@ DateTimeRange is a python library to handle routine work associated with a time such as test whether a time is within the time range, get time range intersection, truncating the time range, etc. - - - -Usage -===== - +Examples +======== Create and convert to string ---------------------------- @@ -155,6 +150,7 @@ Truncate time range For more information -------------------- + More examples are available at http://datetimerange.readthedocs.org/en/latest/pages/examples/index.html @@ -172,7 +168,7 @@ Installation Dependencies ============ -Python 2.5+ or 3.3+ +Python 2.6+ or 3.3+ - `python-dateutil `__ - `pytz `__ @@ -189,4 +185,3 @@ Documentation http://datetimerange.readthedocs.org/en/latest/ - From ebdb7f2bb65019b26f100be021d6f7ab47e8232d Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sun, 19 Jun 2016 21:55:51 +0900 Subject: [PATCH 8/8] Bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8421739..2c94a4e 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ setuptools.setup( name="DateTimeRange", - version="0.2.1", + version="0.2.2", author="Tsuyoshi Hombashi", author_email="gogogo.vm@gmail.com", url="https://github.com/thombashi/DateTimeRange",