diff --git a/.github/workflows/ignite-docs-test.yml b/.github/workflows/ignite-docs-test.yml index 8a03509a..1f099f06 100644 --- a/.github/workflows/ignite-docs-test.yml +++ b/.github/workflows/ignite-docs-test.yml @@ -48,7 +48,7 @@ jobs: - name: Install package run: | - python setup.py install + pip install . - name: Run Integration test run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c25c743..9f0c090b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,7 +48,7 @@ jobs: - name: Install package run: | - python setup.py install + pip install . pip install pytest - name: Run Tests diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..2b672ffb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,50 @@ +[build-system] +requires = ["setuptools>=61", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "sphinxcontrib-versioning" +dynamic = ["version"] +description = "Sphinx extension that allows building versioned docs for PyTorch-Ignite" +readme = "README.rst" +license = { text = "MIT" } +authors = [{ name = "PyTorch-Ignite Team", email = "contact@pytorch-ignite.ai" }] +keywords = ["sphinx", "versioning", "versions", "version", "branches", "tags"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Framework :: Sphinx :: Extension", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: MacOS", + "Operating System :: POSIX :: Linux", + "Operating System :: POSIX", + "Programming Language :: Python :: 3", + "Topic :: Documentation :: Sphinx", + "Topic :: Software Development :: Documentation", +] +requires-python = ">=3.10" +dependencies = ["click", "colorclass", "sphinx>=5,<6"] + +[project.urls] +Homepage = "https://github.com/pytorch-ignite/sphinxcontrib-versioning/" + +[project.scripts] +sphinx-versioning = "sphinxcontrib_versioning.__main__:cli" + +[tool.setuptools.dynamic] +version = { attr = "sphinxcontrib_versioning.__version__" } + +[tool.setuptools.packages.find] +exclude = ["tests", "tests.*"] + +[tool.setuptools.package-data] +"*" = [ + "_static/banner.css", + "_templates/banner.html", + "_templates/layout.html", + "_templates/versions.html", +] + +[tool.pytest.ini_options] +log_level = "DEBUG" diff --git a/setup.py b/setup.py deleted file mode 100755 index 9584da4e..00000000 --- a/setup.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python -"""Setup script for the project.""" - -import io -import os -import re - -from setuptools import find_packages, setup - - -INSTALL_REQUIRES = ["click", "colorclass", "sphinx>5"] -LICENSE = "MIT" -NAME = "sphinxcontrib-versioning" - - -def read(*names, **kwargs): - with io.open( - os.path.join(os.path.dirname(__file__), *names), - encoding=kwargs.get("encoding", "utf8"), - ) as fp: - return fp.read() - - -def find_version(*file_paths): - version_file = read(*file_paths) - version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M) - if version_match: - return version_match.group(1) - raise RuntimeError("Unable to find version string.") - - -VERSION = find_version("sphinxcontrib_versioning", "__init__.py") -readme = read("README.rst") - - -if __name__ == "__main__": - setup( - author="PyTorch-Ignite Team", - author_email="contact@pytorch-ignite.ai", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Console", - "Framework :: Sphinx :: Extension", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: MacOS", - "Operating System :: POSIX :: Linux", - "Operating System :: POSIX", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3.3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: Implementation :: PyPy", - "Topic :: Documentation :: Sphinx", - "Topic :: Software Development :: Documentation", - ], - description="Sphinx extension that allows building versioned docs for PyTorch-Ignite", - entry_points={ - "console_scripts": [ - "sphinx-versioning = sphinxcontrib_versioning.__main__:cli" - ] - }, - install_requires=INSTALL_REQUIRES, - keywords="sphinx versioning versions version branches tags", - license=LICENSE, - long_description=readme, - name=NAME, - package_data={ - "": [ - os.path.join("_static", "banner.css"), - os.path.join("_templates", "banner.html"), - os.path.join("_templates", "layout.html"), - os.path.join("_templates", "versions.html"), - ] - }, - packages=find_packages(exclude=("tests", "tests.*")), - url="https://github.com/pytorch-ignite/{NAME}/", - version=VERSION, - zip_safe=False, - )