Compare commits
No commits in common. "2b3174dc050fe889351d7864e7427423a75402f9" and "1d38598efce33f1765b79c08266e3b743b9d53b1" have entirely different histories.
2b3174dc05
...
1d38598efc
|
@ -1 +1 @@
|
||||||
__version__ = '0.1.7'
|
__version__ = '0.1.6'
|
45
setup.py
45
setup.py
|
@ -1,3 +1,5 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
#
|
||||||
# WARNING
|
# WARNING
|
||||||
#
|
#
|
||||||
# THIS IS AN AUTOGENERATED FILE.
|
# THIS IS AN AUTOGENERATED FILE.
|
||||||
|
@ -10,34 +12,9 @@ from setuptools import setup
|
||||||
|
|
||||||
PACKAGE_NAME = 'git_time_tracker'
|
PACKAGE_NAME = 'git_time_tracker'
|
||||||
|
|
||||||
PACKAGE_DESCRIPTION = """
|
with open('README.md') as f:
|
||||||
# Git-based Time Tracker
|
readme = f.read()
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
This tool reports:
|
|
||||||
|
|
||||||
```
|
|
||||||
project Jmaa/git-time-tracker.git 3h 33m (2024)
|
|
||||||
```
|
|
||||||
|
|
||||||
And the ([Hamster](https://github.com/projecthamster/hamster)) manual time tracker reports:
|
|
||||||
|
|
||||||
![](docs/obligatory-hamster.png)"""
|
|
||||||
|
|
||||||
PACKAGE_DESCRIPTION_SHORT='Quick and dirty time tracker on git histories.'
|
|
||||||
|
|
||||||
def parse_version_file(text: str) -> str:
|
def parse_version_file(text: str) -> str:
|
||||||
match = re.match(r'^__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
|
match = re.match(r'^__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
|
||||||
|
@ -60,6 +37,16 @@ def read_requirements(path: str) -> list[str]:
|
||||||
return parse_requirements(f.read())
|
return parse_requirements(f.read())
|
||||||
|
|
||||||
|
|
||||||
|
def determine_short_description(readme: str) -> str:
|
||||||
|
readme = re.sub(r'#+[^\n]*\n+', '', readme)
|
||||||
|
m = re.search(r'^\s*(\w+[\w\s,`+-]+\.)', readme)
|
||||||
|
try:
|
||||||
|
return m.group(1)
|
||||||
|
except AttributeError as err:
|
||||||
|
msg = f'Could not determine short description: {readme}'
|
||||||
|
raise Exception(msg) from err
|
||||||
|
|
||||||
|
|
||||||
REQUIREMENTS_MAIN = """
|
REQUIREMENTS_MAIN = """
|
||||||
GitPython
|
GitPython
|
||||||
"""
|
"""
|
||||||
|
@ -72,8 +59,8 @@ pytest
|
||||||
setup(
|
setup(
|
||||||
name=PACKAGE_NAME,
|
name=PACKAGE_NAME,
|
||||||
version=version,
|
version=version,
|
||||||
description=PACKAGE_DESCRIPTION_SHORT,
|
description=determine_short_description(readme),
|
||||||
long_description=PACKAGE_DESCRIPTION,
|
long_description=readme,
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type='text/markdown',
|
||||||
author='Jmaa',
|
author='Jmaa',
|
||||||
author_email='jonjmaa@gmail.com',
|
author_email='jonjmaa@gmail.com',
|
||||||
|
|
Reference in New Issue
Block a user