Skip to content

Commit c1ec351

Browse files
mraarifZulqarnain
andauthored
dropped support for python 3.5 and some refactoring (#13)
* dropped support for python 3.5 and some refactoring * Update Python in ReadMe Co-authored-by: Zulqarnain <muhammad.zulqarnain@arbisoft.com>
1 parent afcaec1 commit c1ec351

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+80
-77
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: python
22
python:
3-
- 3.5
43
- 3.8
54
install:
65
- pip install -r requirements/travis.txt
@@ -13,6 +12,6 @@ deploy:
1312
distributions: sdist bdist_wheel
1413
on:
1514
tags: true
16-
python: 3.5
15+
python: 3.8
1716
password:
1817
secure: XftLPhN6LpfOxPTiTnlwFDi53qjZIkp0VeR+Ydy4MTUbJKla5/yfXfSFmBX0lHN3PYa1A2A4rIUhvMWd9j66ist+2nqPjcJJy1DwSX1nKgVLanOpV/fFTC8yt/BOxgiaT+vdOUdoi3LmbTpezc6dYZHPmts5maAtG/RLGZG9Bcoreu28WPCGv45t1t36s+HUxtbDrMCTEqgwrBKJiaHza3m1XtFOjF722ypyoOlPPutq565tlmacJ7A44jaCrv/6SVtPCOsBd48qXyULvpZJdWor2vGdKzPQOWi7cOLty6iNc9chHCP5CCCJvRIwiv3RMkOhtcxqT/ch5eVhzBpTb8uV3upbQslP88q8bGeMVDWNBnpwPvNYipMX4mEJHKCESzGp9doJtPF17e3fPw7L52sGtHbn8peLm0Itw65W8UH1w49LDmJSOqPeZmzlSg/tp/Tt4FvYWt8zxH2J5Q4UReM5SCROWfBq5Asn1rzHZCgHauLRrBd0SjeO9RgDHPsuDUZmvzMiJ/wPwQ21IpSXl7xBEx79mI3NOdYRGxOA+y8fQUdfPLtY0TV3xhv4dU6YCc2jrpmwNu07jbHO5w47RtZr0TBfIR6wjcVMSeQBtUkKpn0QPKN+JpAU6qrEeDNx92YUm6V0z7MXZmtcxr/dcxq4fsTK5hQqy2zOzkw8VYY=

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ For more information about the Tin Can API visit:
1010

1111
<http://tincanapi.com/>
1212

13-
Requires Python 2.7 or later.
13+
Requires Python 3.8 or later.
1414

1515
## Installation
16-
TinCanPython requires [Python 2.7](https://www.python.org/downloads/) or later. Python 3 is not supported.
16+
TinCanPython requires [Python 3.8](https://www.python.org/downloads/) or later.
1717

1818
If you are installing from the Github repo, you will need to install `aniso8601` and `pytz` (use `sudo` as necessary):
1919

docs/source/conf.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# Tin Can Python documentation build configuration file, created by
43
# sphinx-quickstart on Tue Jun 10 12:52:27 2014.
@@ -57,8 +56,8 @@ def setup(app):
5756
master_doc = 'index'
5857

5958
# General information about the project.
60-
project = u'Tin Can Python'
61-
copyright = u'2014, Rustici Software'
59+
project = 'Tin Can Python'
60+
copyright = '2014, Rustici Software'
6261

6362
# The version info for the project you're documenting, acts as replacement for
6463
# |version| and |release|, also used in various other places throughout the
@@ -209,8 +208,8 @@ def setup(app):
209208
# (source start file, target name, title,
210209
# author, documentclass [howto, manual, or own class]).
211210
latex_documents = [
212-
('index', 'TinCanPython.tex', u'Tin Can Python Documentation',
213-
u'Rustici Software', 'manual'),
211+
('index', 'TinCanPython.tex', 'Tin Can Python Documentation',
212+
'Rustici Software', 'manual'),
214213
]
215214

216215
# The name of an image file (relative to this directory) to place at the top of
@@ -239,8 +238,8 @@ def setup(app):
239238
# One entry per manual page. List of tuples
240239
# (source start file, name, description, authors, manual section).
241240
man_pages = [
242-
('index', 'tincanpython', u'Tin Can Python Documentation',
243-
[u'Rustici Software'], 1)
241+
('index', 'tincanpython', 'Tin Can Python Documentation',
242+
['Rustici Software'], 1)
244243
]
245244

246245
# If true, show URL addresses after external links.
@@ -253,8 +252,8 @@ def setup(app):
253252
# (source start file, target name, title, author,
254253
# dir menu entry, description, category)
255254
texinfo_documents = [
256-
('index', 'TinCanPython', u'Tin Can Python Documentation',
257-
u'Rustici Software', 'TinCanPython',
255+
('index', 'TinCanPython', 'Tin Can Python Documentation',
256+
'Rustici Software', 'TinCanPython',
258257
'One line description of project.', 'Miscellaneous'),
259258
]
260259

requirements/base.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
#
55
# make upgrade
66
#
7-
aniso8601==8.0.0 # via -r requirements/base.in
8-
pytz==2020.1 # via -r requirements/base.in
7+
aniso8601==8.1.0
8+
# via -r requirements/base.in
9+
pytz==2020.5
10+
# via -r requirements/base.in

requirements/pip_tools.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
#
55
# make upgrade
66
#
7-
click==7.1.2 # via pip-tools
8-
pip-tools==5.2.1 # via -r requirements/pip_tools.in
9-
six==1.15.0 # via pip-tools
7+
click==7.1.2
8+
# via pip-tools
9+
pip-tools==5.5.0
10+
# via -r requirements/pip_tools.in
1011

1112
# The following packages are considered to be unsafe in a requirements file:
1213
# pip

requirements/test.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
#
55
# make upgrade
66
#
7-
aniso8601==8.0.0 # via -r requirements/base.txt
8-
pytz==2020.1 # via -r requirements/base.txt
7+
aniso8601==8.1.0
8+
# via -r requirements/base.txt
9+
pytz==2020.5
10+
# via -r requirements/base.txt

requirements/travis.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
#
55
# make upgrade
66
#
7-
aniso8601==8.0.0 # via -r requirements/test.txt
8-
pytz==2020.1 # via -r requirements/test.txt
7+
aniso8601==8.1.0
8+
# via -r requirements/test.txt
9+
pytz==2020.5
10+
# via -r requirements/test.txt

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,12 @@ def is_requirement(line):
3131
'tincan/conversions',
3232
'tincan/documents',
3333
],
34-
version='0.0.9',
34+
version='1.0.0',
3535
description='A Python 3 library for implementing Tin Can API.',
3636
author='edX',
3737
author_email='oscm@edx.org',
3838
classifiers=[
3939
'Programming Language :: Python :: 3',
40-
'Programming Language :: Python :: 3.5',
4140
'Programming Language :: Python :: 3.8',
4241
],
4342
maintainer_email='mailto:brian.miller@tincanapi.com',

test/documents/activity_profile_document_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_init_arg_exception_dict(self):
7575
ActivityProfileDocument(d)
7676

7777
def test_init_arg_exception_obj(self):
78-
class Tester(object):
78+
class Tester:
7979
def __init__(self, id=None, bad_test="test"):
8080
self.id = id
8181
self.bad_test = bad_test

test/documents/agent_profile_document_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_init_arg_exception_dict(self):
6262
AgentProfileDocument(d)
6363

6464
def test_init_arg_exception_obj(self):
65-
class Tester(object):
65+
class Tester:
6666
def __init__(self, id=None, bad_test="test"):
6767
self.id = id
6868
self.bad_test = bad_test

test/documents/document_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_init_arg_exception_dict(self):
6060
Document(d)
6161

6262
def test_init_arg_exception_obj(self):
63-
class Tester(object):
63+
class Tester:
6464
def __init__(self, id=None, bad_test="test"):
6565
self.id = id
6666
self.bad_test = bad_test

test/documents/state_document_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def test_init_arg_exception_dict(self):
8282
StateDocument(d)
8383

8484
def test_init_arg_exception_obj(self):
85-
class Tester(object):
85+
class Tester:
8686
def __init__(self, id=None, bad_test="test"):
8787
self.id = id
8888
self.bad_test = bad_test

test/http_request_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_init_arg_exception_dict(self):
5656
HTTPRequest(d)
5757

5858
def test_init_arg_exception_obj(self):
59-
class Tester(object):
59+
class Tester:
6060
def __init__(self, resource="ok", bad_test="test"):
6161
self.resource = resource
6262
self.bad_test = bad_test
@@ -153,7 +153,7 @@ def test_setters_none(self):
153153
self.assertEqual(req.query_params, {})
154154

155155
def test_headers_setter(self):
156-
class Tester(object):
156+
class Tester:
157157
def __init__(self, param="ok", tester="test"):
158158
self.param = param
159159
self.tester = tester
@@ -169,7 +169,7 @@ def __init__(self, param="ok", tester="test"):
169169
self.assertEqual(req.headers["tester"], "test")
170170

171171
def test_query_params_setter(self):
172-
class Tester(object):
172+
class Tester:
173173
def __init__(self, param="ok", tester="test"):
174174
self.param = param
175175
self.tester = tester

test/lrs_response_test.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# coding=utf-8
21
#
32
# Copyright 2014 Rustici Software
43
#
@@ -59,7 +58,7 @@ def test_init_arg_exception_dict(self):
5958
LRSResponse(d)
6059

6160
def test_init_arg_exception_obj(self):
62-
class Tester(object):
61+
class Tester:
6362
def __init__(self, success=True, bad_test="test"):
6463
self.success = success
6564
self.bad_test = bad_test
@@ -143,7 +142,7 @@ def test_unicode(self):
143142

144143
self.assertIsInstance(resp, LRSResponse)
145144
self.assertIsInstance(resp.data, str)
146-
self.assertEqual(resp.data, u"δοκιμή περιεχομένου")
145+
self.assertEqual(resp.data, "δοκιμή περιεχομένου")
147146

148147
def test_setters_none(self):
149148
resp = LRSResponse()
@@ -168,7 +167,7 @@ def test_setters_none(self):
168167
self.assertIsNone(resp.response)
169168

170169
def test_request_setter(self):
171-
class Tester(object):
170+
class Tester:
172171
def __init__(self, resource="ok", headers=None):
173172
if headers is None:
174173
headers = {"test": "ok"}
@@ -188,7 +187,7 @@ def __init__(self, resource="ok", headers=None):
188187
self.assertEqual(resp.request.headers, {"test": "ok"})
189188

190189
def test_response_setter(self):
191-
class Tester(object):
190+
class Tester:
192191
def __init__(self, msg="ok", version="test"):
193192
self.msg = msg
194193
self.version = version

tincan/about.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self, *args, **kwargs):
3737
self._version = None
3838
self._extensions = None
3939

40-
super(About, self).__init__(*args, **kwargs)
40+
super().__init__(*args, **kwargs)
4141

4242
@property
4343
def version(self):

tincan/activity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(self, *args, **kwargs):
4141
self._object_type = None
4242
self._definition = None
4343

44-
super(Activity, self).__init__(*args, **kwargs)
44+
super().__init__(*args, **kwargs)
4545

4646
@property
4747
def id(self):

tincan/activity_definition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __init__(self, *args, **kwargs):
6868
self._steps = None
6969
self._extensions = None
7070

71-
super(ActivityDefinition, self).__init__(*args, **kwargs)
71+
super().__init__(*args, **kwargs)
7272

7373
@property
7474
def name(self):

tincan/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, *args, **kwargs):
4545
self._openid = None
4646
self._account = None
4747

48-
super(Agent, self).__init__(*args, **kwargs)
48+
super().__init__(*args, **kwargs)
4949

5050
@property
5151
def object_type(self):

tincan/agent_account.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, *args, **kwargs):
3131
self._name = None
3232
self._home_page = None
3333

