Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #21

Merged
merged 8 commits into from
Jun 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
language: python

env:
- TOXENV=py25
- TOXENV=py26
- TOXENV=py27
- TOXENV=py33
- TOXENV=py34
matrix:
include:
- 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
Expand All @@ -20,3 +26,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=
13 changes: 4 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,15 @@ DateTimeRange
.. 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.




Usage
=====

Examples
========

Create and convert to string
----------------------------
Expand Down Expand Up @@ -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

Expand All @@ -172,7 +168,7 @@ Installation
Dependencies
============

Python 2.5+ or 3.3+
Python 2.6+ or 3.3+

- `python-dateutil <https://pypi.python.org/pypi/python-dateutil/>`__
- `pytz <https://pypi.python.org/pypi/pytz>`__
Expand All @@ -189,4 +185,3 @@ Documentation

http://datetimerange.readthedocs.org/en/latest/


9 changes: 6 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -19,3 +16,9 @@ install:

test_script:
- "%PYTHON%/python.exe setup.py test"

notifications:
- provider: Slack
auth_token:
secure: JyTQAtBzpPYiWK3eRTz/U+rvmAKopqIWE19ti4vSL/IRygV3jUVUkwET1VyTlrqOeYfNx3Kfcp7eUmHCHxFCgw==
channel: notifications
9 changes: 6 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down
70 changes: 70 additions & 0 deletions docs/make_readme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/usr/bin/env python
# encoding: utf-8

"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""

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())
2 changes: 1 addition & 1 deletion docs/pages/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Installation
Dependencies
============

Python 2.5+ or 3.3+
Python 2.6+ or 3.3+

- `python-dateutil <https://pypi.python.org/pypi/python-dateutil/>`__
- `pytz <https://pypi.python.org/pypi/pytz>`__
Expand Down
14 changes: 0 additions & 14 deletions docs/pages/introduction.rst → docs/pages/introduction/badges.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.



10 changes: 10 additions & 0 deletions docs/pages/introduction/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
DateTimeRange
=============

.. include:: badges.txt


Summary
-------

.. include:: summary.txt
3 changes: 3 additions & 0 deletions docs/pages/introduction/summary.txt
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions docs/pages/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
from __future__ import with_statement
import sys
import os.path
import setuptools


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()

Expand All @@ -20,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",
Expand All @@ -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",
Expand All @@ -41,7 +46,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",
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{25,26,27,33,34}
envlist = python{2.6,2.7,3.3,3.4,3.5}

[testenv]
deps =
Expand Down