diff --git a/pyproject.toml b/pyproject.toml index 2084e0d..66adafd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,3 +10,7 @@ dependencies = [ "requests>=2.33.1", "simplejson>=3.20.2", ] + +[build-system] +requires = ["uv_build >= 0.10.10, <0.11.0"] +build-backend = "uv_build" \ No newline at end of file diff --git a/trustcafeapiwrapper/__init__.py b/src/trustcafeapiwrapper/__init__.py similarity index 100% rename from trustcafeapiwrapper/__init__.py rename to src/trustcafeapiwrapper/__init__.py diff --git a/trustcafeapiwrapper/apiclient.py b/src/trustcafeapiwrapper/apiclient.py similarity index 100% rename from trustcafeapiwrapper/apiclient.py rename to src/trustcafeapiwrapper/apiclient.py diff --git a/trustcafeapiwrapper/jobs/__init__.py b/src/trustcafeapiwrapper/jobs/__init__.py similarity index 100% rename from trustcafeapiwrapper/jobs/__init__.py rename to src/trustcafeapiwrapper/jobs/__init__.py diff --git a/trustcafeapiwrapper/jobs/branch/__init__.py b/src/trustcafeapiwrapper/jobs/branch/__init__.py similarity index 100% rename from trustcafeapiwrapper/jobs/branch/__init__.py rename to src/trustcafeapiwrapper/jobs/branch/__init__.py diff --git a/trustcafeapiwrapper/jobs/branch/get.py b/src/trustcafeapiwrapper/jobs/branch/get.py similarity index 100% rename from trustcafeapiwrapper/jobs/branch/get.py rename to src/trustcafeapiwrapper/jobs/branch/get.py diff --git a/trustcafeapiwrapper/jobs/branch/listbyname.py b/src/trustcafeapiwrapper/jobs/branch/listbyname.py similarity index 100% rename from trustcafeapiwrapper/jobs/branch/listbyname.py rename to src/trustcafeapiwrapper/jobs/branch/listbyname.py diff --git a/trustcafeapiwrapper/jobs/comment/__init__.py b/src/trustcafeapiwrapper/jobs/comment/__init__.py similarity index 100% rename from trustcafeapiwrapper/jobs/comment/__init__.py rename to src/trustcafeapiwrapper/jobs/comment/__init__.py diff --git a/trustcafeapiwrapper/jobs/comment/create.py b/src/trustcafeapiwrapper/jobs/comment/create.py similarity index 100% rename from trustcafeapiwrapper/jobs/comment/create.py rename to src/trustcafeapiwrapper/jobs/comment/create.py diff --git a/trustcafeapiwrapper/jobs/comment/listtbypostid.py b/src/trustcafeapiwrapper/jobs/comment/listtbypostid.py similarity index 100% rename from trustcafeapiwrapper/jobs/comment/listtbypostid.py rename to src/trustcafeapiwrapper/jobs/comment/listtbypostid.py diff --git a/trustcafeapiwrapper/jobs/feed/__init__.py b/src/trustcafeapiwrapper/jobs/feed/__init__.py similarity index 100% rename from trustcafeapiwrapper/jobs/feed/__init__.py rename to src/trustcafeapiwrapper/jobs/feed/__init__.py diff --git a/trustcafeapiwrapper/jobs/feed/cafefeed.py b/src/trustcafeapiwrapper/jobs/feed/cafefeed.py similarity index 100% rename from trustcafeapiwrapper/jobs/feed/cafefeed.py rename to src/trustcafeapiwrapper/jobs/feed/cafefeed.py diff --git a/trustcafeapiwrapper/jobs/feed/following.py b/src/trustcafeapiwrapper/jobs/feed/following.py similarity index 100% rename from trustcafeapiwrapper/jobs/feed/following.py rename to src/trustcafeapiwrapper/jobs/feed/following.py diff --git a/trustcafeapiwrapper/jobs/notification/__init__.py b/src/trustcafeapiwrapper/jobs/notification/__init__.py similarity index 100% rename from trustcafeapiwrapper/jobs/notification/__init__.py rename to src/trustcafeapiwrapper/jobs/notification/__init__.py diff --git a/trustcafeapiwrapper/jobs/notification/listnotifications.py b/src/trustcafeapiwrapper/jobs/notification/listnotifications.py similarity index 100% rename from trustcafeapiwrapper/jobs/notification/listnotifications.py rename to src/trustcafeapiwrapper/jobs/notification/listnotifications.py diff --git a/trustcafeapiwrapper/jobs/post/__init__.py b/src/trustcafeapiwrapper/jobs/post/__init__.py similarity index 100% rename from trustcafeapiwrapper/jobs/post/__init__.py rename to src/trustcafeapiwrapper/jobs/post/__init__.py diff --git a/trustcafeapiwrapper/jobs/post/create.py b/src/trustcafeapiwrapper/jobs/post/create.py similarity index 100% rename from trustcafeapiwrapper/jobs/post/create.py rename to src/trustcafeapiwrapper/jobs/post/create.py diff --git a/trustcafeapiwrapper/jobs/post/get.py b/src/trustcafeapiwrapper/jobs/post/get.py similarity index 100% rename from trustcafeapiwrapper/jobs/post/get.py rename to src/trustcafeapiwrapper/jobs/post/get.py diff --git a/trustcafeapiwrapper/jobs/post/listall.py b/src/trustcafeapiwrapper/jobs/post/listall.py similarity index 100% rename from trustcafeapiwrapper/jobs/post/listall.py rename to src/trustcafeapiwrapper/jobs/post/listall.py diff --git a/trustcafeapiwrapper/jobs/post/listallrename.py b/src/trustcafeapiwrapper/jobs/post/listallrename.py similarity index 100% rename from trustcafeapiwrapper/jobs/post/listallrename.py rename to src/trustcafeapiwrapper/jobs/post/listallrename.py diff --git a/trustcafeapiwrapper/jobs/post/listbybranch.py b/src/trustcafeapiwrapper/jobs/post/listbybranch.py similarity index 100% rename from trustcafeapiwrapper/jobs/post/listbybranch.py rename to src/trustcafeapiwrapper/jobs/post/listbybranch.py diff --git a/trustcafeapiwrapper/jobs/post/listbyuserprofile.py b/src/trustcafeapiwrapper/jobs/post/listbyuserprofile.py similarity index 100% rename from trustcafeapiwrapper/jobs/post/listbyuserprofile.py rename to src/trustcafeapiwrapper/jobs/post/listbyuserprofile.py diff --git a/trustcafeapiwrapper/jobs/post/listpublic.py b/src/trustcafeapiwrapper/jobs/post/listpublic.py similarity index 100% rename from trustcafeapiwrapper/jobs/post/listpublic.py rename to src/trustcafeapiwrapper/jobs/post/listpublic.py diff --git a/trustcafeapiwrapper/jobs/userprofile/__init__.py b/src/trustcafeapiwrapper/jobs/userprofile/__init__.py similarity index 100% rename from trustcafeapiwrapper/jobs/userprofile/__init__.py rename to src/trustcafeapiwrapper/jobs/userprofile/__init__.py diff --git a/trustcafeapiwrapper/jobs/userprofile/get.py b/src/trustcafeapiwrapper/jobs/userprofile/get.py similarity index 100% rename from trustcafeapiwrapper/jobs/userprofile/get.py rename to src/trustcafeapiwrapper/jobs/userprofile/get.py diff --git a/trustcafeapiwrapper/utils/__init__.py b/src/trustcafeapiwrapper/utils/__init__.py similarity index 100% rename from trustcafeapiwrapper/utils/__init__.py rename to src/trustcafeapiwrapper/utils/__init__.py diff --git a/trustcafeapiwrapper/utils/get_parent_pksk_from_path.py b/src/trustcafeapiwrapper/utils/get_parent_pksk_from_path.py similarity index 100% rename from trustcafeapiwrapper/utils/get_parent_pksk_from_path.py rename to src/trustcafeapiwrapper/utils/get_parent_pksk_from_path.py diff --git a/trustcafeapiwrapper/utils/get_post_pksk.py b/src/trustcafeapiwrapper/utils/get_post_pksk.py similarity index 100% rename from trustcafeapiwrapper/utils/get_post_pksk.py rename to src/trustcafeapiwrapper/utils/get_post_pksk.py diff --git a/trustcafeapiwrapper/wrappers/__init__.py b/src/trustcafeapiwrapper/wrappers/__init__.py similarity index 100% rename from trustcafeapiwrapper/wrappers/__init__.py rename to src/trustcafeapiwrapper/wrappers/__init__.py diff --git a/trustcafeapiwrapper/wrappers/comment/__init__.py b/src/trustcafeapiwrapper/wrappers/comment/__init__.py similarity index 100% rename from trustcafeapiwrapper/wrappers/comment/__init__.py rename to src/trustcafeapiwrapper/wrappers/comment/__init__.py diff --git a/trustcafeapiwrapper/wrappers/comment/create_comment.py b/src/trustcafeapiwrapper/wrappers/comment/create_comment.py similarity index 100% rename from trustcafeapiwrapper/wrappers/comment/create_comment.py rename to src/trustcafeapiwrapper/wrappers/comment/create_comment.py diff --git a/trustcafeapiwrapper/wrappers/post/__init__.py b/src/trustcafeapiwrapper/wrappers/post/__init__.py similarity index 100% rename from trustcafeapiwrapper/wrappers/post/__init__.py rename to src/trustcafeapiwrapper/wrappers/post/__init__.py diff --git a/trustcafeapiwrapper/wrappers/post/create_post.py b/src/trustcafeapiwrapper/wrappers/post/create_post.py similarity index 100% rename from trustcafeapiwrapper/wrappers/post/create_post.py rename to src/trustcafeapiwrapper/wrappers/post/create_post.py diff --git a/testing.py b/testing.py index 341e90b..a2b1293 100644 --- a/testing.py +++ b/testing.py @@ -1,6 +1,9 @@ """ Demonstrate basic usage """ +import sys +# Add the src directory to the Python path so we can import the API client and wrappers +sys.path.insert(0, './src/') from trustcafeapiwrapper import APIClient import os, simplejson as json @@ -46,9 +49,9 @@ def save_response(response): -print("-----------Get a user profile----------------") -profile = API.run_job('userprofile.get', "simon-little") -print(profile) +# print("-----------Get a user profile----------------") +# profile = API.run_job('userprofile.get', "simon-little") +# print(profile) # print("-------------- Get a branch -----------------") # branch = API.run_job('branch.get', "music") # print(branch) @@ -156,6 +159,6 @@ from trustcafeapiwrapper.wrappers.post.create_post import create_post # ) # save_response(API.run_job(**wrapped)) -save_response(API.wrapped(create_post( - "This is a test post created via the create_post wrapper function.", -))) \ No newline at end of file +# save_response(API.wrapped(create_post( +# "This is a test post created via the create_post wrapper function.", +# ))) \ No newline at end of file diff --git a/unittests.py b/unittests.py index f15b044..ccfe741 100644 --- a/unittests.py +++ b/unittests.py @@ -1,3 +1,5 @@ +import sys +sys.path.insert(0, './src/') import unittest from tests.wrappers.create_post import TestCreatePost