pyradius / pyrad

Python RADIUS Implementation
BSD 3-Clause "New" or "Revised" License
294 stars 186 forks source link

Remove support of Python 2.x #181

Closed socketpair closed 3 months ago

socketpair commented 1 year ago

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

socketpair commented 1 year ago

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

socketpair commented 1 year ago

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

socketpair commented 1 year ago

@GIC-de

GIC-de commented 1 year ago

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

socketpair commented 1 year ago

@GIC-de

socketpair commented 9 months ago

@GIC-de please review and merge

socketpair commented 7 months ago

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

kloczek commented 7 months ago

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

kloczek commented 7 months ago

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

Here is pytest output: ```console + 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 = 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 = 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 = 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 commented 7 months ago

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

socketpair commented 7 months ago

@kloczek would you merge this PR ?

kloczek commented 7 months ago

I have no permnission.

socketpair commented 7 months ago

@kloczek who has ?

kloczek commented 7 months ago

Maintainer

wichert commented 7 months ago

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

socketpair commented 3 months ago

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

GIC-de commented 3 months ago

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