From e749dd28995abd74a557fe766e32cdfe02ea9dbc Mon Sep 17 00:00:00 2001 From: yucongalicechen Date: Mon, 9 Sep 2024 13:32:42 -0400 Subject: [PATCH 1/6] move tests folder at the root --- {src/diffpy/labpdfproc/tests => tests}/__init__.py | 0 {src/diffpy/labpdfproc/tests => tests}/conftest.py | 0 {src/diffpy/labpdfproc/tests => tests}/debug.py | 0 {src/diffpy/labpdfproc/tests => tests}/run.py | 0 {src/diffpy/labpdfproc/tests => tests}/test_example.py | 0 {src/diffpy/labpdfproc/tests => tests}/test_fixtures.py | 0 {src/diffpy/labpdfproc/tests => tests}/test_functions.py | 0 {src/diffpy/labpdfproc/tests => tests}/test_tools.py | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename {src/diffpy/labpdfproc/tests => tests}/__init__.py (100%) rename {src/diffpy/labpdfproc/tests => tests}/conftest.py (100%) rename {src/diffpy/labpdfproc/tests => tests}/debug.py (100%) rename {src/diffpy/labpdfproc/tests => tests}/run.py (100%) rename {src/diffpy/labpdfproc/tests => tests}/test_example.py (100%) rename {src/diffpy/labpdfproc/tests => tests}/test_fixtures.py (100%) rename {src/diffpy/labpdfproc/tests => tests}/test_functions.py (100%) rename {src/diffpy/labpdfproc/tests => tests}/test_tools.py (100%) diff --git a/src/diffpy/labpdfproc/tests/__init__.py b/tests/__init__.py similarity index 100% rename from src/diffpy/labpdfproc/tests/__init__.py rename to tests/__init__.py diff --git a/src/diffpy/labpdfproc/tests/conftest.py b/tests/conftest.py similarity index 100% rename from src/diffpy/labpdfproc/tests/conftest.py rename to tests/conftest.py diff --git a/src/diffpy/labpdfproc/tests/debug.py b/tests/debug.py similarity index 100% rename from src/diffpy/labpdfproc/tests/debug.py rename to tests/debug.py diff --git a/src/diffpy/labpdfproc/tests/run.py b/tests/run.py similarity index 100% rename from src/diffpy/labpdfproc/tests/run.py rename to tests/run.py diff --git a/src/diffpy/labpdfproc/tests/test_example.py b/tests/test_example.py similarity index 100% rename from src/diffpy/labpdfproc/tests/test_example.py rename to tests/test_example.py diff --git a/src/diffpy/labpdfproc/tests/test_fixtures.py b/tests/test_fixtures.py similarity index 100% rename from src/diffpy/labpdfproc/tests/test_fixtures.py rename to tests/test_fixtures.py diff --git a/src/diffpy/labpdfproc/tests/test_functions.py b/tests/test_functions.py similarity index 100% rename from src/diffpy/labpdfproc/tests/test_functions.py rename to tests/test_functions.py diff --git a/src/diffpy/labpdfproc/tests/test_tools.py b/tests/test_tools.py similarity index 100% rename from src/diffpy/labpdfproc/tests/test_tools.py rename to tests/test_tools.py From 5bb0d12d19b713212a6ccd1fbd6e89ea6e61ebe8 Mon Sep 17 00:00:00 2001 From: yucongalicechen Date: Mon, 9 Sep 2024 13:34:26 -0400 Subject: [PATCH 2/6] remove run.py and debug.py as we dont have unittest --- tests/debug.py | 35 ----------------------------------- tests/run.py | 34 ---------------------------------- 2 files changed, 69 deletions(-) delete mode 100644 tests/debug.py delete mode 100644 tests/run.py diff --git a/tests/debug.py b/tests/debug.py deleted file mode 100644 index 51881b9..0000000 --- a/tests/debug.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# (c) 2024 The Trustees of Columbia University in the City of New York. -# All rights reserved. -# -# File coded by: Billinge Group members and community contributors. -# -# See GitHub contributions for a more detailed list of contributors. -# https://github.com/diffpy/diffpy.labpdfproc/graphs/contributors -# -# See LICENSE.rst for license information. -# -############################################################################## - -""" -Convenience module for debugging the unit tests using - -python -m diffpy.labpdfproc.tests.debug - -Exceptions raised by failed tests or other errors are not caught. -""" - - -if __name__ == "__main__": - import sys - - from diffpy.labpdfproc.tests import testsuite - - pattern = sys.argv[1] if len(sys.argv) > 1 else "" - suite = testsuite(pattern) - suite.debug() - - -# End of file diff --git a/tests/run.py b/tests/run.py deleted file mode 100644 index d11095f..0000000 --- a/tests/run.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python -############################################################################## -# -# (c) 2024 The Trustees of Columbia University in the City of New York. -# All rights reserved. -# -# File coded by: Billinge Group members and community contributors. -# -# See GitHub contributions for a more detailed list of contributors. -# https://github.com/diffpy/diffpy.labpdfproc/graphs/contributors -# -# See LICENSE.rst for license information. -# -############################################################################## -"""Convenience module for executing all unit tests with -python -m diffpy.labpdfproc.tests.run -""" - -import sys - -import pytest - -if __name__ == "__main__": - # show output results from every test function - args = ["-v"] - # show the message output for skipped and expected failure tests - if len(sys.argv) > 1: - args.extend(sys.argv[1:]) - print("pytest arguments: {}".format(args)) - # call pytest and exit with the return code from pytest - exit_res = pytest.main(args) - sys.exit(exit_res) - -# End of file From 0fe1b7e17920527696d69c3cdb2bd21b2f578f32 Mon Sep 17 00:00:00 2001 From: yucongalicechen Date: Mon, 9 Sep 2024 16:14:38 -0400 Subject: [PATCH 3/6] remove test_example as not needed --- tests/test_example.py | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 tests/test_example.py diff --git a/tests/test_example.py b/tests/test_example.py deleted file mode 100644 index 813df60..0000000 --- a/tests/test_example.py +++ /dev/null @@ -1,2 +0,0 @@ -def test_example(): - assert True From c060becc3f0b529511c9023cf71ff488f7d2b7af Mon Sep 17 00:00:00 2001 From: yucongalicechen Date: Mon, 9 Sep 2024 16:25:54 -0400 Subject: [PATCH 4/6] add a line in MANIFEST.in so test functions get access to data --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index a4ceb84..d00e802 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,7 @@ include README.rst include requirements.txt include doc/examples/* +recursive-include src/diffpy/labpdfproc/data * recursive-exclude * __pycache__ recursive-exclude * *.py[co] From f1c6f15bf4fb3746fb96f91e5225f4fb59b1b186 Mon Sep 17 00:00:00 2001 From: yucongalicechen Date: Wed, 11 Sep 2024 15:52:09 -0400 Subject: [PATCH 5/6] add back labpdfproc command --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index bb114ae..841e997 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,9 @@ template = "{tag}" dev_template = "{tag}" dirty_template = "{tag}" +[project.scripts] +labpdfproc = "diffpy.labpdfproc.labpdfprocapp:main" + [tool.setuptools.packages.find] where = ["src"] # list of folders that contain the packages (["."] by default) include = ["*"] # package names should match these glob patterns (["*"] by default) From 79abeb852fab8c9f50c758a2e446c3d397f62c52 Mon Sep 17 00:00:00 2001 From: yucongalicechen Date: Wed, 11 Sep 2024 18:06:25 -0400 Subject: [PATCH 6/6] delete init.py from tests folder --- tests/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29..0000000