From 460a877173c7c54a879ca6184a268cd2b311c399 Mon Sep 17 00:00:00 2001 From: tobyp Date: Mon, 22 Jul 2019 23:51:39 +0200 Subject: [PATCH] Fix packaging bugs (relative imports and install_requires) --- fritzctl/__init__.py | 2 +- fritzctl/ooapi/avm_homeauto.py | 2 +- fritzctl/ooapi/avm_homeplug.py | 2 +- fritzctl/ooapi/general_deviceconfig.py | 2 +- fritzctl/ooapi/general_deviceinfo.py | 2 +- fritzctl/ooapi/general_hosts.py | 2 +- fritzctl/ooapi/general_time.py | 2 +- fritzctl/ooapi/net_wlan_multi.py | 2 +- setup.py | 37 +++++++++++++------------- 9 files changed, 26 insertions(+), 27 deletions(-) diff --git a/fritzctl/__init__.py b/fritzctl/__init__.py index 8ba638f..1fe1461 100644 --- a/fritzctl/__init__.py +++ b/fritzctl/__init__.py @@ -28,4 +28,4 @@ with ``from ... import *``\ , this means that you can access e.g. :py:class:`fritzctl.session.Session()` as :py:class:`fritzctl.Session()`\ . """ -from session import * +from .session import * diff --git a/fritzctl/ooapi/avm_homeauto.py b/fritzctl/ooapi/avm_homeauto.py index 0db1536..1529dc6 100644 --- a/fritzctl/ooapi/avm_homeauto.py +++ b/fritzctl/ooapi/avm_homeauto.py @@ -24,7 +24,7 @@ import sys -import base +from . import base STATE2SwStateEnum = { True:"ON", diff --git a/fritzctl/ooapi/avm_homeplug.py b/fritzctl/ooapi/avm_homeplug.py index b2adf46..cfd569b 100644 --- a/fritzctl/ooapi/avm_homeplug.py +++ b/fritzctl/ooapi/avm_homeplug.py @@ -22,7 +22,7 @@ # # -import base +from . import base class API_avm_homeplug(base.API_base): """ diff --git a/fritzctl/ooapi/general_deviceconfig.py b/fritzctl/ooapi/general_deviceconfig.py index 73a1a6e..97764d4 100644 --- a/fritzctl/ooapi/general_deviceconfig.py +++ b/fritzctl/ooapi/general_deviceconfig.py @@ -25,7 +25,7 @@ import requests from requests.auth import HTTPDigestAuth -import base +from . import base class API_general_deviceconfig(base.API_base): """ diff --git a/fritzctl/ooapi/general_deviceinfo.py b/fritzctl/ooapi/general_deviceinfo.py index cce9607..bf2f410 100644 --- a/fritzctl/ooapi/general_deviceinfo.py +++ b/fritzctl/ooapi/general_deviceinfo.py @@ -26,7 +26,7 @@ _provisioningpattern = re.compile(r"[0-9]{3}\.[0-9]{3}\.[0-9]{3}\.[0-9]{3}") -import base +from . import base class API_general_deviceinfo(base.API_base): """ diff --git a/fritzctl/ooapi/general_hosts.py b/fritzctl/ooapi/general_hosts.py index 2bcbd9d..b561b6b 100644 --- a/fritzctl/ooapi/general_hosts.py +++ b/fritzctl/ooapi/general_hosts.py @@ -22,7 +22,7 @@ # # -import base +from . import base class API_general_hosts(base.API_base): """ diff --git a/fritzctl/ooapi/general_time.py b/fritzctl/ooapi/general_time.py index e119fec..f564f6e 100644 --- a/fritzctl/ooapi/general_time.py +++ b/fritzctl/ooapi/general_time.py @@ -22,7 +22,7 @@ # # -import base +from . import base class API_general_time(base.API_base): """ diff --git a/fritzctl/ooapi/net_wlan_multi.py b/fritzctl/ooapi/net_wlan_multi.py index 6c16904..861cd41 100644 --- a/fritzctl/ooapi/net_wlan_multi.py +++ b/fritzctl/ooapi/net_wlan_multi.py @@ -22,7 +22,7 @@ # # -import base +from . import base KEYLONG = { "wep0":"NewWEPKey0", diff --git a/setup.py b/setup.py index caa5950..40c1287 100644 --- a/setup.py +++ b/setup.py @@ -2,25 +2,25 @@ # -*- coding: utf-8 -*- # # setup.py -# +# # Copyright 2016 notna -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. -# -# +# +# # Distribution command: # sudo python setup.py install sdist bdist register upload @@ -35,55 +35,54 @@ # Fix for very old python versions from https://docs.python.org/2/distutils/setupscript.html#additional-meta-data # patch distutils if it can't cope with the "classifiers" or # "download_url" keywords -from sys import version -if version < '2.2.3': +from sys import version_info +if version_info < (2, 2, 3): from distutils.dist import DistributionMetadata DistributionMetadata.classifiers = None DistributionMetadata.download_url = None try: - longdesc = open("README.txt","r").read() + longdesc = open("README.txt", "r").read() except IOError: print("README.txt not found, using description as longdesc instead") longdesc = "Object oriented TR64 FRITZ!Box Client Library" setup(name='fritzctl', - version="1.0.0a2", + version="1.0.0a3", description="Object oriented TR64 FRITZ!Box Client Library", long_description=longdesc, author="notna", author_email="notna@apparat.org", url="https://pypi.python.org/pypi/fritzctl", - packages=['fritzctl',"fritzctl.ooapi"], - requires=["requests","simpletr64",], + packages=['fritzctl', "fritzctl.ooapi"], + install_requires=["requests", "simpletr64",], provides=["fritzctl"], classifiers=[ "Development Status :: 4 - Beta", - + "Environment :: MacOS X", "Environment :: Win32 (MS Windows)", "Environment :: X11 Applications", - + "Intended Audience :: Developers", - + "License :: OSI Approved", "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", - + "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Operating System :: OS Independent", - + "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2 :: Only", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", - + "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System", "Topic :: System :: Networking", "Topic :: System :: Networking :: Monitoring", - ], )