diff --git a/pyproject.toml b/pyproject.toml index ede1516..a1d59c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,42 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "dinov3" +description = "" +authors = [{name = "Meta AI"}] +requires-python = ">=3.11" +readme = "README.md" +license = {file = "LICENSE.md"} +keywords = [] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: Other/Proprietary License", + "Programming Language :: Python :: 3.11", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dynamic = ["version", "dependencies", "optional-dependencies" ] + +[project.urls] +Homepage = "https://github.com/facebookresearch/dinov3" +Repository = "https://github.com/facebookresearch/dinov3" + +[tool.setuptools] +packages = ["dinov3"] +include-package-data = true + +[tool.setuptools.package-data] +"*" = ["*.yaml"] + +[tool.setuptools.dynamic] +version = {attr = "dinov3.__version__"} +dependencies = {file = ["requirements.txt"]} +optional-dependencies.dev = {file = ["requirements-dev.txt"]} + [tool.mypy] python_version = "3.11" ignore_missing_imports = true diff --git a/setup.py b/setup.py deleted file mode 100644 index 9302c12..0000000 --- a/setup.py +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# -# This software may be used and distributed in accordance with -# the terms of the DINOv3 License Agreement. - -from pathlib import Path -import re -from typing import List, Tuple - -from setuptools import setup, find_packages - - -NAME = "dinov3" -DESCRIPTION = "" - -URL = "https://github.com/facebookresearch/dinov3" -AUTHOR = "Meta AI" -REQUIRES_PYTHON = ">=3.11" -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 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 / "dinov3/__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() -dev_requirements, _ = get_requirements(HERE / "requirements-dev.txt") - - -setup( - name=NAME, - version=version, - description=DESCRIPTION, - long_description=long_description, - long_description_content_type="text/markdown", - author=AUTHOR, - python_requires=REQUIRES_PYTHON, - url=URL, - packages=find_packages(), - package_data={ - "": ["*.yaml"], - }, - install_requires=requirements, - dependency_links=extra_indices, - extras_require={ - "dev": dev_requirements, - }, - install_package_data=True, - license="DINOv3 LIcense", - license_files=("LICENSE.md",), - classifiers=[ - # Trove classifiers: https://github.com/pypa/trove-classifiers/blob/main/src/trove_classifiers/__init__.py - "Development Status :: 3 - Alpha", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "License :: Other/Proprietary License", - "Programming Language :: Python :: 3.11", - "Topic :: Scientific/Engineering :: Artificial Intelligence", - "Topic :: Software Development :: Libraries :: Python Modules", - ], -)