34-
super(AgentAccount, self).__init__(*args, **kwargs)
34+
super().__init__(*args, **kwargs)
3535

3636
@property
3737
def name(self):

tincan/attachment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(self, *args, **kwargs):
4646
self._description = None
4747
self._fileurl = None
4848

49-
super(Attachment, self).__init__(*args, **kwargs)
49+
super().__init__(*args, **kwargs)
5050

5151
@property
5252
def usage_type(self):

tincan/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"""
2222

2323

24-
class Base(object):
24+
class Base:
2525
_props = []
2626

2727
def __init__(self, *args, **kwargs):
@@ -56,7 +56,7 @@ def __setattr__(self, attr, value):
5656
5757
"""
5858
if attr.startswith('_') and attr[1:] in self._props:
59-
super(Base, self).__setattr__(attr, value)
59+
super().__setattr__(attr, value)
6060
elif attr not in self._props:
6161
raise AttributeError(
6262
"Property '%s' cannot be set on a 'tincan.%s' object. Allowed properties: %s" %
@@ -66,7 +66,7 @@ def __setattr__(self, attr, value):
6666
', '.join(self._props)
6767
))
6868
else:
69-
super(Base, self).__setattr__(attr, value)
69+
super().__setattr__(attr, value)
7070

7171
def __eq__(self, other):
7272
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__

