8000 GenBloom/setup.py at main · marrlab/GenBloom · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
executable file
·
72 lines (58 loc) · 2.09 KB

setup.py

File metadata and controls

executable file
·
72 lines (58 loc) · 2.09 KB
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the Apache License, Version 2.0
# found in the LICENSE file in the root directory of this source tree.
from pathlib import Path
import re
from typing import List, Tuple
from setuptools import setup, find_packages
NAME = "dinov2"
DESCRIPTION = "Inference and evaluation code for GenBloom."
REQUIRES_PYTHON = ">=3.9.0"
HERE = Path(__file__).parent
try:
with open(HERE / "README.md", encoding="utf-8") as f:
long_description = "\n" + f.read()
except FileNotFoundError:
long_description = DESCRIPTION
def get_requirements(path: str = HERE / "requirements.txt") -> Tuple[List[str], List[str]]:
requirements = []
extra_indices = []
with open(path) as f:
for line in f.readlines():
line = line.rstrip("\r\n")
if not line or line.startswith("#"):
continue
if line.startswith("--extra-index-url "):
extra_indices.append(line[18:])
continue
requirements.append(line)
return requirements, extra_indices
def get_package_version() -> str:
with open(HERE / "dinov2/__init__.py") as f:
result = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", f.read(), re.M)
if result:
return result.group(1)
raise RuntimeError("Can't get package version")
requirements, extra_indices = get_requirements()
version = get_package_version()
setup(
name=NAME,
version=version,
description=DESCRIPTION,
long_description=long_description,
long_description_content_type="text/markdown",
python_requires=REQUIRES_PYTHON,
packages=find_packages(),
install_requires=requirements,
dependency_links=extra_indices,
license="Apache",
license_files=("LICENSE",),
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
)
0