2024-06-03 20:44:45 +00:00
|
|
|
# WARNING
|
|
|
|
#
|
|
|
|
# THIS IS AN AUTOGENERATED FILE.
|
|
|
|
#
|
|
|
|
# MANUAL CHANGES CAN AND WILL BE OVERWRITTEN.
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
from setuptools import setup
|
|
|
|
|
|
|
|
PACKAGE_NAME = 'git_time_tracker'
|
|
|
|
|
2024-07-08 18:22:14 +00:00
|
|
|
PACKAGE_DESCRIPTION = """
|
2024-07-09 22:15:05 +00:00
|
|
|
# Git-based Time Tracker.
|
2024-07-08 18:22:14 +00:00
|
|
|
|
|
|
|
Quick and dirty time tracker on git histories.
|
|
|
|
|
|
|
|
Uses the simple heuristics that each commit takes precisely one hour of work.
|
|
|
|
It will automatically trim commits below one hour if another commit occurred
|
|
|
|
less than an hour ago.
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
|
|
|
|
```
|
|
|
|
python -m git_time_tracker REPO1 REPO2...
|
|
|
|
```
|
|
|
|
|
|
|
|
# Obligatory
|
2024-06-03 20:44:45 +00:00
|
|
|
|
2024-07-08 18:22:14 +00:00
|
|
|
This tool reports:
|
|
|
|
|
|
|
|
```
|
|
|
|
project Jmaa/git-time-tracker.git 3h 33m (2024)
|
|
|
|
```
|
|
|
|
|
|
|
|
And the ([Hamster](https://github.com/projecthamster/hamster)) manual time tracker reports:
|
|
|
|
|
2024-07-09 22:15:05 +00:00
|
|
|
![](docs/obligatory-hamster.png)
|
|
|
|
|
|
|
|
|
|
|
|
# License
|
|
|
|
|
|
|
|
```
|
|
|
|
Copyright (c) 2024 Jon Michael Aanes
|
|
|
|
|
|
|
|
All rights reserved.
|
|
|
|
```"""
|
2024-07-08 18:22:14 +00:00
|
|
|
|
2024-07-10 21:39:53 +00:00
|
|
|
PACKAGE_DESCRIPTION_SHORT = (
|
2024-07-10 21:40:32 +00:00
|
|
|
'Quick and dirty time tracker on git histories.'
|
2024-07-10 21:39:53 +00:00
|
|
|
)
|
|
|
|
|
2024-06-03 20:44:45 +00:00
|
|
|
|
|
|
|
def parse_version_file(text: str) -> str:
|
|
|
|
match = re.match(r'^__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
|
|
|
|
if match is None:
|
|
|
|
msg = 'Malformed _version.py file!'
|
|
|
|
raise Exception(msg)
|
|
|
|
return match.group(2)
|
|
|
|
|
|
|
|
|
|
|
|
with open(PACKAGE_NAME + '/_version.py') as f:
|
|
|
|
version = parse_version_file(f.read())
|
|
|
|
|
|
|
|
|
|
|
|
def parse_requirements(text: str) -> list[str]:
|
|
|
|
return text.strip().split('\n')
|
|
|
|
|
|
|
|
|
|
|
|
def read_requirements(path: str) -> list[str]:
|
|
|
|
with open(path) as f:
|
|
|
|
return parse_requirements(f.read())
|
|
|
|
|
|
|
|
|
|
|
|
REQUIREMENTS_MAIN = """
|
2024-07-09 21:59:54 +00:00
|
|
|
GitPython"""
|
2024-06-03 20:44:45 +00:00
|
|
|
|
|
|
|
REQUIREMENTS_TEST = """
|
2024-07-09 21:59:54 +00:00
|
|
|
pytest"""
|
2024-06-03 20:44:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
setup(
|
|
|
|
name=PACKAGE_NAME,
|
|
|
|
version=version,
|
2024-07-08 18:22:14 +00:00
|
|
|
description=PACKAGE_DESCRIPTION_SHORT,
|
|
|
|
long_description=PACKAGE_DESCRIPTION,
|
2024-06-03 20:44:45 +00:00
|
|
|
long_description_content_type='text/markdown',
|
2024-07-09 21:59:54 +00:00
|
|
|
author='Jon Michael Aanes',
|
2024-06-03 20:44:45 +00:00
|
|
|
author_email='jonjmaa@gmail.com',
|
|
|
|
url='https://gitfub.space/Jmaa/' + PACKAGE_NAME,
|
|
|
|
packages=[PACKAGE_NAME],
|
|
|
|
install_requires=parse_requirements(REQUIREMENTS_MAIN),
|
|
|
|
extras_require={
|
|
|
|
'test': parse_requirements(REQUIREMENTS_TEST),
|
|
|
|
},
|
|
|
|
python_requires='>=3.9',
|
|
|
|
)
|