landmarkgaze 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: landmarkgaze
3
+ Version: 0.0.1
4
+ Summary: Gaze estimation from landmark keypoints.
5
+ Project-URL: Homepage, https://github.com/haho12/landmarkgaze
6
+ Project-URL: Issues, https://github.com/haho12/landmarkgaze/issues
7
+ Author-email: Hanno Homann <hanno.homann@example.com>
8
+ License-Expression: MIT
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Programming Language :: Python :: 3
11
+ Requires-Python: >=3.9
12
+ Requires-Dist: matplotlib
13
+ Requires-Dist: numpy
14
+ Requires-Dist: scipy
15
+ Requires-Dist: torch
16
+ Description-Content-Type: text/markdown
17
+
18
+ # LandmarkGaze
19
+
20
+ **Gaze estimation from landmark keypoints**
21
+
22
+ Todo: Write description.
@@ -0,0 +1,5 @@
1
+ # LandmarkGaze
2
+
3
+ **Gaze estimation from landmark keypoints**
4
+
5
+ Todo: Write description.
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env python
2
+ import tomllib
3
+ import requests
4
+ from packaging.version import Version
5
+ import sys
6
+ import subprocess
7
+
8
+ def build_package(require_new_version=True):
9
+ PACKAGE_NAME = "landmarkgaze"
10
+
11
+ # 1. Read local version from pyproject.toml
12
+ with open("pyproject.toml", "rb") as f:
13
+ pyproject = tomllib.load(f)
14
+
15
+ local_version = pyproject["project"]["version"]
16
+
17
+ # 2. Get latest version from PyPI
18
+ url = f"https://pypi.org/pypi/{PACKAGE_NAME}/json"
19
+ pypi_version = requests.get(url, timeout=10).json()["info"]["version"]
20
+
21
+ # 3. Compare
22
+ print("version in pyproject.toml: ", local_version)
23
+ print("version on pypi.org: ", pypi_version)
24
+ if Version(local_version) <= Version(pypi_version) and require_new_version:
25
+ print("Error: Local version must be increased for a new build")
26
+ return False
27
+
28
+ subprocess.run(['rm', '-rf', 'dist'])
29
+ subprocess.run(['python', '-m', 'build'])
30
+
31
+ return True
32
+
33
+ if __name__ == '__main__':
34
+ build_package(require_new_version=False)
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env python
2
+ import subprocess
3
+ import sys
4
+
5
+ def run_tests():
6
+ result = subprocess.run([sys.executable, "-m", "pytest", "tests/", "-v"]) # ensures python interpreter in venv
7
+ return result.returncode == 0
8
+
9
+ if __name__ == '__main__':
10
+ success = run_tests()
11
+ print("Tests passed:", success)
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env python
2
+ import tomllib
3
+ import requests
4
+ from packaging.version import Version
5
+ import sys
6
+ import subprocess
7
+
8
+ from package_run_tests import run_tests
9
+ from package_build import build_package
10
+
11
+ PACKAGE_NAME = "landmarkgaze"
12
+
13
+ # Steps:
14
+ # - run pytest
15
+ # - build (with new release number)
16
+ # - push to github (with release tag)
17
+ # - upload to pipy
18
+
19
+ def git_check_status():
20
+ # Check code is fully committed in git
21
+ status = subprocess.run(
22
+ ["git", "status", "--porcelain"],
23
+ capture_output=True,
24
+ text=True,
25
+ check=True
26
+ ).stdout.strip()
27
+
28
+ if status:
29
+ print("Error: Working tree is dirty. Commit or stash your changes first.")
30
+ print(status)
31
+ return False
32
+
33
+ return True
34
+
35
+ def git_tag_and_push():
36
+ subprocess.run(['git', 'push']) # push commits
37
+
38
+ # 1. Read local version from pyproject.toml
39
+ with open("pyproject.toml", "rb") as f:
40
+ pyproject = tomllib.load(f)
41
+
42
+ local_version = pyproject["project"]["version"]
43
+
44
+ # 2. Get latest version from PyPI
45
+ #url = f"https://pypi.org/pypi/{PACKAGE_NAME}/json"
46
+ #pypi_version = requests.get(url, timeout=10).json()["info"]["version"]
47
+
48
+ # 3. Get latest git tag
49
+ git_tag = subprocess.run(
50
+ ["git", "describe", "--tags", "--abbrev=0"],
51
+ capture_output=True,
52
+ text=True,
53
+ check=True
54
+ ).stdout.strip()
55
+ # strip leading "v" (v1.2.3 → 1.2.3)
56
+ git_version = git_tag.lstrip("v")
57
+
58
+ # 4. Compare
59
+ print("version in pyproject.toml: ", local_version)
60
+ print("version in git tag: ", git_version)
61
+ #print("version on pypi.org: ", pypi_version)
62
+ if Version(git_version) < Version(local_version):
63
+ git_tag_new = 'v' + local_version
64
+ print(f"Info: Updating git tag to '{git_tag_new}'")
65
+ subprocess.run(['git', 'tag', git_tag_new])
66
+ subprocess.run(['git', 'push', 'origin', git_tag_new]) # push new tag
67
+
68
+ return True
69
+
70
+ success = git_check_status()
71
+ if not success:
72
+ sys.exit()
73
+
74
+ success = run_tests()
75
+ if not success:
76
+ sys.exit()
77
+
78
+ success = build_package(require_new_version=True)
79
+ if not success:
80
+ sys.exit()
81
+
82
+ success = git_tag_and_push()
83
+ if not success:
84
+ sys.exit()
85
+
86
+ subprocess.run(['twine', 'upload', 'dist/*'])
@@ -0,0 +1,29 @@
1
+ [build-system]
2
+ requires = ["hatchling >= 1.26"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "landmarkgaze"
7
+ version = "0.0.1"
8
+ authors = [
9
+ { name="Hanno Homann", email="hanno.homann@example.com" },
10
+ ]
11
+ description = "Gaze estimation from landmark keypoints."
12
+ readme = "README.md"
13
+ requires-python = ">=3.9"
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "Operating System :: OS Independent",
17
+ ]
18
+ license = "MIT"
19
+ license-files = ["LICENSE"]
20
+ dependencies = [
21
+ "matplotlib",
22
+ "numpy",
23
+ "torch",
24
+ "scipy",
25
+ ]
26
+
27
+ [project.urls]
28
+ Homepage = "https://github.com/haho12/landmarkgaze"
29
+ Issues = "https://github.com/haho12/landmarkgaze/issues"
@@ -0,0 +1,10 @@
1
+ # runtime requirements
2
+ matplotlib
3
+ numpy
4
+ torch
5
+ scipy
6
+
7
+ # build and test requirements
8
+ build
9
+ twine
10
+ pytest
@@ -0,0 +1,6 @@
1
+ # set nl.__version__
2
+ from importlib.metadata import version, PackageNotFoundError
3
+ try:
4
+ __version__ = version("landmarkgaze") # get version from pyproject.toml
5
+ except PackageNotFoundError:
6
+ __version__ = "0.0.0" # fallback if not installed
@@ -0,0 +1,3 @@
1
+ import numpy as np
2
+
3
+