Skip to content

Commit b7b8e45

Browse files
author
Stuart Bishop
committed
version bump, test and build updates
1 parent b2aecb2 commit b7b8e45

File tree

4 files changed

+37
-44
lines changed

4 files changed

+37
-44
lines changed

Makefile

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ PYTHON33=python3.3
1313
PYTHON34=python3.4
1414
PYTHON35=python3.5
1515
PYTHON36=python3.6
16+
PYTHON37=python3.7
1617
PYTHON=/usr/bin/python
1718
PYTHON3=/usr/bin/python3
1819
IANA=./tz
@@ -31,33 +32,23 @@ check: test_tzinfo test_docs
3132
build: .stamp-tzinfo
3233

3334

34-
dist: build eggs wheels
35+
dist: build wheels
3536
cd build/dist && mkdir -p ../tarballs && \
3637
${PYTHON} setup.py -q sdist --dist-dir ../tarballs \
3738
--formats=bztar,gztar,zip
3839

39-
eggs:
40-
cd build/dist && mkdir -p ../tarballs
41-
cd build/dist && ${PYTHON24} setup.py -q bdist_egg --dist-dir=../tarballs
42-
cd build/dist && ${PYTHON25} setup.py -q bdist_egg --dist-dir=../tarballs
43-
cd build/dist && ${PYTHON26} setup.py -q bdist_egg --dist-dir=../tarballs
44-
cd build/dist && ${PYTHON27} setup.py -q bdist_egg --dist-dir=../tarballs
45-
cd build/dist && ${PYTHON35} setup.py -q bdist_egg --dist-dir=../tarballs
46-
cd build/dist && ${PYTHON34} setup.py -q bdist_egg --dist-dir=../tarballs
47-
cd build/dist && ${PYTHON33} setup.py -q bdist_egg --dist-dir=../tarballs
48-
4940
wheels:
5041
cd build/dist && mkdir -p ../tarballs
5142
cd build/dist && ${PYTHON} setup.py -q bdist_wheel --universal --dist-dir=../tarballs
5243
cd build/dist && ${PYTHON3} setup.py -q bdist_wheel --universal --dist-dir=../tarballs
5344

