aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernat Gabor <jokerjokerer@gmail.com>2017-12-06 23:50:52 +0000
committerBernat Gabor <jokerjokerer@gmail.com>2017-12-07 00:15:47 +0000
commit04254e3c4718b9b2ee96fa38a5d67c8104989592 (patch)
tree0985a6ce0cb0eba50815a1fd3463579758a095bc
parent660a88ef71a3619d39d23fd2bd0be44a9c82256c (diff)
downloaddateutil-04254e3c4718b9b2ee96fa38a5d67c8104989592.tar.gz
add document generation to tox, and trigger automatically at CI (also check links in documentation to avoid having dangling pointers to the internet)
-rw-r--r--.travis.yml11
-rw-r--r--README.rst2
-rw-r--r--dateutil/parser/_parser.py2
-rw-r--r--dateutil/parser/isoparser.py4
-rw-r--r--dateutil/relativedelta.py2
-rw-r--r--dateutil/tz/tz.py3
-rw-r--r--dateutil/zoneinfo/__init__.py2
-rw-r--r--dateutil/zoneinfo/rebuild.py2
-rw-r--r--docs/conf.py2
-rw-r--r--docs/examples.rst6
-rw-r--r--docs/relativedelta.rst10
-rw-r--r--docs/zoneinfo.rst5
-rw-r--r--tox.ini18
13 files changed, 44 insertions, 25 deletions
diff --git a/.travis.yml b/.travis.yml
index e512d3b..3329ab0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,4 @@
+sudo: false
language: python
cache: pip
python:
@@ -9,9 +10,14 @@ python:
- "nightly"
- "pypy-5.4"
- "pypy3"
+env:
+ TOXENV=py
matrix:
fast_finish: true
+ include:
+ - python: 3.6
+ env: TOXENV=docs
allow_failures:
- python: "nightly"
@@ -20,9 +26,8 @@ install:
- ./ci_tools/retry.sh python updatezinfo.py
script:
- - tox -e py
+ - tox
after_success:
- - tox -e coverage,codecov
+ - if [[ $TOXENV == "py" ]]; then tox -e coverage,codecov; fi
-sudo: FALSE
diff --git a/README.rst b/README.rst
index 6d6f589..2a1b4a0 100644
--- a/README.rst
+++ b/README.rst
@@ -32,7 +32,7 @@ dateutil is available on PyPI
https://pypi.python.org/pypi/python-dateutil/
The documentation is hosted at:
-https://dateutil.readthedocs.io/
+https://dateutil.readthedocs.io/en/stable/
Code
====
diff --git a/dateutil/parser/_parser.py b/dateutil/parser/_parser.py
index 541cdfc..2291f39 100644
--- a/dateutil/parser/_parser.py
+++ b/dateutil/parser/_parser.py
@@ -22,7 +22,7 @@ Additional resources about date/time string formats can be found below:
- `A summary of the international standard date and time notation
<http://www.cl.cam.ac.uk/~mgk25/iso-time.html>`_
- `W3C Date and Time Formats <http://www.w3.org/TR/NOTE-datetime>`_
-- `Time Formats (Planetary Rings Node) <http://pds-rings.seti.org/tools/time_formats.html>`_
+- `Time Formats (Planetary Rings Node) <https://pds-rings.seti.org:443/tools/time_formats.html>`_
- `CPAN ParseDate module
<http://search.cpan.org/~muir/Time-modules-2013.0912/lib/Time/ParseDate.pm>`_
- `Java SimpleDateFormat Class
diff --git a/dateutil/parser/isoparser.py b/dateutil/parser/isoparser.py
index 89aa3ec..1550c3a 100644
--- a/dateutil/parser/isoparser.py
+++ b/dateutil/parser/isoparser.py
@@ -65,7 +65,7 @@ class isoparser(object):
- ``YYYY``
- ``YYYY-MM`` or ``YYYYMM``
- - ``YYYY-MM-DD`` or `YYYYMMDD``
+ - ``YYYY-MM-DD`` or ``YYYYMMDD``
Uncommon:
@@ -79,7 +79,7 @@ class isoparser(object):
- ``hh``
- ``hh:mm`` or ``hhmm``
- - ``hh:mm:ss`` or `hhmmss``
+ - ``hh:mm:ss`` or ``hhmmss``
- ``hh:mm:ss.sss`` or ``hh:mm:ss.ssssss`` (3-6 sub-second digits)
Midnight is a special case for `hh`, as the standard supports both
diff --git a/dateutil/relativedelta.py b/dateutil/relativedelta.py
index 2c3e25c..584ed5a 100644
--- a/dateutil/relativedelta.py
+++ b/dateutil/relativedelta.py
@@ -19,7 +19,7 @@ class relativedelta(object):
"""
The relativedelta type is based on the specification of the excellent
work done by M.-A. Lemburg in his
- `mx.DateTime <http://www.egenix.com/files/python/mxDateTime.html>`_ extension.
+ `mx.DateTime <https://www.egenix.com/products/python/mxBase/mxDateTime/>`_ extension.
However, notice that this type does *NOT* implement the same algorithm as
his work. Do *NOT* expect it to behave like mx.DateTime's counterpart.
diff --git a/dateutil/tz/tz.py b/dateutil/tz/tz.py
index 496148f..39e19c7 100644
--- a/dateutil/tz/tz.py
+++ b/dateutil/tz/tz.py
@@ -122,6 +122,7 @@ class tzutc(datetime.tzinfo):
class tzoffset(datetime.tzinfo):
"""
A simple class for representing a fixed offset from UTC.
+
:param name:
The timezone name, to be returned when ``tzname()`` is called.
:param offset:
@@ -156,10 +157,12 @@ class tzoffset(datetime.tzinfo):
"""
Whether or not the "wall time" of a given datetime is ambiguous in this
zone.
+
:param dt:
A :py:class:`datetime.datetime`, naive or time zone aware.
:return:
Returns ``True`` if ambiguous, ``False`` otherwise.
+
.. versionadded:: 2.6.0
"""
return False
diff --git a/dateutil/zoneinfo/__init__.py b/dateutil/zoneinfo/__init__.py
index 1df1d96..34f11ad 100644
--- a/dateutil/zoneinfo/__init__.py
+++ b/dateutil/zoneinfo/__init__.py
@@ -8,7 +8,7 @@ from io import BytesIO
from dateutil.tz import tzfile as _tzfile
-__all__ = ["get_zonefile_instance", "gettz", "gettz_db_metadata", "rebuild"]
+__all__ = ["get_zonefile_instance", "gettz", "gettz_db_metadata"]
ZONEFILENAME = "dateutil-zoneinfo.tar.gz"
METADATA_FN = 'METADATA'
diff --git a/dateutil/zoneinfo/rebuild.py b/dateutil/zoneinfo/rebuild.py
index 8dd5e1d..78f0d1a 100644
--- a/dateutil/zoneinfo/rebuild.py
+++ b/dateutil/zoneinfo/rebuild.py
@@ -12,7 +12,7 @@ from dateutil.zoneinfo import METADATA_FN, ZONEFILENAME
def rebuild(filename, tag=None, format="gz", zonegroups=[], metadata=None):
"""Rebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*tar*
- filename is the timezone tarball from ftp.iana.org/tz.
+ filename is the timezone tarball from ``ftp.iana.org/tz``.
"""
tmpdir = tempfile.mkdtemp()
diff --git a/docs/conf.py b/docs/conf.py
index 95695ab..79b71f8 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -135,7 +135,7 @@ html_theme = 'default'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+html_static_path = []
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
diff --git a/docs/examples.rst b/docs/examples.rst
index c049177..6e477fa 100644
--- a/docs/examples.rst
+++ b/docs/examples.rst
@@ -873,7 +873,7 @@ But when an `rruleset` is needed, it is automatically used.
parse examples
------------
+--------------
The following code will prepare the environment:
.. doctest:: tz
@@ -1274,7 +1274,7 @@ in the year of 2003.
Here is the example mentioned in the
-[http://www.python.org/doc/current/lib/module-time.html time module documentation].
+[https://docs.python.org/3/library/time.html time module documentation].
.. testsetup:: tzstr
@@ -1362,7 +1362,7 @@ DST is 1h in the given example) instead of the DST time. That's how
the `tzinfo` subtypes should deal with the extra hour that happens
when going back to the standard time. Check
-[http://www.python.org/doc/current/lib/datetime-tzinfo.html tzinfo documentation]
+[https://docs.python.org/3/library/datetime.html#datetime.tzinfo tzinfo documentation]
for more information.
diff --git a/docs/relativedelta.rst b/docs/relativedelta.rst
index 72c882d..8769cc7 100644
--- a/docs/relativedelta.rst
+++ b/docs/relativedelta.rst
@@ -10,10 +10,10 @@ relativedelta
Examples
--------
- from datetime import *; from dateutil.relativedelta import *
- import calendar
- NOW = datetime(2003, 9, 17, 20, 54, 47, 282310)
- TODAY = date(2003, 9, 17)
+ >>> from datetime import *; from dateutil.relativedelta import *
+ >>> import calendar
+ >>> NOW = datetime(2003, 9, 17, 20, 54, 47, 282310)
+ >>> TODAY = date(2003, 9, 17)
Let's begin our trip::
@@ -208,4 +208,4 @@ We can use the non-leap year day to ignore this:
.. doctest:: relativedelta
>>> date(2000, 1, 1)+relativedelta(nlyearday=260)
- datetime.date(2000, 9, 17) \ No newline at end of file
+ datetime.date(2000, 9, 17)
diff --git a/docs/zoneinfo.rst b/docs/zoneinfo.rst
index 99591f9..d85f2c7 100644
--- a/docs/zoneinfo.rst
+++ b/docs/zoneinfo.rst
@@ -5,10 +5,13 @@ zoneinfo
:members:
:undoc-members:
+.. automodule:: dateutil.zoneinfo.rebuild
+ :members: rebuild
+
zonefile_metadata
-----------------
The zonefile metadata defines the version and exact location of
-the timezone database to download. It is used in the :ref:`updatezinfo.py`
+the timezone database to download. It is used in the ``updatezinfo.py``
script. A json encoded file is included in the source-code, and
within each tar file we produce. The json file is attached here:
diff --git a/tox.ini b/tox.ini
index d10573f..23ddfd8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -6,8 +6,9 @@ envlist = py27,
py36,
pypy,
pypy3,
- coverage
-minversion = 2.7.0
+ coverage,
+ docs
+minversion = 2.9.0
skip_missing_interpreters = true
[testenv]
@@ -43,8 +44,15 @@ commands = python -m pip list --format=columns
[coverage:run]
source = dateutil
-omit = dateutil/test*
[coverage:report]
-skip_covered=True
-show_missing=True
+skip_covered = True
+show_missing = True
+
+[testenv:docs]
+description = invoke sphinx-build to build the HTML docs, check that URIs are valid
+basepython = python3.6
+deps = sphinx >= 1.6.3, < 2
+ {[testenv]deps}
+commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" {posargs:-W --color -bhtml}
+ sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" {posargs:-W --color -blinkcheck}