Skip to content

Commit

Permalink
Add automatic version numbers for tensorflow_docs.
Browse files Browse the repository at this point in the history
And drop 3.8 from supported list.

Tested:

```
Successfully installed tensorflow-docs-2023.5.24.56664
```

PiperOrigin-RevId: 535095942
  • Loading branch information
MarkDaoust authored and copybara-github committed May 25, 2023
1 parent 47be943 commit b6b50f5
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,30 @@
# ==============================================================================
"""tensorflow_docs is a package for generating python api-reference docs."""

import datetime
import subprocess
import sys

from setuptools import find_packages
from setuptools import setup

project_name = 'tensorflow-docs'
version = '0.0.0.dev0'


def get_version() -> str:
ts = int(
subprocess.check_output(['git', 'log', '-1', '--format=%ct', 'tools'])
.decode('utf-8')
.strip()
)
dt = datetime.datetime.utcfromtimestamp(ts)
sec = 60 * 60 * dt.hour + 60 * dt.minute + dt.second

# calver.org
return f'{dt.year}.{dt.month}.{dt.day}.{sec}'


version = get_version()

DOCLINES = __doc__.split('\n')

Expand All @@ -42,7 +59,7 @@
# https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords
setup(
name=project_name,
python_requires='>=3.8',
python_requires='>=3.9',
version=version,
description=DOCLINES[0],
long_description='\n'.join(DOCLINES[2:]),
Expand Down

0 comments on commit b6b50f5

Please sign in to comment.