Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support of Python 2.x #181

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Changelog
=========

* Drop support of Python 2.x

* Add salt decryption of encrypted attributes

* Fix create CoA packet in client_async
Expand Down
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ them and decoding responses.

Here is an example of doing a authentication request::

from __future__ import print_function
from pyrad.client import Client
from pyrad.dictionary import Dictionary
import pyrad.packet
Expand Down
1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ them and decoding responses.

Here is an example of doing a authentication request::

from __future__ import print_function
from pyrad.client import Client
from pyrad.dictionary import Dictionary
import pyrad.packet
Expand Down
1 change: 0 additions & 1 deletion example/acct.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/python
from __future__ import print_function
from pyrad.client import Client
from pyrad.dictionary import Dictionary
import random
Expand Down
1 change: 0 additions & 1 deletion example/auth.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/python
from __future__ import print_function
from pyrad.client import Client
from pyrad.dictionary import Dictionary
import socket
Expand Down
1 change: 0 additions & 1 deletion example/client-coa.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Copyright 6WIND, 2017
#

from __future__ import print_function
from pyrad import dictionary, packet, server
import sys
import prctl
Expand Down
1 change: 0 additions & 1 deletion example/coa.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/python
from __future__ import print_function
from pyrad.client import Client
from pyrad import dictionary
from pyrad import packet
Expand Down
1 change: 0 additions & 1 deletion example/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/python
from __future__ import print_function
from pyrad import dictionary, packet, server
import logging

Expand Down
1 change: 0 additions & 1 deletion example/status.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/python
from __future__ import print_function
from pyrad.client import Client
from pyrad.dictionary import Dictionary
import socket
Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ classifiers = [
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Systems Administration :: Authentication/Directory",
]
Expand All @@ -32,9 +35,7 @@ include = [
repository = "https://github.com/pyradius/pyrad"

[tool.poetry.dependencies]
python = "^2.7 || ^3.6"
six = "^1.15.0"
netaddr = "^0.8"
python = "^3.6"

[tool.poetry.dev-dependencies]
nose = "^0.10.0b1"
3 changes: 1 addition & 2 deletions pyrad/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import select
import socket
import time
import six
import struct
from pyrad import host
from pyrad import packet
Expand All @@ -34,7 +33,7 @@ class Client(host.Host):
:type timeout: float
"""
def __init__(self, server, authport=1812, acctport=1813,
coaport=3799, secret=six.b(''), dict=None, retries=3, timeout=5):
coaport=3799, secret=b'', dict=None, retries=3, timeout=5):

"""Constructor.
Expand Down
3 changes: 1 addition & 2 deletions pyrad/client_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from datetime import datetime
import asyncio
import six
import logging
import random

Expand Down Expand Up @@ -175,7 +174,7 @@ class ClientAsync:
"""
# noinspection PyShadowingBuiltins
def __init__(self, server, auth_port=1812, acct_port=1813,
coa_port=3799, secret=six.b(''), dict=None,
coa_port=3799, secret=b'', dict=None,
loop=None, retries=3, timeout=30,
logger_name='pyrad'):

Expand Down
5 changes: 1 addition & 4 deletions pyrad/dictfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"""

import os
import six


class _Node(object):
Expand Down Expand Up @@ -54,10 +53,8 @@ def __init__(self, fil):
self.__ReadNode(fil)

def __ReadNode(self, fil):
node = None
parentdir = self.__CurDir()
if isinstance(fil, six.string_types):
fname = None
if isinstance(fil, str):
if os.path.isabs(fil):
fname = fil
else:
Expand Down
Loading
Loading