tincan/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(self, *args, **kwargs):
6262
self._statement = None
6363
self._extensions = None
6464

65-
super(Context, self).__init__(*args, **kwargs)
65+
super().__init__(*args, **kwargs)
6666

6767
@property
6868
def registration(self):

tincan/context_activities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, *args, **kwargs):
3131
self._grouping = None
3232
self._other = None
3333

34-
super(ContextActivities, self).__init__(*args, **kwargs)
34+
super().__init__(*args, **kwargs)
3535

3636
@property
3737
def category(self):

tincan/conversions/iso8601.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ def jsonify_timedelta(value):
114114
# hours
115115
bigger_exists = date or hours
116116
if bigger_exists:
117-
time += '{:02}H'.format(hours)
117+
time += f'{hours:02}H'
118118

119119
# minutes
120120
bigger_exists = bigger_exists or minutes
121121
if bigger_exists:
122-
time += '{:02}M'.format(minutes)
122+
time += f'{minutes:02}M'
123123

124124
# seconds
125125
if seconds.is_integer():
@@ -130,7 +130,7 @@ def jsonify_timedelta(value):
130130
# remove trailing zeros
131131
seconds = seconds.rstrip('0')
132132

133-
time += '{}S'.format(seconds)
133+
time += f'{seconds}S'
134134

