diff --git a/gitea/__init__.py b/py-gitea/__init__.py similarity index 100% rename from gitea/__init__.py rename to py-gitea/__init__.py diff --git a/gitea/basicGiteaApiObject.py b/py-gitea/basicGiteaApiObject.py similarity index 100% rename from gitea/basicGiteaApiObject.py rename to py-gitea/basicGiteaApiObject.py diff --git a/gitea/exceptions.py b/py-gitea/exceptions.py similarity index 100% rename from gitea/exceptions.py rename to py-gitea/exceptions.py diff --git a/gitea/gitea.py b/py-gitea/gitea.py similarity index 98% rename from gitea/gitea.py rename to py-gitea/gitea.py index 5a178c9..8e83886 100644 --- a/gitea/gitea.py +++ b/py-gitea/gitea.py @@ -327,7 +327,7 @@ class Repository(GiteaApiObject): def create_gitea_hook(self, hook_url: str, events: List[str]): url = f"/repos/{self.owner.username}/{self.name}/hooks" data = { - "type": "gitea", + "type": "py-gitea", "config": {"content_type": "json", "url": hook_url}, "events": events, "active": True, @@ -445,7 +445,7 @@ class Commit(GiteaApiObject): @classmethod def parse_response(cls, gitea, result): id = result["sha"] - # gitea.logger.debug("Found api object of type %s (id: %s)" % (type(cls), id)) + # py-gitea.logger.debug("Found api object of type %s (id: %s)" % (type(cls), id)) api_object = cls(gitea, id=id) cls._initialize(gitea, api_object, result) # HACK @@ -961,7 +961,7 @@ class Gitea: self.logger.debug("Gitea response: %s", result) else: self.logger.error(result["message"]) - raise Exception("User not created... (gitea: %s)" % result["message"]) + raise Exception("User not created... (py-gitea: %s)" % result["message"]) user = User.parse_response(self, result) return user @@ -1003,7 +1003,7 @@ class Gitea: self.logger.info("Successfully created Repository %s " % result["name"]) else: self.logger.error(result["message"]) - raise Exception("Repository not created... (gitea: %s)" % result["message"]) + raise Exception("Repository not created... (py-gitea: %s)" % result["message"]) return Repository.parse_response(self, result) def create_org( @@ -1032,11 +1032,11 @@ class Gitea: ) else: self.logger.error( - "Organization not created... (gitea: %s)" % result["message"] + "Organization not created... (py-gitea: %s)" % result["message"] ) self.logger.error(result["message"]) raise Exception( - "Organization not created... (gitea: %s)" % result["message"] + "Organization not created... (py-gitea: %s)" % result["message"] ) return Organization.parse_response(self, result) @@ -1076,11 +1076,11 @@ class Gitea: if "id" in result: self.logger.info("Successfully created Team %s" % result["name"]) else: - self.logger.error("Team not created... (gitea: %s)" % result["message"]) + self.logger.error("Team not created... (py-gitea: %s)" % result["message"]) self.logger.error(result["message"]) - raise Exception("Team not created... (gitea: %s)" % result["message"]) + raise Exception("Team not created... (py-gitea: %s)" % result["message"]) api_object = Team.parse_response(self, result) setattr( api_object, "_organization", org - ) # fixes strange behaviour of gitea not returning a valid organization here. + ) # fixes strange behaviour of py-gitea not returning a valid organization here. return api_object diff --git a/gitea/giteaApiObject.py b/py-gitea/giteaApiObject.py similarity index 100% rename from gitea/giteaApiObject.py rename to py-gitea/giteaApiObject.py diff --git a/setup.py b/setup.py index 2330950..04a3ac9 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open('README.md') as readme_file: setup_args = dict( name='py-gitea', - version='0.1.0', + version='0.1.1', description='A python wrapper for the Gitea API', long_description_content_type="text/markdown", long_description=README, diff --git a/tests/test_api.py b/tests/test_api.py index 7ab1294..5184ddd 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -4,7 +4,7 @@ import uuid from gitea import Gitea, User, Organization, Team, Repository, Issue from gitea import NotFoundException, AlreadyExistsException -# put a ".token" file into your directory containg only the token for gitea +# put a ".token" file into your directory containg only the token for py-gitea @pytest.fixture def instance(scope="module"): try: