Skip to content

Commit

Permalink
Deprecate Python2 (#350)
Browse files Browse the repository at this point in the history
* remove python2 future imports

* remove object as parent class

* remove python2 packages from requires
  • Loading branch information
pwall2222 authored Aug 19, 2023
1 parent 3a978ef commit 14d33c6
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 43 deletions.
8 changes: 0 additions & 8 deletions pykeepass/attachment.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# FIXME python2
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from future.utils import python_2_unicode_compatible

import pykeepass.entry

from pykeepass.exceptions import BinaryError

# FIXME python2
@python_2_unicode_compatible
class Attachment(object):
def __init__(self, element=None, kp=None, id=None, filename=None):
self._element = element
Expand Down
4 changes: 1 addition & 3 deletions pykeepass/baseelement.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

import base64
import struct
import uuid
Expand All @@ -8,7 +6,7 @@
from datetime import datetime


class BaseElement(object):
class BaseElement():
"""Entry and Group inherit from this class"""

def __init__(self, element, kp=None, icon=None, expires=False,
Expand Down
6 changes: 0 additions & 6 deletions pykeepass/entry.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# FIXME python2
from __future__ import absolute_import, unicode_literals
from future.utils import python_2_unicode_compatible

import logging
from copy import deepcopy
from datetime import datetime
Expand All @@ -28,8 +24,6 @@
'otp'
]

# FIXME python2
@python_2_unicode_compatible
class Entry(BaseElement):

def __init__(self, title=None, username=None, password=None, url=None,
Expand Down
6 changes: 0 additions & 6 deletions pykeepass/group.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# FIXME python2
from __future__ import absolute_import, unicode_literals
from future.utils import python_2_unicode_compatible

from lxml.builder import E
from lxml.etree import Element, _Element
from lxml.objectify import ObjectifiedElement
Expand All @@ -10,8 +6,6 @@
from pykeepass.baseelement import BaseElement


# FIXME python2
@python_2_unicode_compatible
class Group(BaseElement):

def __init__(self, name=None, element=None, icon=None, notes=None,
Expand Down
9 changes: 1 addition & 8 deletions pykeepass/pykeepass.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# coding: utf-8

# FIXME python2
from __future__ import absolute_import, print_function, unicode_literals
from future.utils import python_2_unicode_compatible

import base64
import logging
import os
Expand Down Expand Up @@ -38,9 +33,7 @@
BLANK_DATABASE_PASSWORD = "password"


# FIXME python2
@python_2_unicode_compatible
class PyKeePass(object):
class PyKeePass():
"""Open a KeePass database
Args:
Expand Down
3 changes: 0 additions & 3 deletions pykeepass/xpath.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# FIXME python2
from __future__ import unicode_literals

attachment_xp = {
False: {
'id': '/Value[@Ref="{}"]/..',
Expand Down
1 change: 0 additions & 1 deletion requirements-rtd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ pycryptodomex==3.14.1
construct==2.10.68
argon2-cffi==21.3.0
python-dateutil==2.8.2
future==0.18.2
Sphinx>=3.2.1
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ pycryptodomex==3.14.1
construct==2.10.68
argon2-cffi==21.3.0
python-dateutil==2.8.2
future==0.18.2
5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@
packages=find_packages(include=['pykeepass', 'pykeepass.*']),
install_requires=[
"python-dateutil",
# FIXME python2 - last version to support python2
"construct==2.10.68",
"construct",
"argon2_cffi",
"pycryptodomex>=3.6.2",
"lxml",
# FIXME python2
"future",
],
include_package_data=True,
)
3 changes: 0 additions & 3 deletions tests/tests.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# -*- coding: utf-8 -*-

# FIXME python2
from __future__ import unicode_literals

import logging
import os
import shutil
Expand Down

0 comments on commit 14d33c6

Please sign in to comment.