From 7791c720a6080ff83acb1a014b6fd36fdd36a050 Mon Sep 17 00:00:00 2001 From: Leo Singer Date: Sun, 8 Dec 2024 23:05:47 -0500 Subject: [PATCH] Omit tests from installation --- pyproject.toml | 9 +++++---- {gcn_kafka => src/gcn_kafka}/__init__.py | 0 {gcn_kafka => src/gcn_kafka}/core.py | 0 {gcn_kafka => src/gcn_kafka}/env.py | 0 {gcn_kafka => src/gcn_kafka}/oidc.py | 0 {gcn_kafka/test => test}/__init__.py | 0 {gcn_kafka/test => test}/test_core.py | 2 +- {gcn_kafka/test => test}/test_env.py | 2 +- {gcn_kafka/test => test}/test_oidc.py | 2 +- tox.ini | 2 +- 10 files changed, 9 insertions(+), 8 deletions(-) rename {gcn_kafka => src/gcn_kafka}/__init__.py (100%) rename {gcn_kafka => src/gcn_kafka}/core.py (100%) rename {gcn_kafka => src/gcn_kafka}/env.py (100%) rename {gcn_kafka => src/gcn_kafka}/oidc.py (100%) rename {gcn_kafka/test => test}/__init__.py (100%) rename {gcn_kafka/test => test}/test_core.py (95%) rename {gcn_kafka/test => test}/test_env.py (90%) rename {gcn_kafka/test => test}/test_oidc.py (97%) diff --git a/pyproject.toml b/pyproject.toml index 0ac0a49..bd65f04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,8 +34,9 @@ source = "https://github.com/nasa-gcn/gcn-kafka-python" [project.optional-dependencies] test = ["pytest"] -[tool.setuptools.packages.find] -include = ["gcn_kafka"] - [tool.setuptools_scm] -write_to = "gcn_kafka/_version.py" +write_to = "src/gcn_kafka/_version.py" + +[tool.coverage.run] +source = ["test"] +source_pkgs = ["gcn_kafka"] diff --git a/gcn_kafka/__init__.py b/src/gcn_kafka/__init__.py similarity index 100% rename from gcn_kafka/__init__.py rename to src/gcn_kafka/__init__.py diff --git a/gcn_kafka/core.py b/src/gcn_kafka/core.py similarity index 100% rename from gcn_kafka/core.py rename to src/gcn_kafka/core.py diff --git a/gcn_kafka/env.py b/src/gcn_kafka/env.py similarity index 100% rename from gcn_kafka/env.py rename to src/gcn_kafka/env.py diff --git a/gcn_kafka/oidc.py b/src/gcn_kafka/oidc.py similarity index 100% rename from gcn_kafka/oidc.py rename to src/gcn_kafka/oidc.py diff --git a/gcn_kafka/test/__init__.py b/test/__init__.py similarity index 100% rename from gcn_kafka/test/__init__.py rename to test/__init__.py diff --git a/gcn_kafka/test/test_core.py b/test/test_core.py similarity index 95% rename from gcn_kafka/test/test_core.py rename to test/test_core.py index 9fa8d05..a817dfd 100644 --- a/gcn_kafka/test/test_core.py +++ b/test/test_core.py @@ -1,4 +1,4 @@ -from ..core import update_config +from gcn_kafka.core import update_config def test_update_config_no_overwrite(): diff --git a/gcn_kafka/test/test_env.py b/test/test_env.py similarity index 90% rename from gcn_kafka/test/test_env.py rename to test/test_env.py index f15671e..411764a 100644 --- a/gcn_kafka/test/test_env.py +++ b/test/test_env.py @@ -2,7 +2,7 @@ import os -from ..env import config_from_env +from gcn_kafka.env import config_from_env def test_config_from_env(monkeypatch): diff --git a/gcn_kafka/test/test_oidc.py b/test/test_oidc.py similarity index 97% rename from gcn_kafka/test/test_oidc.py rename to test/test_oidc.py index c434847..d33b3ef 100644 --- a/gcn_kafka/test/test_oidc.py +++ b/test/test_oidc.py @@ -1,6 +1,6 @@ from unittest.mock import MagicMock -from .. import oidc +from gcn_kafka import oidc def test_no_oidc(): diff --git a/tox.ini b/tox.ini index c1d054e..e37f515 100644 --- a/tox.ini +++ b/tox.ini @@ -8,4 +8,4 @@ deps = extras = test commands = - pytest gcn_kafka --cov {posargs} + pytest --cov {posargs}