Skip to content

Commit

Permalink
Drop support of Python<3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
acutaia committed Jan 9, 2020
1 parent d499288 commit b7e8496
Show file tree
Hide file tree
Showing 49 changed files with 50 additions and 67 deletions.
2 changes: 1 addition & 1 deletion pelix/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Pelix root package
Expand Down
11 changes: 4 additions & 7 deletions pelix/http/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Pelix HTTP package.
Expand Down Expand Up @@ -27,12 +27,9 @@
limitations under the License.
"""

# Standard typing module should be optional
try:
# pylint: disable=W0611
from typing import Any, ByteString, Dict, Iterable, IO, Tuple
except ImportError:
pass
# pylint: disable=W0611
from typing import Any, ByteString, Dict, Iterable, IO, Tuple


# Pelix utility methods
from pelix.utilities import to_bytes
Expand Down
2 changes: 1 addition & 1 deletion pelix/internals/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Pelix framework internals beans package
Expand Down
2 changes: 1 addition & 1 deletion pelix/ipopo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
iPOPO package
Expand Down
2 changes: 1 addition & 1 deletion pelix/ipopo/handlers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
iPOPO featured handlers package
Expand Down
2 changes: 1 addition & 1 deletion pelix/misc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Pelix miscellaneous modules
Expand Down
2 changes: 1 addition & 1 deletion pelix/remote/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Pelix remote services package
Expand Down
5 changes: 2 additions & 3 deletions pelix/remote/beans.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@


# Pelix
from pelix.utilities import is_string
import pelix.constants
import pelix.framework
import pelix.ldapfilter
Expand Down Expand Up @@ -95,7 +94,7 @@ def __init__(
self.__properties = {}

# Normalize the list of configurations
if is_string(configurations):
if isinstance(configurations, str):
self.__configurations = (configurations,)
else:
self.__configurations = tuple(configurations)
Expand Down Expand Up @@ -273,7 +272,7 @@ def __init__(
self.__properties = properties.copy() if properties else {}

# Normalize list of configurations
if is_string(configurations):
if isinstance(configurations, str):
tuple_conf = (configurations,) # type: Tuple[str, ...]
else:
tuple_conf = tuple(configurations)
Expand Down
2 changes: 1 addition & 1 deletion pelix/remote/discovery/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Pelix remote services discovery package
Expand Down
3 changes: 0 additions & 3 deletions pelix/remote/discovery/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
limitations under the License.
"""

# Ensure that the redis package is imported and not this module
from __future__ import absolute_import

# Standard library
import logging
import math
Expand Down
2 changes: 1 addition & 1 deletion pelix/remote/transport/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Pelix remote services transports package
Expand Down
2 changes: 1 addition & 1 deletion pelix/rsa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
"""
RemoteServiceAdmin constants and utility functions
Expand Down
2 changes: 1 addition & 1 deletion pelix/rsa/providers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
"""
Constants needed for all discovery and distribution providers
Expand Down
2 changes: 1 addition & 1 deletion pelix/rsa/providers/discovery/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
"""
Expand Down
7 changes: 2 additions & 5 deletions pelix/rsa/providers/distribution/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
"""
Expand Down Expand Up @@ -41,10 +41,7 @@
)

# Typing
try:
from typing import Any, Dict, List, Tuple, Optional, Callable
except ImportError:
pass
from typing import Any, Dict, List, Tuple, Optional, Callable

from pelix.rsa import ImportRegistration

Expand Down
7 changes: 2 additions & 5 deletions pelix/rsa/topologymanagers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
"""
Expand Down Expand Up @@ -27,11 +27,8 @@
"""

import logging
from typing import Any, Dict

try:
from typing import Any, Dict
except ImportError:
pass

from pelix.framework import ServiceEvent, ServiceReference, BundleContext
from pelix.internals.hooks import EventListenerHook
Expand Down
2 changes: 1 addition & 1 deletion pelix/services/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Pelix OSGi-like services packages
Expand Down
2 changes: 1 addition & 1 deletion pelix/shell/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Pelix shell package
Expand Down
2 changes: 1 addition & 1 deletion pelix/shell/completion/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
"""
Pelix shell completion package
Expand Down
1 change: 0 additions & 1 deletion pelix/shell/completion/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"""