135135
return 'P' + date + time
136136

tincan/documents/activity_profile_document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ActivityProfileDocument(Document):
4545

4646
def __init__(self, *args, **kwargs):
4747
self._activity = None
48-
super(ActivityProfileDocument, self).__init__(*args, **kwargs)
48+
super().__init__(*args, **kwargs)
4949

5050
@property
5151
def activity(self):

tincan/documents/agent_profile_document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class AgentProfileDocument(Document):
4545

4646
def __init__(self, *args, **kwargs):
4747
self._agent = None
48-
super(AgentProfileDocument, self).__init__(*args, **kwargs)
48+
super().__init__(*args, **kwargs)
4949

5050
@property
5151
def agent(self):

tincan/documents/document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(self, *args, **kwargs):
5151
self._etag = None
5252
self._timestamp = None
5353

54-
super(Document, self).__init__(*args, **kwargs)
54+
super().__init__(*args, **kwargs)
5555

5656
@property
5757
def id(self):

tincan/documents/state_document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __init__(self, *args, **kwargs):
5555
self._activity = None
5656
self._registration = None
5757

58-
super(StateDocument, self).__init__(*args, **kwargs)
58+
super().__init__(*args, **kwargs)
5959

6060
@property
6161
def agent(self):

0 commit comments

Comments
 (0)