From fc06f414d96f047504e06512f9fba9afb3799ccd Mon Sep 17 00:00:00 2001 From: Sascha Wirges Date: Thu, 16 Mar 2023 13:52:39 +0100 Subject: [PATCH] fix: add torch as build system requirement ...also move static information from setup.py to pyproject.toml --- pyproject.toml | 26 ++++++++++++++++++++++++++ setup.py | 23 ----------------------- 2 files changed, 26 insertions(+), 23 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..9a8de0adf --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,26 @@ +[project] +name = "pytorch3d" +authors = [{ name = "FAIR" }] +dependencies = ["iopath", "fvcore"] +description = "PyTorch3D is FAIR's library of reusable components for deep Learning with 3D data." +dynamic = ["version"] +requires-python = ">=3.8,<3.11" + +[project.optional-dependencies] +all = ["imageio", "ipywidgets", "matplotlib", "tqdm>4.29.0"] +dev = ["flake8", "usort"] +implicitron = [ + "accelerate", + "hydra-core>=1.1", + "lpips", + "matplotlib", + "tqdm>4.29.0", + "visdom", +] + +[build-system] +requires = ["setuptools", "torch >1.9, <=1.14"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.dynamic] +version = { attr = "pytorch3d.__version__" } diff --git a/setup.py b/setup.py index 357073ab2..3b1c3a720 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,6 @@ import glob import os -import runpy import sys import warnings from typing import List, Optional @@ -126,10 +125,6 @@ def get_extensions(): return ext_modules -# Retrieve __version__ from the package. -__version__ = runpy.run_path("pytorch3d/__init__.py")["__version__"] - - if os.getenv("PYTORCH3D_NO_NINJA", "0") == "1": class BuildExtension(torch.utils.cpp_extension.BuildExtension): @@ -142,30 +137,12 @@ def __init__(self, *args, **kwargs): trainer = "pytorch3d.implicitron_trainer" setup( - name="pytorch3d", - version=__version__, - author="FAIR", url="https://github.com/facebookresearch/pytorch3d", - description="PyTorch3D is FAIR's library of reusable components " - "for deep Learning with 3D data.", packages=find_packages( exclude=("configs", "tests", "tests.*", "docs.*", "projects.*") ) + [trainer], package_dir={trainer: "projects/implicitron_trainer"}, - install_requires=["fvcore", "iopath"], - extras_require={ - "all": ["matplotlib", "tqdm>4.29.0", "imageio", "ipywidgets"], - "dev": ["flake8", "usort"], - "implicitron": [ - "hydra-core>=1.1", - "visdom", - "lpips", - "tqdm>4.29.0", - "matplotlib", - "accelerate", - ], - }, entry_points={ "console_scripts": [ f"pytorch3d_implicitron_runner={trainer}.experiment:experiment",