# Standard library
from __future__ import absolute_import
import logging
import readline
# pylint: disable=W0611
Expand Down
1 change: 0 additions & 1 deletion pelix/shell/completion/ipopo.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
limitations under the License.
"""

from __future__ import absolute_import
import readline
# pylint: disable=W0611
from typing import List
Expand Down
1 change: 0 additions & 1 deletion pelix/shell/completion/pelix.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
limitations under the License.
"""

from __future__ import absolute_import
import readline
# pylint: disable=W0611
from typing import List
Expand Down
1 change: 0 additions & 1 deletion pelix/shell/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
limitations under the License.
"""

from __future__ import print_function

# Standard library
from select import select
Expand Down
2 changes: 1 addition & 1 deletion samples/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Package containing samples for the iPOPO documentation
Expand Down
2 changes: 1 addition & 1 deletion samples/handler/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
iPOPO handler sample package: contains the definition of the logger handler
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Test package for Pelix
Expand Down
2 changes: 1 addition & 1 deletion tests/framework/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Test package for the Pelix framework
Expand Down
2 changes: 1 addition & 1 deletion tests/framework/vault/pkg_fail/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
2 changes: 1 addition & 1 deletion tests/framework/vault/pkg_fail/invalid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --

raise ImportError("Invalid bundle")
2 changes: 1 addition & 1 deletion tests/framework/vault/pkg_fail/pkg2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
2 changes: 1 addition & 1 deletion tests/framework/vault/pkg_fail/pkg2/invalid.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --

raise ImportError("Invalid bundle")
2 changes: 1 addition & 1 deletion tests/framework/vault/pkg_fail/pkg2/valid1.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
2 changes: 1 addition & 1 deletion tests/framework/vault/pkg_fail/pkg2/valid2.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
2 changes: 1 addition & 1 deletion tests/framework/vault/pkg_fail/valid1.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
2 changes: 1 addition & 1 deletion tests/framework/vault/pkg_fail/valid2.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
2 changes: 1 addition & 1 deletion tests/framework/vault/pkg_invalid/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --

raise ImportError("Invalid package")
2 changes: 1 addition & 1 deletion tests/framework/vault/pkg_ok/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
2 changes: 1 addition & 1 deletion tests/framework/vault/pkg_ok/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --

raise ImportError("I shouldn't be imported")
2 changes: 1 addition & 1 deletion tests/framework/vault/pkg_ok/pkg2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/python
#!/usr/bin/python3
# -- Content-Encoding: UTF-8 --
2 changes: 1 addition & 1 deletion tests/http/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Test package for the Pelix HTTP Service
Expand Down
2 changes: 1 addition & 1 deletion tests/http/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Pelix basic HTTP service test module.
Expand Down
2 changes: 1 addition & 1 deletion tests/http/test_basic_ssl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Pelix basic HTTP service test module.
Expand Down
2 changes: 1 addition & 1 deletion tests/ipopo/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Test package for iPOPO
Expand Down
2 changes: 1 addition & 1 deletion tests/ipopo/test_validate_component.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Tests the component life cycle callbacks decorators
Expand Down
2 changes: 1 addition & 1 deletion tests/misc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Test package for the Pelix miscellaneous modules
Expand Down
2 changes: 1 addition & 1 deletion tests/misc/test_jabsorb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Tests the Jabsorb conversion module
Expand Down
2 changes: 1 addition & 1 deletion tests/remote/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Test package for the Pelix Remote Services
Expand Down
2 changes: 1 addition & 1 deletion tests/services/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Test package for the Pelix featured services
Expand Down
2 changes: 1 addition & 1 deletion tests/shell/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# -- Content-Encoding: UTF-8 --
"""
Test package for the Pelix Shell Service
Expand Down

0 comments on commit b7e8496

Please sign in to comment.