From 34cd5aeec3c98a094f1686c316a5c5634c2bce82 Mon Sep 17 00:00:00 2001 From: Lukas Garberg Date: Thu, 2 Nov 2023 09:26:40 +0100 Subject: [PATCH] pynipap: Drop Python 2 support As all NIPAP components now are Python 3, let's finally drop Python 2 support for pynipap to simplify project maintenance. --- .github/workflows/ci.yml | 1 - pynipap/debian/control | 17 +++-------------- pynipap/debian/rules | 2 +- pynipap/pynipap.py | 6 +----- pynipap/setup.py | 3 +-- 5 files changed, 6 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87c19c43a..3bd0d87cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,7 +89,6 @@ jobs: sudo nipap/nipap-passwd add -u unittest -p gottatest -n unittest sudo nipap/nipap-passwd add -u readonly -p gottatest --readonly -n "Read-only user for running unit tests" # install pynipap - cd pynipap; sudo python setup.py install; cd .. cd pynipap; sudo python3 setup.py install; cd .. # install nipap-cli dependencies sudo -H pip3 install -r nipap-cli/requirements.txt diff --git a/pynipap/debian/control b/pynipap/debian/control index 889dea362..14d9cd0c0 100644 --- a/pynipap/debian/control +++ b/pynipap/debian/control @@ -3,24 +3,13 @@ Maintainer: Lukas Garberg Section: python Priority: optional Build-Depends: debhelper (>= 8), dh-python, - python (>= 2.7) | python2 (>= 2.7), - python3 (>= 3.1) -X-Python-Version: >= 2.7 -X-Python3-Version: >= 3.1 + python3 (>= 3.6) +X-Python3-Version: >= 3.6 Standards-Version: 4.4.0 -Package: python-pynipap -Architecture: all -Depends: ${misc:Depends}, python (>= 2.7) | python2 (>= 2.7) -Breaks: ${python:Breaks} -Description: Python module for accessing NIPAP - This package contains a client library for NIPAP. It's function is similar to - a simple ORM, which hides much of the complexity of working directly against - the XML-RPC interface. - Package: python3-pynipap Architecture: all -Depends: ${misc:Depends}, python3 (>= 3.1) +Depends: ${misc:Depends}, python3 (>= 3.6) Breaks: ${python3:Breaks} Description: Python 3 module for accessing NIPAP This package contains a client library for NIPAP. It's function is similar to diff --git a/pynipap/debian/rules b/pynipap/debian/rules index 40432c6f5..6cc1549fb 100755 --- a/pynipap/debian/rules +++ b/pynipap/debian/rules @@ -3,4 +3,4 @@ export DH_VERBOSE=1 export PYBUILD_NAME=pynipap %: - dh $@ --with python2,python3 --buildsystem=pybuild + dh $@ --with python3 --buildsystem=pybuild diff --git a/pynipap/pynipap.py b/pynipap/pynipap.py index d45c8870f..80bc01f47 100644 --- a/pynipap/pynipap.py +++ b/pynipap/pynipap.py @@ -206,11 +206,7 @@ """ import sys import logging -if sys.version_info[0] < 3: - import xmlrpclib - int = long -else: - import xmlrpc.client as xmlrpclib +import xmlrpc.client as xmlrpclib __version__ = "0.32.1" __author__ = "Kristian Larsson, Lukas Garberg" diff --git a/pynipap/setup.py b/pynipap/setup.py index a37ac6e71..c1a5753c1 100644 --- a/pynipap/setup.py +++ b/pynipap/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from distutils.core import setup import sys @@ -26,7 +26,6 @@ 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware' ]