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

Conversation

socketpair
Copy link
Contributor

No description provided.

@socketpair
Copy link
Contributor Author

Since we already user ipaddress.*, Python 2.7 will not work anymore. So drop it. 2023 !

@socketpair
Copy link
Contributor Author

Seems CI has some problems. Not in the code I have changed.

@socketpair
Copy link
Contributor Author

Well, seems someone retriggered CI. Anyway, fail again. not in my code.

@socketpair
Copy link
Contributor Author

@GIC-de

@GIC-de
Copy link
Collaborator

GIC-de commented Jun 13, 2023

Seems like an issue with Coveralls. I will check as soon as possible.

@socketpair
Copy link
Contributor Author

@GIC-de

@socketpair
Copy link
Contributor Author

@GIC-de please review and merge

@socketpair
Copy link
Contributor Author

@GIC-de @wichert @Istvan91 Please take a look.

@@ -158,15 +157,12 @@ def EncodeDate(num):
return struct.pack('!I', num)


def DecodeString(str):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this function return different data types in success and unsuccess path ? I don't known what Author meant...

@kloczek
Copy link

kloczek commented Mar 25, 2024

Any chance to merge this PR and release new version? 🤔

@kloczek
Copy link

kloczek commented Mar 26, 2024

Just tested this PR and looks like pytest fails in 3 units

Here is pytest output:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pyrad-2.4-10.fc36.x86_64/usr/lib64/python3.9/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pyrad-2.4-10.fc36.x86_64/usr/lib/python3.9/site-packages
+ /usr/bin/pytest -ra -m 'not network' tests/__init__.py tests/mock.py tests/testBidict.py tests/testClient.py tests/testDictionary.py tests/testHost.py tests/testPacket.py tests/testProxy.py tests/testServer.py tests/testTools.py
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.9.18, pytest-8.1.1, pluggy-1.4.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/tkloczko/rpmbuild/BUILD/pyrad-2.4
configfile: pyproject.toml
plugins: timeout-2.3.1, asyncio-0.23.6, syrupy-4.6.1, mock-3.14.0, anyio-4.3.0, aspectlib-2.0.0, benchmark-4.0.0, rerunfailures-12.0, aiohttp-1.0.5, forked-1.6.0, localserver-0.8.1, django-4.8.0
asyncio: mode=strict
collected 202 items

tests/testBidict.py .......                                                                                                                                                           [  3%]
tests/testClient.py ...F..F......F....                                                                                                                                                [ 12%]
tests/testDictionary.py .....................................                                                                                                                         [ 30%]
tests/testHost.py ........                                                                                                                                                            [ 34%]
tests/testPacket.py ................................................................................                                                                                  [ 74%]
tests/testProxy.py ......                                                                                                                                                             [ 77%]
tests/testServer.py .........................                                                                                                                                         [ 89%]
tests/testTools.py .....................                                                                                                                                              [100%]

========================================================================================= FAILURES ==========================================================================================
_________________________________________________________________________________ SocketTests.testAuthDelay _________________________________________________________________________________

self = <tests.testClient.SocketTests testMethod=testAuthDelay>

    def testAuthDelay(self):
        self.client.retries = 2
        self.client.timeout = 1
        packet = MockPacket(AccessRequest)
>       self.assertRaises(Timeout, self.client._SendPacket, packet, 432)

tests/testClient.py:124:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyrad/client.py:158: in _SendPacket
    rawreply = self._socket.recv(4096)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def recv(self, buffer):
>       return self.data[:buffer]
E       AttributeError: 'MockSocket' object has no attribute 'data'

tests/mock.py:62: AttributeError
____________________________________________________________________________ SocketTests.testDoubleAccountDelay _____________________________________________________________________________

self = <tests.testClient.SocketTests testMethod=testDoubleAccountDelay>

    def testDoubleAccountDelay(self):
        self.client.retries = 3
        self.client.timeout = 1
        packet = MockPacket(AccountingRequest)
>       self.assertRaises(Timeout, self.client._SendPacket, packet, 432)

tests/testClient.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyrad/client.py:158: in _SendPacket
    rawreply = self._socket.recv(4096)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def recv(self, buffer):
>       return self.data[:buffer]
E       AttributeError: 'MockSocket' object has no attribute 'data'

tests/mock.py:62: AttributeError
____________________________________________________________________________ SocketTests.testSingleAccountDelay _____________________________________________________________________________

self = <tests.testClient.SocketTests testMethod=testSingleAccountDelay>

    def testSingleAccountDelay(self):
        self.client.retries = 2
        self.client.timeout = 1
        packet = MockPacket(AccountingRequest)
>       self.assertRaises(Timeout, self.client._SendPacket, packet, 432)

tests/testClient.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pyrad/client.py:158: in _SendPacket
    rawreply = self._socket.recv(4096)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def recv(self, buffer):
>       return self.data[:buffer]
E       AttributeError: 'MockSocket' object has no attribute 'data'

tests/mock.py:62: AttributeError
================================================================================== short test summary info ==================================================================================
FAILED tests/testClient.py::SocketTests::testAuthDelay - AttributeError: 'MockSocket' object has no attribute 'data'
FAILED tests/testClient.py::SocketTests::testDoubleAccountDelay - AttributeError: 'MockSocket' object has no attribute 'data'
FAILED tests/testClient.py::SocketTests::testSingleAccountDelay - AttributeError: 'MockSocket' object has no attribute 'data'
=============================================================================== 3 failed, 199 passed in 2.68s ===============================================================================

@kloczek
Copy link

kloczek commented Mar 26, 2024

However looks like those fails are not caused by this PR because tese fails are exactly the same as in my ticket #165

@socketpair
Copy link
Contributor Author

@kloczek would you merge this PR ?

@kloczek
Copy link

kloczek commented Mar 28, 2024

I have no permnission.

@socketpair
Copy link
Contributor Author

@kloczek who has ?

@kloczek
Copy link

kloczek commented Mar 28, 2024

Maintainer

@wichert
Copy link
Collaborator

wichert commented Mar 28, 2024

@GIC-de and @Istvan91 (and technically me, but I haven't maintained pyrad in many years)

@GIC-de GIC-de merged commit 3d9cff1 into pyradius:master Jul 24, 2024
17 checks passed
@socketpair
Copy link
Contributor Author

Huge thanks! Could you please make a new git tag + increment version ?

@GIC-de
Copy link
Collaborator

GIC-de commented Jul 25, 2024

Yes, but I need to run some tests before release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants