Merge pull request #2096 from huggingface/pyproject_pdm

Remove setup.py, replace with pyproject.toml and pdm helpers
pull/2098/head
Ross Wightman 2024-02-16 09:04:46 -08:00 committed by GitHub
commit 155b32a1c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 64 additions and 57 deletions

View File

@ -1,4 +1,62 @@
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[project]
name = "timm"
authors = [
{name = "Ross Wightman", email = "ross@huggingface.co"},
]
description = "PyTorch Image Models"
readme = "README.md"
requires-python = ">=3.8"
keywords = ["pytorch", "image-classification"]
license = {text = "Apache-2.0"}
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
]
dependencies = [
'torch',
'torchvision',
'pyyaml',
'huggingface_hub',
'safetensors',
]
dynamic = ["version"]
[project.urls]
homepage = "https://github.com/huggingface/pytorch-image-models"
documentation = "https://huggingface.co/docs/timm/en/index"
repository = "https://github.com/huggingface/pytorch-image-models"
[tool.pdm.dev-dependencies]
test = [
'pytest',
'pytest-timeout',
'pytest-xdist',
'pytest-forked',
'expecttest',
]
[tool.pdm.version]
source = "file"
path = "timm/version.py"
[tool.pytest.ini_options]
testpaths = ['tests']
markers = [
"base: marker for model tests using the basic setup",
"cfg: marker for model tests checking the config",
@ -6,9 +64,4 @@ markers = [
"features: marker for model tests checking feature extraction",
"fxforward: marker for model tests using torch fx (only forward)",
"fxbackward: marker for model tests using torch fx (only backward)",
]
[tool.black]
line-length = 120
target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
skip-string-normalization = true
]

View File

@ -3,3 +3,7 @@
conda_name_differences = 'torch:pytorch'
channels = pytorch
noarch = True
[metadata]
url = "https://github.com/huggingface/pytorch-image-models"

View File

@ -1,50 +0,0 @@
""" Setup
"""
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
exec(open('timm/version.py').read())
setup(
name='timm',
version=__version__,
description='PyTorch Image Models',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/huggingface/pytorch-image-models',
author='Ross Wightman',
author_email='ross@huggingface.co',
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 4 - Beta',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
],
# Note that this is a string of words separated by whitespace, not a list.
keywords='pytorch pretrained models efficientnet mobilenetv3 mnasnet resnet vision transformer vit',
packages=find_packages(exclude=['convert', 'tests', 'results']),
include_package_data=True,
install_requires=['torch >= 1.7', 'torchvision', 'pyyaml', 'huggingface_hub', 'safetensors'],
python_requires='>=3.7',
)

View File

@ -1 +1 @@
__version__ = '0.9.15dev0'
__version__ = '0.9.16dev0'