resnet-classifier/setup.py

57 lines
1.5 KiB
Python
Raw Normal View History

2023-08-05 03:40:14 +00:00
import subprocess
from pathlib import Path
from datetime import datetime
from setuptools import setup, find_packages
def shell(*args):
out = subprocess.check_output(args)
return out.decode("ascii").strip()
def write_version(version_core, pre_release=True):
if pre_release:
time = shell("git", "log", "-1", "--format=%cd", "--date=iso")
time = datetime.strptime(time, "%Y-%m-%d %H:%M:%S %z")
time = time.strftime("%Y%m%d%H%M%S")
version = f"{version_core}-dev{time}"
else:
version = version_core
2023-08-05 03:48:06 +00:00
with open(Path("image_classifier", "version.py"), "w") as f:
2023-08-05 03:40:14 +00:00
f.write('__version__ = "{}"\n'.format(version))
return version
with open("README.md", "r") as f:
long_description = f.read()
setup(
2023-08-05 03:48:06 +00:00
name="image_classifier",
2023-08-05 03:40:14 +00:00
python_requires=">=3.10.0",
version=write_version("0.0.1"),
2023-08-05 03:48:06 +00:00
description="A ResNet-based image classifier",
2023-08-05 03:40:14 +00:00
author="ecker",
author_email="mrq@ecker.tech",
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(),
install_requires=[
"coloredlogs>=15.0.1",
"diskcache>=5.4.0",
"einops>=0.6.0",
"matplotlib>=3.6.0",
"numpy==1.23.0",
"omegaconf==2.0.6",
"tqdm>=4.64.1",
"humanize>=4.4.0",
"pandas>=1.5.0",
"torch>=1.13.0",
"torchaudio>=0.13.0",
"torchmetrics",
],
2023-08-05 03:48:06 +00:00
url="https://git.ecker.tech/mrq/resnet-classifier",
2023-08-05 03:40:14 +00:00
)