From f38c9d41a830d9f2a4dab2324679c32bf18d8478 Mon Sep 17 00:00:00 2001 From: Engelbert Tijskens Date: Mon, 11 Nov 2019 09:54:39 +0100 Subject: [PATCH] fixed issue #12 --- HISTORY.rst | 6 ++++++ micc.json | 5 ++++- micc/micc.json | 4 ++++ ...ookiecutter.cli_app_name}}.{{cookiecutter.py}}} | 0 ...ookiecutter.cli_app_name}}.{{cookiecutter.py}}} | 0 ...ookiecutter.cli_app_name}}.{{cookiecutter.py}}} | 0 ...ookiecutter.cli_app_name}}.{{cookiecutter.py}}} | 0 ...cookiecutter.module_name}}.{{cookiecutter.py}}} | 0 ...cookiecutter.module_name}}.{{cookiecutter.py}}} | 0 ...cookiecutter.module_name}}.{{cookiecutter.py}}} | 0 ...cookiecutter.module_name}}.{{cookiecutter.py}}} | 0 ...ect.py => post_gen_project.{{cookiecutter.py}}} | 0 ...ject.py => pre_gen_project.{{cookiecutter.py}}} | 0 .../{__init__.py => __init__.{{cookiecutter.py}}} | 0 ...ookiecutter.package_name}}.{{cookiecutter.py}}} | 0 ...ect.py => post_gen_project.{{cookiecutter.py}}} | 0 ...ject.py => pre_gen_project.{{cookiecutter.py}}} | 0 ...ect.py => post_gen_project.{{cookiecutter.py}}} | 0 ...ject.py => pre_gen_project.{{cookiecutter.py}}} | 0 .../{__init__.py => __init__.{{cookiecutter.py}}} | 0 ...ect.py => post_gen_project.{{cookiecutter.py}}} | 0 ...ject.py => pre_gen_project.{{cookiecutter.py}}} | 0 .../docs/{conf.py => conf.{{cookiecutter.py}}} | 0 ...ect.py => post_gen_project.{{cookiecutter.py}}} | 0 ...ject.py => pre_gen_project.{{cookiecutter.py}}} | 0 ...ookiecutter.package_name}}.{{cookiecutter.py}}} | 4 ++-- micc_custom_build.py | 14 ++++++++++++++ pyproject.toml | 6 ++++++ 28 files changed, 36 insertions(+), 3 deletions(-) rename micc/templates/app-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/{test_{{cookiecutter.cli_app_name}}.py => test_{{cookiecutter.cli_app_name}}.{{cookiecutter.py}}} (100%) rename micc/templates/app-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{{cookiecutter.cli_app_name}}.py => {{cookiecutter.cli_app_name}}.{{cookiecutter.py}}} (100%) rename micc/templates/app-sub-commands/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/{test_{{cookiecutter.cli_app_name}}.py => test_{{cookiecutter.cli_app_name}}.{{cookiecutter.py}}} (100%) rename micc/templates/app-sub-commands/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{{cookiecutter.cli_app_name}}.py => {{cookiecutter.cli_app_name}}.{{cookiecutter.py}}} (100%) rename micc/templates/module-cpp/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/{test_cpp_{{cookiecutter.module_name}}.py => test_cpp_{{cookiecutter.module_name}}.{{cookiecutter.py}}} (100%) rename micc/templates/module-f2py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/{test_f2py_{{cookiecutter.module_name}}.py => test_f2py_{{cookiecutter.module_name}}.{{cookiecutter.py}}} (100%) rename micc/templates/module-py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/{test_{{cookiecutter.module_name}}.py => test_{{cookiecutter.module_name}}.{{cookiecutter.py}}} (100%) rename micc/templates/module-py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{{cookiecutter.module_name}}.py => {{cookiecutter.module_name}}.{{cookiecutter.py}}} (100%) rename micc/templates/package-base/hooks/{post_gen_project.py => post_gen_project.{{cookiecutter.py}}} (100%) rename micc/templates/package-base/hooks/{pre_gen_project.py => pre_gen_project.{{cookiecutter.py}}} (100%) rename micc/templates/package-base/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/{__init__.py => __init__.{{cookiecutter.py}}} (100%) rename micc/templates/package-base/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/{test_{{cookiecutter.package_name}}.py => test_{{cookiecutter.package_name}}.{{cookiecutter.py}}} (100%) rename micc/templates/package-general-docs/hooks/{post_gen_project.py => post_gen_project.{{cookiecutter.py}}} (100%) rename micc/templates/package-general-docs/hooks/{pre_gen_project.py => pre_gen_project.{{cookiecutter.py}}} (100%) rename micc/templates/package-general/hooks/{post_gen_project.py => post_gen_project.{{cookiecutter.py}}} (100%) rename micc/templates/package-general/hooks/{pre_gen_project.py => pre_gen_project.{{cookiecutter.py}}} (100%) rename micc/templates/package-general/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{__init__.py => __init__.{{cookiecutter.py}}} (100%) rename micc/templates/package-simple-docs/hooks/{post_gen_project.py => post_gen_project.{{cookiecutter.py}}} (100%) rename micc/templates/package-simple-docs/hooks/{pre_gen_project.py => pre_gen_project.{{cookiecutter.py}}} (100%) rename micc/templates/package-simple-docs/{{cookiecutter.project_name}}/docs/{conf.py => conf.{{cookiecutter.py}}} (100%) rename micc/templates/package-simple/hooks/{post_gen_project.py => post_gen_project.{{cookiecutter.py}}} (100%) rename micc/templates/package-simple/hooks/{pre_gen_project.py => pre_gen_project.{{cookiecutter.py}}} (100%) rename micc/templates/package-simple/{{cookiecutter.project_name}}/{{{cookiecutter.package_name}}.py => {{cookiecutter.package_name}}.{{cookiecutter.py}}} (97%) create mode 100644 micc_custom_build.py diff --git a/HISTORY.rst b/HISTORY.rst index a6fe1e6..ed6c390 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,9 +1,15 @@ This section summarizes all my steps on the way to a working micc, including dead-ends. + + issue: micc is no longer compatible with itself: `micc add foo --f2py` fails. That is of course only a problem for myself. +v0.7.5 (2019-11-11) +=================== +* fixed `Github issue #12 `_ + v0.7.4 (2019-10-23) =================== * `Github issue #3 `_ diff --git a/micc.json b/micc.json index f1400d7..2ef0c20 100644 --- a/micc.json +++ b/micc.json @@ -50,5 +50,8 @@ }, "cookiecutter" : {"default": "~/software/dev/workspace/micc/cookiecutter-mypackage" ,"text" :"location of the cookiecutter template" - } + }, + "py" : {"default":"py" + ,"text" :"python file extension" + } } \ No newline at end of file diff --git a/micc/micc.json b/micc/micc.json index 7f4a227..506abc7 100644 --- a/micc/micc.json +++ b/micc/micc.json @@ -26,4 +26,8 @@ ,"type" :"click.Choice(['MIT license', 'BSD license', 'ISC license', 'Apache Software License 2.0', 'GNU General Public License v3', 'Not open source'])" ,"text" :"Choose open source license" } +, "py" + : {"default":"py" + ,"text" :"python file extension" + } } \ No newline at end of file diff --git a/micc/templates/app-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.cli_app_name}}.py b/micc/templates/app-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.cli_app_name}}.{{cookiecutter.py}} similarity index 100% rename from micc/templates/app-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.cli_app_name}}.py rename to micc/templates/app-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.cli_app_name}}.{{cookiecutter.py}} diff --git a/micc/templates/app-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{cookiecutter.cli_app_name}}.py b/micc/templates/app-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{cookiecutter.cli_app_name}}.{{cookiecutter.py}} similarity index 100% rename from micc/templates/app-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{cookiecutter.cli_app_name}}.py rename to micc/templates/app-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{cookiecutter.cli_app_name}}.{{cookiecutter.py}} diff --git a/micc/templates/app-sub-commands/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.cli_app_name}}.py b/micc/templates/app-sub-commands/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.cli_app_name}}.{{cookiecutter.py}} similarity index 100% rename from micc/templates/app-sub-commands/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.cli_app_name}}.py rename to micc/templates/app-sub-commands/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.cli_app_name}}.{{cookiecutter.py}} diff --git a/micc/templates/app-sub-commands/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{cookiecutter.cli_app_name}}.py b/micc/templates/app-sub-commands/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{cookiecutter.cli_app_name}}.{{cookiecutter.py}} similarity index 100% rename from micc/templates/app-sub-commands/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{cookiecutter.cli_app_name}}.py rename to micc/templates/app-sub-commands/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{cookiecutter.cli_app_name}}.{{cookiecutter.py}} diff --git a/micc/templates/module-cpp/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_cpp_{{cookiecutter.module_name}}.py b/micc/templates/module-cpp/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_cpp_{{cookiecutter.module_name}}.{{cookiecutter.py}} similarity index 100% rename from micc/templates/module-cpp/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_cpp_{{cookiecutter.module_name}}.py rename to micc/templates/module-cpp/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_cpp_{{cookiecutter.module_name}}.{{cookiecutter.py}} diff --git a/micc/templates/module-f2py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_f2py_{{cookiecutter.module_name}}.py b/micc/templates/module-f2py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_f2py_{{cookiecutter.module_name}}.{{cookiecutter.py}} similarity index 100% rename from micc/templates/module-f2py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_f2py_{{cookiecutter.module_name}}.py rename to micc/templates/module-f2py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_f2py_{{cookiecutter.module_name}}.{{cookiecutter.py}} diff --git a/micc/templates/module-py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.module_name}}.py b/micc/templates/module-py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.module_name}}.{{cookiecutter.py}} similarity index 100% rename from micc/templates/module-py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.module_name}}.py rename to micc/templates/module-py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.module_name}}.{{cookiecutter.py}} diff --git a/micc/templates/module-py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{cookiecutter.module_name}}.py b/micc/templates/module-py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{cookiecutter.module_name}}.{{cookiecutter.py}} similarity index 100% rename from micc/templates/module-py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{cookiecutter.module_name}}.py rename to micc/templates/module-py/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/{{cookiecutter.module_name}}.{{cookiecutter.py}} diff --git a/micc/templates/package-base/hooks/post_gen_project.py b/micc/templates/package-base/hooks/post_gen_project.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-base/hooks/post_gen_project.py rename to micc/templates/package-base/hooks/post_gen_project.{{cookiecutter.py}} diff --git a/micc/templates/package-base/hooks/pre_gen_project.py b/micc/templates/package-base/hooks/pre_gen_project.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-base/hooks/pre_gen_project.py rename to micc/templates/package-base/hooks/pre_gen_project.{{cookiecutter.py}} diff --git a/micc/templates/package-base/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/__init__.py b/micc/templates/package-base/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/__init__.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-base/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/__init__.py rename to micc/templates/package-base/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/__init__.{{cookiecutter.py}} diff --git a/micc/templates/package-base/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.package_name}}.py b/micc/templates/package-base/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.package_name}}.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-base/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.package_name}}.py rename to micc/templates/package-base/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/tests/test_{{cookiecutter.package_name}}.{{cookiecutter.py}} diff --git a/micc/templates/package-general-docs/hooks/post_gen_project.py b/micc/templates/package-general-docs/hooks/post_gen_project.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-general-docs/hooks/post_gen_project.py rename to micc/templates/package-general-docs/hooks/post_gen_project.{{cookiecutter.py}} diff --git a/micc/templates/package-general-docs/hooks/pre_gen_project.py b/micc/templates/package-general-docs/hooks/pre_gen_project.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-general-docs/hooks/pre_gen_project.py rename to micc/templates/package-general-docs/hooks/pre_gen_project.{{cookiecutter.py}} diff --git a/micc/templates/package-general/hooks/post_gen_project.py b/micc/templates/package-general/hooks/post_gen_project.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-general/hooks/post_gen_project.py rename to micc/templates/package-general/hooks/post_gen_project.{{cookiecutter.py}} diff --git a/micc/templates/package-general/hooks/pre_gen_project.py b/micc/templates/package-general/hooks/pre_gen_project.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-general/hooks/pre_gen_project.py rename to micc/templates/package-general/hooks/pre_gen_project.{{cookiecutter.py}} diff --git a/micc/templates/package-general/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/__init__.py b/micc/templates/package-general/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/__init__.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-general/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/__init__.py rename to micc/templates/package-general/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}/__init__.{{cookiecutter.py}} diff --git a/micc/templates/package-simple-docs/hooks/post_gen_project.py b/micc/templates/package-simple-docs/hooks/post_gen_project.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-simple-docs/hooks/post_gen_project.py rename to micc/templates/package-simple-docs/hooks/post_gen_project.{{cookiecutter.py}} diff --git a/micc/templates/package-simple-docs/hooks/pre_gen_project.py b/micc/templates/package-simple-docs/hooks/pre_gen_project.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-simple-docs/hooks/pre_gen_project.py rename to micc/templates/package-simple-docs/hooks/pre_gen_project.{{cookiecutter.py}} diff --git a/micc/templates/package-simple-docs/{{cookiecutter.project_name}}/docs/conf.py b/micc/templates/package-simple-docs/{{cookiecutter.project_name}}/docs/conf.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-simple-docs/{{cookiecutter.project_name}}/docs/conf.py rename to micc/templates/package-simple-docs/{{cookiecutter.project_name}}/docs/conf.{{cookiecutter.py}} diff --git a/micc/templates/package-simple/hooks/post_gen_project.py b/micc/templates/package-simple/hooks/post_gen_project.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-simple/hooks/post_gen_project.py rename to micc/templates/package-simple/hooks/post_gen_project.{{cookiecutter.py}} diff --git a/micc/templates/package-simple/hooks/pre_gen_project.py b/micc/templates/package-simple/hooks/pre_gen_project.{{cookiecutter.py}} similarity index 100% rename from micc/templates/package-simple/hooks/pre_gen_project.py rename to micc/templates/package-simple/hooks/pre_gen_project.{{cookiecutter.py}} diff --git a/micc/templates/package-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}.py b/micc/templates/package-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}.{{cookiecutter.py}} similarity index 97% rename from micc/templates/package-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}.py rename to micc/templates/package-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}.{{cookiecutter.py}} index b538f2e..5dbb3ab 100644 --- a/micc/templates/package-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}.py +++ b/micc/templates/package-simple/{{cookiecutter.project_name}}/{{cookiecutter.package_name}}.{{cookiecutter.py}} @@ -10,11 +10,11 @@ def hello(who='world'): """'Hello world' method. - + :param str who: whom to say hello to :returns: a string """ result = "Hello " + who return result -# eof \ No newline at end of file +# eof diff --git a/micc_custom_build.py b/micc_custom_build.py new file mode 100644 index 0000000..6af775f --- /dev/null +++ b/micc_custom_build.py @@ -0,0 +1,14 @@ +from pathlib import Path +#if there is a custom build step the wheel tags are specific. + +def build(setup_kwargs): + + print('hello') + for k,v in setup_kwargs.items(): + print(k,':',v) + d = Path.cwd() / 'micc' + glob = d.glob('*') + for v in glob: + print(v) +# raise Exception(f"cwd = {Path.cwd()}\n{glob}") + return 0 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 85cde38..c203e33 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,12 @@ homepage = "https://github.com/etijskens/micc" keywords = ['packaging', 'poetry'] +# packages = [ +# { include = "micc" }, +# ] +#include = ["templates/**/*"] +build = "micc_custom_build.py" + [tool.poetry.dependencies] python = "^3.7" click = "^7.0"