Skip to content

Commit 14d33c6

Browse files
authored
Deprecate Python2 (#350)
* remove python2 future imports * remove object as parent class * remove python2 packages from requires
1 parent 3a978ef commit 14d33c6

File tree

10 files changed

+3
-43
lines changed

10 files changed

+3
-43
lines changed

pykeepass/attachment.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
# FIXME python2
2-
from __future__ import unicode_literals
3-
from __future__ import print_function
4-
from __future__ import absolute_import
5-
from future.utils import python_2_unicode_compatible
6-
71
import pykeepass.entry
82

93
from pykeepass.exceptions import BinaryError
104

11-
# FIXME python2
12-
@python_2_unicode_compatible
135
class Attachment(object):
146
def __init__(self, element=None, kp=None, id=None, filename=None):
157
self._element = element

pykeepass/baseelement.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import absolute_import
2-
31
import base64
42
import struct
53
import uuid
@@ -8,7 +6,7 @@
86
from datetime import datetime
97

108

11-
class BaseElement(object):
9+
class BaseElement():
1210
"""Entry and Group inherit from this class"""
1311

1412
def __init__(self, element, kp=None, icon=None, expires=False,

pykeepass/entry.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# FIXME python2
2-
from __future__ import absolute_import, unicode_literals
3-
from future.utils import python_2_unicode_compatible
4-
51
import logging
62
from copy import deepcopy
73
from datetime import datetime
@@ -28,8 +24,6 @@
2824
'otp'
2925
]
3026

31-
# FIXME python2
32-
@python_2_unicode_compatible
3327
class Entry(BaseElement):
3428

3529
def __init__(self, title=None, username=None, password=None, url=None,

pykeepass/group.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# FIXME python2
2-
from __future__ import absolute_import, unicode_literals
3-
from future.utils import python_2_unicode_compatible
4-
51
from lxml.builder import E
62
from lxml.etree import Element, _Element
73
from lxml.objectify import ObjectifiedElement
@@ -10,8 +6,6 @@
106
from pykeepass.baseelement import BaseElement
117

128

13-
# FIXME python2
14-
@python_2_unicode_compatible
159
class Group(BaseElement):
1610

1711
def __init__(self, name=None, element=None, icon=None, notes=None,

pykeepass/pykeepass.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
# coding: utf-8
2-
3-
# FIXME python2
4-
from __future__ import absolute_import, print_function, unicode_literals
5-
from future.utils import python_2_unicode_compatible
6-
72
import base64
83
import logging
94
import os
@@ -38,9 +33,7 @@
3833
BLANK_DATABASE_PASSWORD = "password"
3934

4035

41-
# FIXME python2
42-
@python_2_unicode_compatible
43-
class PyKeePass(object):
36+
class PyKeePass():
4437
"""Open a KeePass database
4538
4639
Args:

pykeepass/xpath.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# FIXME python2
2-
from __future__ import unicode_literals
3-
41
attachment_xp = {
52
False: {
63
'id': '/Value[@Ref="{}"]/..',

requirements-rtd.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ pycryptodomex==3.14.1
33
construct==2.10.68
44
argon2-cffi==21.3.0
55
python-dateutil==2.8.2
6-
future==0.18.2
76
Sphinx>=3.2.1

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ pycryptodomex==3.14.1
33
construct==2.10.68
44
argon2-cffi==21.3.0
55
python-dateutil==2.8.2
6-
future==0.18.2

setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@
2121
packages=find_packages(include=['pykeepass', 'pykeepass.*']),
2222
install_requires=[
2323
"python-dateutil",
24-
# FIXME python2 - last version to support python2
25-
"construct==2.10.68",
24+
"construct",
2625
"argon2_cffi",
2726
"pycryptodomex>=3.6.2",
2827
"lxml",
29-
# FIXME python2
30-
"future",
3128
],
3229
include_package_data=True,
3330
)

tests/tests.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# -*- coding: utf-8 -*-
22

3-
# FIXME python2
4-
from __future__ import unicode_literals
5-
63
import logging
74
import os
85
import shutil

0 commit comments

Comments
 (0)