From 44a11699c1125264ff90c3a6f91eb207f0fcfdf2 Mon Sep 17 00:00:00 2001 From: Philip Boadu Asare Date: Wed, 18 Oct 2023 13:39:05 +0200 Subject: [PATCH 1/2] Restructure python modules --- python/__pycache__/refresh_view.cpython-310.pyc | Bin 343 -> 0 bytes .../__pycache__/refresh_view_test.cpython-310.pyc | Bin 656 -> 0 bytes python/lib/__init__.py | 0 python/{ => lib}/refresh_view.py | 0 python/{ => scripts}/ci.sh | 0 python/{ => test/unit}/refresh_view_test.py | 8 ++++---- 6 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 python/__pycache__/refresh_view.cpython-310.pyc delete mode 100644 python/__pycache__/refresh_view_test.cpython-310.pyc create mode 100644 python/lib/__init__.py rename python/{ => lib}/refresh_view.py (100%) rename python/{ => scripts}/ci.sh (100%) rename python/{ => test/unit}/refresh_view_test.py (74%) diff --git a/python/__pycache__/refresh_view.cpython-310.pyc b/python/__pycache__/refresh_view.cpython-310.pyc deleted file mode 100644 index 46730cfccd8e663342ce71265ba5be31717eb34d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 343 zcmYjN!Ab)$5Y04=EwY7vfQR)|7OD%LJctNh#6u}~^HR!YYL<J-Pmcc$WUs zUj2)noU{o0VBWk*-pr7g(dd*BekMEFQ2q@?7dd;i18Qxi@gB|-Xhmi7(v#q|GCO7kt=(Uz))=3Xzqm?$=(o$PKzp%TmzmE^>C$TB zl_^t;D~nDo-g2xjt4%9Z7#<$%PKd@Zh6wC{RrV2QD2JhL9Z_jaZ`J{|$t_ZRo(QULtmVrYtr3v%~?f&n8MDE4nr zh`yGE#0cR^-3kHk!AKL`fr(IF#kW!M01u2>Nc$Y+Hrat7glX?t{F4x2GUGTjNyP=Z zdrSd=Sqf={k#|r;CYnN~!lO^<{M6gJ{rnMq)fqP<@qdl;n0!p`PAPnYEqJjdm>mJ_ zB*_2*iY7sgD{ODlOKh6%xT1GYZku$VtK#4$U$Hd%Oot`@s1NnMSsGW z%d&2@&JIK5HqP=SL$Ypb&*ULq(b#=ZtI}5?VTI$8hQ(<1h+7r^J|JTb%Zwp;v)A~R T7vvsNNCZD4c_NcI73%jNRgs_* diff --git a/python/lib/__init__.py b/python/lib/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python/refresh_view.py b/python/lib/refresh_view.py similarity index 100% rename from python/refresh_view.py rename to python/lib/refresh_view.py diff --git a/python/ci.sh b/python/scripts/ci.sh similarity index 100% rename from python/ci.sh rename to python/scripts/ci.sh diff --git a/python/refresh_view_test.py b/python/test/unit/refresh_view_test.py similarity index 74% rename from python/refresh_view_test.py rename to python/test/unit/refresh_view_test.py index 66a1aa4..193e7b2 100644 --- a/python/refresh_view_test.py +++ b/python/test/unit/refresh_view_test.py @@ -1,16 +1,16 @@ -# import function hello from current directory refresh_view.py import sys -import refresh_view import unittest +from python.python_functions import refresh_view + print(sys.path) + class TestStringMethods(unittest.TestCase): def test_hello(self): self.assertEqual(refresh_view.hello('Chen'), 'Hello, Chen!') + # run test if __name__ == '__main__': unittest.main() - - From 86ad14b83b62385f6f9fddb4f0c9615b00b9d35c Mon Sep 17 00:00:00 2001 From: Philip Boadu Asare Date: Wed, 18 Oct 2023 13:41:59 +0200 Subject: [PATCH 2/2] Add setup.py file --- python/{lib => python_functions}/__init__.py | 0 python/{lib => python_functions}/refresh_view.py | 0 setup.py | 10 ++++++++++ 3 files changed, 10 insertions(+) rename python/{lib => python_functions}/__init__.py (100%) rename python/{lib => python_functions}/refresh_view.py (100%) create mode 100644 setup.py diff --git a/python/lib/__init__.py b/python/python_functions/__init__.py similarity index 100% rename from python/lib/__init__.py rename to python/python_functions/__init__.py diff --git a/python/lib/refresh_view.py b/python/python_functions/refresh_view.py similarity index 100% rename from python/lib/refresh_view.py rename to python/python_functions/refresh_view.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..75d049e --- /dev/null +++ b/setup.py @@ -0,0 +1,10 @@ +from setuptools import setup + +setup( + name='python_functions', + version='1.0', + description='Functions to be used in treetracker DAG', + packages=['python_functions'], + package_dir={'python_functions':'python/python_functions'}, + scripts=['python/scripts/ci.sh'], +)