From ebfe4a2c844f379e9100af28b8324b2614b93749 Mon Sep 17 00:00:00 2001 From: AlexanderFL Date: Tue, 2 Nov 2021 03:31:42 +0000 Subject: [PATCH] moved src repository --- .gitignore | 4 ++-- {src => common_game_maths}/Color.py | 0 {src => common_game_maths}/Point.py | 7 +++++-- {src => common_game_maths}/Vector.py | 5 ++++- {src => common_game_maths}/__init__.py | 0 pyproject.toml | 2 +- setup.cfg | 9 ++------- 7 files changed, 14 insertions(+), 13 deletions(-) rename {src => common_game_maths}/Color.py (100%) rename {src => common_game_maths}/Point.py (73%) rename {src => common_game_maths}/Vector.py (89%) rename {src => common_game_maths}/__init__.py (100%) diff --git a/.gitignore b/.gitignore index 27836bb..8c17259 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ dist/ -src/common_game_maths_alexfreyr.egg-info/ -src/common_game_maths.egg-info/ \ No newline at end of file +common_game_maths/__pycache__/ +common_game_maths.egg-info/ \ No newline at end of file diff --git a/src/Color.py b/common_game_maths/Color.py similarity index 100% rename from src/Color.py rename to common_game_maths/Color.py diff --git a/src/Point.py b/common_game_maths/Point.py similarity index 73% rename from src/Point.py rename to common_game_maths/Point.py index 5c81dec..0e2c174 100644 --- a/src/Point.py +++ b/common_game_maths/Point.py @@ -12,5 +12,8 @@ def __add__(self, other): return Point(self.x + other.x, self.y + other.y, self.z + other.z) # Subtracts two points - def __sub__(self, other) -> Vector: - return Vector(self.x - other.x, self.y - other.y, self.z - other.z) \ No newline at end of file + def __sub__(self, other): + return Vector(self.x - other.x, self.y - other.y, self.z - other.z) + + def __str__(self): + return "Point(%s, %s, %s)" % (str(self.x), str(self.y), str(self.z)) diff --git a/src/Vector.py b/common_game_maths/Vector.py similarity index 89% rename from src/Vector.py rename to common_game_maths/Vector.py index ff32a8a..9db29a6 100644 --- a/src/Vector.py +++ b/common_game_maths/Vector.py @@ -29,4 +29,7 @@ def dot(self, other): return self.x * other.x + self.y * other.y + self.z * other.z def cross(self, other): - return Vector(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x) \ No newline at end of file + return Vector(self.y * other.z - self.z * other.y, self.z * other.x - self.x * other.z, self.x * other.y - self.y * other.x) + + def __str__(self): + return "Vector(%s, %s, %s)" % (str(self.x), str(self.y), str(self.z)) diff --git a/src/__init__.py b/common_game_maths/__init__.py similarity index 100% rename from src/__init__.py rename to common_game_maths/__init__.py diff --git a/pyproject.toml b/pyproject.toml index cff3f6f..b5a3c46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools>42", + "setuptools>=42", "wheel" ] build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 78146dd..25ccd47 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = common-game-maths -version = 1.0.0 +version = 1.0.2 author = Alexander Freyr author_email = alex@alexfreyr.com description = A small package consisting of common math objects used in creating games @@ -15,10 +15,5 @@ classifiers = Operating System :: OS Independent [options] -package_dir = - = src packages = find: -python_requires >= 3.6 - -[options.packages.find] -where = s \ No newline at end of file +python_requires = >= 3.6 \ No newline at end of file