From 257a05ca2976c9ab7110dae5caabd07d66e48c51 Mon Sep 17 00:00:00 2001 From: wuwenxu Date: Fri, 16 Jun 2023 23:50:40 +0800 Subject: [PATCH] refactor: setup build configuration --- pyproject.toml | 34 ++++++++++++++++++++++++++++++++-- setup.cfg | 19 ------------------- setup.py | 29 ----------------------------- 3 files changed, 32 insertions(+), 50 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index b5a3c468d..81971c16a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,36 @@ [build-system] requires = [ "setuptools>=42", - "wheel" + "wheel", + "setuptools-git-versioning<2" ] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" + +[project] +name = "grad-cam" +authors = [ + {name = "Jacob Gildenblat", email = "jacob.gildenblat@gmail.com"} +] +description = "Many Class Activation Map methods implemented in Pytorch for classification, segmentation, object detection and more" +readme = "README.md" +requires-python = ">=3.6" +license = {text = "MIT"} +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +dynamic = ["version", "dependencies"] + +[project.urls] +Homepage = "https://github.com/jacobgil/pytorch-grad-cam" +"Bug Tracker" = "https://github.com/jacobgil/pytorch-grad-cam/issues" + +[tool.setuptools] +packages = ["pytorch_grad_cam"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + +[tool.setuptools-git-versioning] +enabled = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 203e6a636..000000000 --- a/setup.cfg +++ /dev/null @@ -1,19 +0,0 @@ -[metadata] -name = grad-cam -version = 1.1.0 -author = Jacob Gildenblat -author_email = jacob.gildenblat@gmail.com -description = Many Class Activation Map methods implemented in Pytorch. Including Grad-CAM, Grad-CAM++, Score-CAM, Ablation-CAM and XGrad-CAM -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/jacobgil/pytorch-grad-cam -project_urls = - Bug Tracker = https://github.com/jacobgil/pytorch-grad-cam/issues -classifiers = - Programming Language :: Python :: 3 - License :: OSI Approved :: MIT License - Operating System :: OS Independent - -[options] -packages = find: -python_requires = >=3.6 \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 1d8ace600..000000000 --- a/setup.py +++ /dev/null @@ -1,29 +0,0 @@ -import setuptools - -with open('README.md', mode='r', encoding='utf-8') as fh: - long_description = fh.read() - -with open("requirements.txt", "r") as f: - requirements = f.readlines() - -setuptools.setup( - name='grad-cam', - version='1.4.6', - author='Jacob Gildenblat', - author_email='jacob.gildenblat@gmail.com', - description='Many Class Activation Map methods implemented in Pytorch for classification, segmentation, object detection and more', - long_description=long_description, - long_description_content_type='text/markdown', - url='https://github.com/jacobgil/pytorch-grad-cam', - project_urls={ - 'Bug Tracker': 'https://github.com/jacobgil/pytorch-grad-cam/issues', - }, - classifiers=[ - 'Programming Language :: Python :: 3', - 'License :: OSI Approved :: MIT License', - 'Operating System :: OS Independent', - ], - packages=setuptools.find_packages( - exclude=["*tutorials*"]), - python_requires='>=3.6', - install_requires=requirements)