From 696d200ad5b5a426610c2296dd4b6218f5a2e17d Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Fri, 7 Jun 2024 08:53:12 +0000
Subject: [PATCH] Resolve L2SS-962

---
 integration/.stestr.conf         |  3 ---
 lofar_station_client/__init__.py | 19 +------------------
 requirements.txt                 |  1 -
 test-requirements.txt            |  1 -
 tox.ini                          |  9 ++++-----
 5 files changed, 5 insertions(+), 28 deletions(-)
 delete mode 100644 integration/.stestr.conf

diff --git a/integration/.stestr.conf b/integration/.stestr.conf
deleted file mode 100644
index f98e465..0000000
--- a/integration/.stestr.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-[DEFAULT]
-test_path=./
-top_dir=./
\ No newline at end of file
diff --git a/lofar_station_client/__init__.py b/lofar_station_client/__init__.py
index 5b9128a..2f77f60 100644
--- a/lofar_station_client/__init__.py
+++ b/lofar_station_client/__init__.py
@@ -1,26 +1,9 @@
-# -*- coding: utf-8 -*-
-
 #  Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
 #  SPDX-License-Identifier: Apache-2.0
 
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
 """Control the code that controls us, the great eyes aimed at the sky!"""
 
-try:
-    from importlib import metadata
-except ImportError:  # for Python<3.8
-    import importlib_metadata as metadata
+from importlib import metadata
 
 from lofar_station_client.requests.prometheus import PrometheusRequests
 
diff --git a/requirements.txt b/requirements.txt
index f827e4c..69edb2d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,4 @@
 # Order does matter
-importlib-metadata>=0.12, <5.0;python_version<"3.8"
 pip>=23.3
 requests>=2.31.0 # Apache 2
 numpy>=1.21.0 # BSD
diff --git a/test-requirements.txt b/test-requirements.txt
index 3802558..5a38a1a 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -4,7 +4,6 @@ flake8>=5.0.0 # MIT
 pylint>=2.15.0 # GPLv2
 autopep8>=1.7.0 # MIT
 coverage!=4.4,>=4.0 # Apache-2.0
-stestr>=2.0.0 # Apache-2.0
 testtools>=2.2.0 # MIT
 testscenarios>=0.5.0 # Apache-2.0/BSD
 pytz>=2022.6 # MIT
diff --git a/tox.ini b/tox.ini
index 5413b95..8932f10 100644
--- a/tox.ini
+++ b/tox.ini
@@ -26,15 +26,15 @@ usedevelop = False
 envdir = {toxworkdir}/linting
 commands =
     pep8: {envpython} -m flake8 --version
-    pep8: {envpython} -m flake8 lofar_station_client tests
+    pep8: {envpython} -m flake8 lofar_station_client tests integration
     black: {envpython} -m black --version
-    black: {envpython} -m black --check --diff .
+    black: {envpython} -m black --check --diff lofar_station_client tests integration
     pylint: {envpython} -m pylint --version
     pylint: {envpython} -m pylint lofar_station_client
     format: {envpython} -m autopep8 -v -aa --in-place --recursive lofar_station_client/
     format: {envpython} -m autopep8 -v -aa --in-place --recursive integration/
     format: {envpython} -m autopep8 -v -aa --in-place --recursive tests/
-    format: {envpython} -m black -v .
+    format: {envpython} -m black -v lofar_station_client tests integration
 
 [testenv:debug]
 commands = {envpython} -m testtools.run {posargs}
@@ -77,8 +77,7 @@ allowlist_externals =
 commands =
     # We need the bash substitutions here
     bash -ec 'pip install --force-reinstall {toxinidir}/dist/*.whl'
-    {envpython} -m stestr run --serial {posargs}
+    {envpython} -m pytest -v --log-level=DEBUG ./
 
 [flake8]
 filename = *.py
-exclude=.tox,.egg-info,dist,_version,build
-- 
GitLab