5445
upload: sign
5546
cd build/dist && ${PYTHON3} setup.py register
56-
twine upload build/tarballs/*.{egg,whl,gz,asc}
47+
twine upload build/tarballs/*.{whl,gz,asc}
5748

5849
sign: dist
5950
rm -f build/tarballs/*.asc
60-
for f in build/tarballs/*.{egg,whl,zip,bz2,gz} ; do \
51+
for f in build/tarballs/*.{whl,zip,bz2,gz} ; do \
6152
gpg2 --detach-sign -a $$f; \
6253
done
6354

@@ -83,7 +74,8 @@ test_lazy: .stamp-tzinfo
8374
&& ${PYTHON33} test_lazy.py ${TESTARGS} \
8475
&& ${PYTHON34} test_lazy.py ${TESTARGS} \
8576
&& ${PYTHON35} test_lazy.py ${TESTARGS} \
86-
&& ${PYTHON36} test_lazy.py ${TESTARGS}
77+
&& ${PYTHON36} test_lazy.py ${TESTARGS} \
78+
&& ${PYTHON37} test_lazy.py ${TESTARGS}
8779

8880
test_tzinfo: .stamp-tzinfo
8981
cd build/dist/pytz/tests \
@@ -96,12 +88,13 @@ test_tzinfo: .stamp-tzinfo
9688
&& ${PYTHON33} test_tzinfo.py ${TESTARGS} \
9789
&& ${PYTHON34} test_tzinfo.py ${TESTARGS} \
9890
&& ${PYTHON35} test_tzinfo.py ${TESTARGS} \
99-
&& ${PYTHON36} test_tzinfo.py ${TESTARGS}
91+
&& ${PYTHON36} test_tzinfo.py ${TESTARGS} \
92+
&& ${PYTHON37} test_tzinfo.py ${TESTARGS}
10093

10194
test_docs: .stamp-tzinfo
10295
cd build/dist/pytz/tests \
103-
&& ${PYTHON27} test_docs.py ${TESTARGS} \
104-
&& ${PYTHON34} test_docs.py ${TESTARGS}
96+
&& ${PYTHON} test_docs.py ${TESTARGS} \
97+
&& ${PYTHON3} test_docs.py ${TESTARGS}
10598

10699
test_zdump: dist
107100
${PYTHON} gen_tests.py ${TARGET} && \
@@ -183,4 +176,4 @@ _sync:
183176
echo "Usage: make sync TAG=2016f"; \
184177
fi
185178

186-
.PHONY: all check dist test test_tzinfo test_docs test_zdump eggs wheels build clean sync _sync
179+
.PHONY: all check dist test test_tzinfo test_docs test_zdump wheels build clean sync _sync

src/pytz/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323

2424
# The IANA (nee Olson) database is updated several times a year.
25-
OLSON_VERSION = '2018c'
26-
VERSION = '2018.3' # Switching to pip compatible version numbering.
25+
OLSON_VERSION = '2018d'
26+
VERSION = '2018.4' # pip compatible version number.
2727
__version__ = VERSION
2828

2929
OLSEN_VERSION = OLSON_VERSION # Old releases had this misspelling
@@ -413,18 +413,18 @@ def FixedOffset(offset, _tzinfos={}):
413413
>>> one = FixedOffset(-330)
414414
>>> one
415415
pytz.FixedOffset(-330)
416-
>>> one.utcoffset(datetime.datetime.now())
417-
datetime.timedelta(-1, 66600)
418-
>>> one.dst(datetime.datetime.now())
419-
datetime.timedelta(0)
416+
>>> str(one.utcoffset(datetime.datetime.now()))
417+
'-1 day, 18:30:00'
418+
>>> str(one.dst(datetime.datetime.now()))
419+
'0:00:00'
420420
421421
>>> two = FixedOffset(1380)
422422
>>> two
423423
pytz.FixedOffset(1380)
424-
>>> two.utcoffset(datetime.datetime.now())
425-
datetime.timedelta(0, 82800)
426-
>>> two.dst(datetime.datetime.now())
427-
datetime.timedelta(0)
424+
>>> str(two.utcoffset(datetime.datetime.now()))
425+
'23:00:00'
426+
>>> str(two.dst(datetime.datetime.now()))
427+
'0:00:00'
428428
429429
The datetime.timedelta must be between the range of -1 and 1 day,
430430
non-inclusive.

src/pytz/tests/test_tzinfo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
# I test for expected version to ensure the correct version of pytz is
2929
# actually being tested.
30-
EXPECTED_VERSION = '2018.3'
31-
EXPECTED_OLSON_VERSION = '2018c'
30+
EXPECTED_VERSION = '2018.4'
31+
EXPECTED_OLSON_VERSION = '2018d'
3232

3333
fmt = '%Y-%m-%d %H:%M:%S %Z%z'
3434

src/pytz/tzinfo.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -403,11 +403,11 @@ def utcoffset(self, dt, is_dst=None):
403403
>>> tz = timezone('America/St_Johns')
404404
>>> ambiguous = datetime(2009, 10, 31, 23, 30)
405405
406-
>>> tz.utcoffset(ambiguous, is_dst=False)
407-
datetime.timedelta(-1, 73800)
406+
>>> str(tz.utcoffset(ambiguous, is_dst=False))
407+
'-1 day, 20:30:00'
408408
409-
>>> tz.utcoffset(ambiguous, is_dst=True)
410-
datetime.timedelta(-1, 77400)
409+
>>> str(tz.utcoffset(ambiguous, is_dst=True))
410+
'-1 day, 21:30:00'
411411
412412
>>> try:
413413
... tz.utcoffset(ambiguous)
@@ -435,19 +435,19 @@ def dst(self, dt, is_dst=None):
435435
436436
>>> normal = datetime(2009, 9, 1)
437437
438-
>>> tz.dst(normal)
439-
datetime.timedelta(0, 3600)
440-
>>> tz.dst(normal, is_dst=False)
441-
datetime.timedelta(0, 3600)
442-
>>> tz.dst(normal, is_dst=True)
443-
datetime.timedelta(0, 3600)
438+
>>> str(tz.dst(normal))
439+
'1:00:00'
440+
>>> str(tz.dst(normal, is_dst=False))
441+
'1:00:00'
442+
>>> str(tz.dst(normal, is_dst=True))
443+
'1:00:00'
444444
445445
>>> ambiguous = datetime(2009, 10, 31, 23, 30)
446446
447-
>>> tz.dst(ambiguous, is_dst=False)
448-
datetime.timedelta(0)
449-
>>> tz.dst(ambiguous, is_dst=True)
450-
datetime.timedelta(0, 3600)
447+
>>> str(tz.dst(ambiguous, is_dst=False))
448+
'0:00:00'
449+
>>> str(tz.dst(ambiguous, is_dst=True))
450+
'1:00:00'
451451
>>> try:
452452
... tz.dst(ambiguous)
453453
... except AmbiguousTimeError:

0 commit comments

Comments
 (0)