summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Bishop <stuart.bishop@canonical.com>2018-04-10 09:34:01 +0000
committerStuart Bishop <stuart.bishop@canonical.com>2018-04-10 09:34:01 +0000
commitb7b8e4567feef7eee8095b8b22f55cb770f356b6 (patch)
tree5e9fd4b4e6b252bbd4111f59cc5769bfa638f94a
parentb2aecb2dea2267b5b0a5b89ab8da4d26d91c2b51 (diff)
downloadpytz-git-b7b8e4567feef7eee8095b8b22f55cb770f356b6.tar.gz
version bump, test and build updates
-rw-r--r--Makefile29
-rw-r--r--src/pytz/__init__.py20
-rw-r--r--src/pytz/tests/test_tzinfo.py4
-rw-r--r--src/pytz/tzinfo.py28
4 files changed, 37 insertions, 44 deletions
diff --git a/Makefile b/Makefile
index 0207771..4445423 100644
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,7 @@ PYTHON33=python3.3
PYTHON34=python3.4
PYTHON35=python3.5
PYTHON36=python3.6
+PYTHON37=python3.7
PYTHON=/usr/bin/python
PYTHON3=/usr/bin/python3
IANA=./tz
@@ -31,21 +32,11 @@ check: test_tzinfo test_docs
build: .stamp-tzinfo
-dist: build eggs wheels
+dist: build wheels
cd build/dist && mkdir -p ../tarballs && \
${PYTHON} setup.py -q sdist --dist-dir ../tarballs \
--formats=bztar,gztar,zip
-eggs:
- cd build/dist && mkdir -p ../tarballs
- cd build/dist && ${PYTHON24} setup.py -q bdist_egg --dist-dir=../tarballs
- cd build/dist && ${PYTHON25} setup.py -q bdist_egg --dist-dir=../tarballs
- cd build/dist && ${PYTHON26} setup.py -q bdist_egg --dist-dir=../tarballs
- cd build/dist && ${PYTHON27} setup.py -q bdist_egg --dist-dir=../tarballs
- cd build/dist && ${PYTHON35} setup.py -q bdist_egg --dist-dir=../tarballs
- cd build/dist && ${PYTHON34} setup.py -q bdist_egg --dist-dir=../tarballs
- cd build/dist && ${PYTHON33} setup.py -q bdist_egg --dist-dir=../tarballs
-
wheels:
cd build/dist && mkdir -p ../tarballs
cd build/dist && ${PYTHON} setup.py -q bdist_wheel --universal --dist-dir=../tarballs
@@ -53,11 +44,11 @@ wheels:
upload: sign
cd build/dist && ${PYTHON3} setup.py register
- twine upload build/tarballs/*.{egg,whl,gz,asc}
+ twine upload build/tarballs/*.{whl,gz,asc}
sign: dist
rm -f build/tarballs/*.asc
- for f in build/tarballs/*.{egg,whl,zip,bz2,gz} ; do \
+ for f in build/tarballs/*.{whl,zip,bz2,gz} ; do \
gpg2 --detach-sign -a $$f; \
done
@@ -83,7 +74,8 @@ test_lazy: .stamp-tzinfo
&& ${PYTHON33} test_lazy.py ${TESTARGS} \
&& ${PYTHON34} test_lazy.py ${TESTARGS} \
&& ${PYTHON35} test_lazy.py ${TESTARGS} \
- && ${PYTHON36} test_lazy.py ${TESTARGS}
+ && ${PYTHON36} test_lazy.py ${TESTARGS} \
+ && ${PYTHON37} test_lazy.py ${TESTARGS}
test_tzinfo: .stamp-tzinfo
cd build/dist/pytz/tests \
@@ -96,12 +88,13 @@ test_tzinfo: .stamp-tzinfo
&& ${PYTHON33} test_tzinfo.py ${TESTARGS} \
&& ${PYTHON34} test_tzinfo.py ${TESTARGS} \
&& ${PYTHON35} test_tzinfo.py ${TESTARGS} \
- && ${PYTHON36} test_tzinfo.py ${TESTARGS}
+ && ${PYTHON36} test_tzinfo.py ${TESTARGS} \
+ && ${PYTHON37} test_tzinfo.py ${TESTARGS}
test_docs: .stamp-tzinfo
cd build/dist/pytz/tests \
- && ${PYTHON27} test_docs.py ${TESTARGS} \
- && ${PYTHON34} test_docs.py ${TESTARGS}
+ && ${PYTHON} test_docs.py ${TESTARGS} \
+ && ${PYTHON3} test_docs.py ${TESTARGS}
test_zdump: dist
${PYTHON} gen_tests.py ${TARGET} && \
@@ -183,4 +176,4 @@ _sync:
echo "Usage: make sync TAG=2016f"; \
fi
-.PHONY: all check dist test test_tzinfo test_docs test_zdump eggs wheels build clean sync _sync
+.PHONY: all check dist test test_tzinfo test_docs test_zdump wheels build clean sync _sync
diff --git a/src/pytz/__init__.py b/src/pytz/__init__.py
index f317f8a..242bcba 100644
--- a/src/pytz/__init__.py
+++ b/src/pytz/__init__.py
@@ -22,8 +22,8 @@ from pytz.tzfile import build_tzinfo
# The IANA (nee Olson) database is updated several times a year.
-OLSON_VERSION = '2018c'
-VERSION = '2018.3' # Switching to pip compatible version numbering.
+OLSON_VERSION = '2018d'
+VERSION = '2018.4' # pip compatible version number.
__version__ = VERSION
OLSEN_VERSION = OLSON_VERSION # Old releases had this misspelling
@@ -413,18 +413,18 @@ def FixedOffset(offset, _tzinfos={}):
>>> one = FixedOffset(-330)
>>> one
pytz.FixedOffset(-330)
- >>> one.utcoffset(datetime.datetime.now())
- datetime.timedelta(-1, 66600)
- >>> one.dst(datetime.datetime.now())
- datetime.timedelta(0)
+ >>> str(one.utcoffset(datetime.datetime.now()))
+ '-1 day, 18:30:00'
+ >>> str(one.dst(datetime.datetime.now()))
+ '0:00:00'
>>> two = FixedOffset(1380)
>>> two
pytz.FixedOffset(1380)
- >>> two.utcoffset(datetime.datetime.now())
- datetime.timedelta(0, 82800)
- >>> two.dst(datetime.datetime.now())
- datetime.timedelta(0)
+ >>> str(two.utcoffset(datetime.datetime.now()))
+ '23:00:00'
+ >>> str(two.dst(datetime.datetime.now()))
+ '0:00:00'
The datetime.timedelta must be between the range of -1 and 1 day,
non-inclusive.
diff --git a/src/pytz/tests/test_tzinfo.py b/src/pytz/tests/test_tzinfo.py
index 6ecb333..851a33d 100644
--- a/src/pytz/tests/test_tzinfo.py
+++ b/src/pytz/tests/test_tzinfo.py
@@ -27,8 +27,8 @@ from pytz.tzinfo import DstTzInfo, StaticTzInfo
# I test for expected version to ensure the correct version of pytz is
# actually being tested.
-EXPECTED_VERSION = '2018.3'
-EXPECTED_OLSON_VERSION = '2018c'
+EXPECTED_VERSION = '2018.4'
+EXPECTED_OLSON_VERSION = '2018d'
fmt = '%Y-%m-%d %H:%M:%S %Z%z'
diff --git a/src/pytz/tzinfo.py b/src/pytz/tzinfo.py
index d78c2ed..725978d 100644
--- a/src/pytz/tzinfo.py
+++ b/src/pytz/tzinfo.py
@@ -403,11 +403,11 @@ class DstTzInfo(BaseTzInfo):
>>> tz = timezone('America/St_Johns')
>>> ambiguous = datetime(2009, 10, 31, 23, 30)
- >>> tz.utcoffset(ambiguous, is_dst=False)
- datetime.timedelta(-1, 73800)
+ >>> str(tz.utcoffset(ambiguous, is_dst=False))
+ '-1 day, 20:30:00'
- >>> tz.utcoffset(ambiguous, is_dst=True)
- datetime.timedelta(-1, 77400)
+ >>> str(tz.utcoffset(ambiguous, is_dst=True))
+ '-1 day, 21:30:00'
>>> try:
... tz.utcoffset(ambiguous)
@@ -435,19 +435,19 @@ class DstTzInfo(BaseTzInfo):
>>> normal = datetime(2009, 9, 1)
- >>> tz.dst(normal)
- datetime.timedelta(0, 3600)
- >>> tz.dst(normal, is_dst=False)
- datetime.timedelta(0, 3600)
- >>> tz.dst(normal, is_dst=True)
- datetime.timedelta(0, 3600)
+ >>> str(tz.dst(normal))
+ '1:00:00'
+ >>> str(tz.dst(normal, is_dst=False))
+ '1:00:00'
+ >>> str(tz.dst(normal, is_dst=True))
+ '1:00:00'
>>> ambiguous = datetime(2009, 10, 31, 23, 30)
- >>> tz.dst(ambiguous, is_dst=False)
- datetime.timedelta(0)
- >>> tz.dst(ambiguous, is_dst=True)
- datetime.timedelta(0, 3600)
+ >>> str(tz.dst(ambiguous, is_dst=False))
+ '0:00:00'
+ >>> str(tz.dst(ambiguous, is_dst=True))
+ '1:00:00'
>>> try:
... tz.dst(ambiguous)
... except AmbiguousTimeError: