From 11fdc104bee9af45b1dc94e6124a669c7395f5e9 Mon Sep 17 00:00:00 2001 From: ljwoods2 <145226270+ljwoods2@users.noreply.github.com> Date: Tue, 28 May 2024 03:04:29 -0500 Subject: [PATCH] [WIP] ModuleNotFound Error Fix (#115) * reponame vs packagename fix * added test and tweaked version determination * linting * linting * linting * debugging github actions- is pip installing into correct env within test? * remove redundant tests * Authors + Changelog + Removed unused import --------- Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com> --- AUTHORS.md | 3 +++ CHANGELOG.md | 2 ++ tests/test_output.py | 1 - {{cookiecutter.repo_name}}/pyproject.toml | 6 +++--- .../{{cookiecutter.package_name}}/__init__.py | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index efbcd8cb..ef49a714 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -25,3 +25,6 @@ The rules for this file: - Ian Kenney \<@ianmkenney\> - Rocco Meli \<@RMeli\> - Oliver Beckstein \<@orbeckst\> + +**2024** +- Lawson Woods \<@ljwoods2\> \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 01fda03b..634aba29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,9 +26,11 @@ The rules for this file: - ianmkenney - RMeli - orbeckst +- ljwoods2 ### Added +- Fixed ModuleNotFound after installation (Issue #113, PR #115) - Add black configurartion to `pyproject.toml` (Issue #73, PR #75) - Cookiecutter version dependency (Issue #33, PR #46) - Configuration files for external hooks (PR #9) diff --git a/tests/test_output.py b/tests/test_output.py index 21844bb1..455da983 100644 --- a/tests/test_output.py +++ b/tests/test_output.py @@ -2,7 +2,6 @@ from .utils import CookiecutterMDAKit, DependencyType - class TestAnalysis: @pytest.mark.parametrize("analysis_name", ["", "Press Enter to skip"]) diff --git a/{{cookiecutter.repo_name}}/pyproject.toml b/{{cookiecutter.repo_name}}/pyproject.toml index c224ca96..4a56d365 100644 --- a/{{cookiecutter.repo_name}}/pyproject.toml +++ b/{{cookiecutter.repo_name}}/pyproject.toml @@ -42,13 +42,13 @@ doc = [ # source = "https://github.com/{{cookiecutter.github_url}}" # documentation = "https://{{cookiecutter.repo_name}}.readthedocs.io" -[tool.setuptools] -py-modules = [] +[tool.setuptools.packages.find] +include = ["{{cookiecutter.package_name}}"] [tool.pytest.ini_options] minversion = "6.0" testpaths = [ - "{{cookiecutter.repo_name}}/tests", + "{{cookiecutter.package_name}}/tests", ] [tool.black] diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/__init__.py b/{{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/__init__.py index 370baee4..d71ef92b 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/__init__.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/__init__.py @@ -6,4 +6,4 @@ # Add imports here from importlib.metadata import version -__version__ = version("{{cookiecutter.package_name}}") +__version__ = version("{{cookiecutter.repo_name}}")