From 60f223867a01647134a76d2022c3e2141206f901 Mon Sep 17 00:00:00 2001 From: Mia von Steinkirch Date: Tue, 11 Feb 2020 10:35:33 -0800 Subject: [PATCH] add a few simple boilerplates --- Argparse_app/main.py | 26 +++++++++++++++++ {CLI_app => Click_app}/Makefile | 0 {CLI_app => Click_app}/README.md | 0 {CLI_app => Click_app}/pytest.ini | 0 {CLI_app => Click_app}/requirements.txt | 0 {CLI_app => Click_app}/setup.py | 0 {CLI_app => Click_app}/tests/__init__.py | 0 {CLI_app => Click_app}/yourapp/__init__.py | 0 {CLI_app => Click_app}/yourapp/yourapp.py | 0 Test_Boilerplate/Makefile | 28 +++++++++++++++++++ {Testing => Test_Boilerplate}/README.md | 0 .../requirements.txt | 0 Test_Boilerplate/setup.py | 15 ++++++++++ Test_Boilerplate/tests/example_test.py | 11 ++++++++ {Testing => Test_Boilerplate}/tox.ini | 0 Testing/setup.py | 0 16 files changed, 80 insertions(+) create mode 100644 Argparse_app/main.py rename {CLI_app => Click_app}/Makefile (100%) rename {CLI_app => Click_app}/README.md (100%) rename {CLI_app => Click_app}/pytest.ini (100%) rename {CLI_app => Click_app}/requirements.txt (100%) rename {CLI_app => Click_app}/setup.py (100%) rename {CLI_app => Click_app}/tests/__init__.py (100%) rename {CLI_app => Click_app}/yourapp/__init__.py (100%) rename {CLI_app => Click_app}/yourapp/yourapp.py (100%) create mode 100644 Test_Boilerplate/Makefile rename {Testing => Test_Boilerplate}/README.md (100%) rename {Testing => Test_Boilerplate}/requirements.txt (100%) create mode 100644 Test_Boilerplate/setup.py create mode 100644 Test_Boilerplate/tests/example_test.py rename {Testing => Test_Boilerplate}/tox.ini (100%) delete mode 100644 Testing/setup.py diff --git a/Argparse_app/main.py b/Argparse_app/main.py new file mode 100644 index 0000000..6ea39e3 --- /dev/null +++ b/Argparse_app/main.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +import argparse + + +def main(): + + description = 'Describe what your app does here' + + # Run CLI menu. + parser = argparse.ArgumentParser(description=description) + + group = parser.add_mutually_exclusive_group(required=True) + + group.add_argument('-e', '--encode', type=int, help="some help here") + + group.add_argument('-d', '--decode', help="another help here") + + args = parser.parse_args() + + print(args.encode) + print(args.decode) + + +if __name__ == "__main__": + main() diff --git a/CLI_app/Makefile b/Click_app/Makefile similarity index 100% rename from CLI_app/Makefile rename to Click_app/Makefile diff --git a/CLI_app/README.md b/Click_app/README.md similarity index 100% rename from CLI_app/README.md rename to Click_app/README.md diff --git a/CLI_app/pytest.ini b/Click_app/pytest.ini similarity index 100% rename from CLI_app/pytest.ini rename to Click_app/pytest.ini diff --git a/CLI_app/requirements.txt b/Click_app/requirements.txt similarity index 100% rename from CLI_app/requirements.txt rename to Click_app/requirements.txt diff --git a/CLI_app/setup.py b/Click_app/setup.py similarity index 100% rename from CLI_app/setup.py rename to Click_app/setup.py diff --git a/CLI_app/tests/__init__.py b/Click_app/tests/__init__.py similarity index 100% rename from CLI_app/tests/__init__.py rename to Click_app/tests/__init__.py diff --git a/CLI_app/yourapp/__init__.py b/Click_app/yourapp/__init__.py similarity index 100% rename from CLI_app/yourapp/__init__.py rename to Click_app/yourapp/__init__.py diff --git a/CLI_app/yourapp/yourapp.py b/Click_app/yourapp/yourapp.py similarity index 100% rename from CLI_app/yourapp/yourapp.py rename to Click_app/yourapp/yourapp.py diff --git a/Test_Boilerplate/Makefile b/Test_Boilerplate/Makefile new file mode 100644 index 0000000..86a21d2 --- /dev/null +++ b/Test_Boilerplate/Makefile @@ -0,0 +1,28 @@ +.PHONY: setup install clean test lint + +default: test + +setup: + pip install -r requirements.txt + +install: + python setup.py install + +clean: + @find . -type f -name '*.pyc' -delete + @find . -type d -name '__pycache__' | xargs rm -rf + @find . -type d -name '*.ropeproject' | xargs rm -rf + @rm -rf build/ + @rm -rf dist/ + @rm -rf venv/ + @rm -f src/*.egg* + @rm -f MANIFEST + @rm -rf docs/build/ + @rm -f .coverage.* + +test: + @tox -- -s + +lint: + @tox -e lint + diff --git a/Testing/README.md b/Test_Boilerplate/README.md similarity index 100% rename from Testing/README.md rename to Test_Boilerplate/README.md diff --git a/Testing/requirements.txt b/Test_Boilerplate/requirements.txt similarity index 100% rename from Testing/requirements.txt rename to Test_Boilerplate/requirements.txt diff --git a/Test_Boilerplate/setup.py b/Test_Boilerplate/setup.py new file mode 100644 index 0000000..2de9551 --- /dev/null +++ b/Test_Boilerplate/setup.py @@ -0,0 +1,15 @@ +from setuptools import setup, find_packages + +setup( + name='testing_app_name', + version='0.0.1', + packages=find_packages(), + include_package_data=True, + author='Mia von Steinkirch', + install_requires=[ + ], + entry_points=''' + [console_scripts] + testing_app_name=src.main:main + ''', +) \ No newline at end of file diff --git a/Test_Boilerplate/tests/example_test.py b/Test_Boilerplate/tests/example_test.py new file mode 100644 index 0000000..13218b2 --- /dev/null +++ b/Test_Boilerplate/tests/example_test.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +import unittest + + +class AppNameTest(unittest.TestCase): + def setUp(self): + passd + + def test_something(self): + pass diff --git a/Testing/tox.ini b/Test_Boilerplate/tox.ini similarity index 100% rename from Testing/tox.ini rename to Test_Boilerplate/tox.ini diff --git a/Testing/setup.py b/Testing/setup.py deleted file mode 100644 index e69de29..0000000