From 86478126924f3b002f814814546c7b2ab69250db Mon Sep 17 00:00:00 2001 From: Aquila Macedo Date: Sat, 16 Dec 2023 23:28:11 -0300 Subject: [PATCH 1/3] fix: replace deprecated distutils with setuptools Update setup.py from 'distutils' to 'setuptools' due to 'distutils' being deprecated in Python 3.12 Details: https://peps.python.org/pep-0632/ --- requirements-dev.txt | 1 + setup.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d63813a..e8abeb1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,3 +5,4 @@ pre-commit pytest pytest-cov flake8 +setuptools diff --git a/setup.py b/setup.py index eb5c0f5..6280910 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,10 @@ # -*- coding: utf-8 -*- import sys -from distutils.core import setup +try: + from setuptools import setup +except ImportError: + from distutils.core import setup + if sys.version_info >= (3, 0): with open("README.rst", encoding="utf-8") as rfile: From 01944cadab6eb65eae27e261ef86324ba7fa12ba Mon Sep 17 00:00:00 2001 From: Ronald Bister Date: Wed, 29 Jan 2025 22:59:21 +0100 Subject: [PATCH 2/3] fix: added hybrid support for setuptools --- README.rst | 9 +++++---- requirements-dev.txt | 7 +++---- setup.py | 5 +++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 023726f..d4ab112 100644 --- a/README.rst +++ b/README.rst @@ -115,21 +115,22 @@ You can install libnmap via pip: ronald@brouette:~$ pip install python-libnmap -or via git and dist utils (à l’ancienne): +or via git and pip: .. code:: bash ronald@brouette:~$ git clone https://github.com/savon-noir/python-libnmap.git ronald@brouette:~$ cd python-libnmap - ronald@brouette:~$ python setup.py install + ronald@brouette:~$ pip install . -or via git and pip: +or via git and dist utils (à l’ancienne/deprecated): .. code:: bash ronald@brouette:~$ git clone https://github.com/savon-noir/python-libnmap.git ronald@brouette:~$ cd python-libnmap - ronald@brouette:~$ pip install . + ronald@brouette:~$ python setup.py install + Examples -------- diff --git a/requirements-dev.txt b/requirements-dev.txt index e8abeb1..cb383eb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,7 @@ -black==22.8.0 -defusedxml==0.6.0 -isort==5.6.4 +black==24.3.0 +defusedxml==0.7.1 +isort==6.0.0 pre-commit pytest pytest-cov flake8 -setuptools diff --git a/setup.py b/setup.py index 6280910..bd35ab1 100644 --- a/setup.py +++ b/setup.py @@ -5,11 +5,10 @@ except ImportError: from distutils.core import setup - if sys.version_info >= (3, 0): with open("README.rst", encoding="utf-8") as rfile: long_description = rfile.read() -else: # encoding not compatible with python2 +else: # if encoding not compatible with python2 with open("README.rst") as rfile: long_description = rfile.read() @@ -42,6 +41,8 @@ "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", "Topic :: System :: Networking", ], ) From f9887fc9add90e2e0b3c59671ec5ecd9bee8fcd3 Mon Sep 17 00:00:00 2001 From: Ronald Bister Date: Wed, 29 Jan 2025 23:07:53 +0100 Subject: [PATCH 3/3] fix: linting --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index bd35ab1..1ff64c0 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- import sys + try: from setuptools import setup except ImportError: