From 9983e865f309dcdd3342d84bff11e0dc39936cc4 Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Mon, 22 Jan 2024 10:56:16 +0000 Subject: [PATCH 1/2] chore: use hatch to build package --- MANIFEST.in | 23 ----------------- pyproject.toml | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 61 -------------------------------------------- 3 files changed, 68 insertions(+), 84 deletions(-) delete mode 100644 MANIFEST.in create mode 100644 pyproject.toml delete mode 100755 setup.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 5edeeac..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,23 +0,0 @@ -exclude docs -recursive-exclude docs * -exclude tests -recursive-exclude tests * -exclude images -recursive-exclude images * - -exclude .pre-commit-config.yaml -exclude .readthedocs.yml -exclude pylint.cfg -exclude tox.ini -exclude codecov.yml - -include LICENSE -include README.md -include CHANGELOG.md - -recursive-include sphinx_tabs *.css -recursive-include sphinx_tabs *.js - -include *.js -include *.json -recursive-include __tests__ *.js diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..74e6fc1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,68 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "sphinx-tabs" +dynamic = ["version"] +description = "Tabbed views for Sphinx" +readme = "README.md" +license = "MIT" +requires-python = ">=3.7" +authors = [ + { name = "djungelorm", email = "djungelorm@users.noreply.github.com" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Plugins", + "Environment :: Web Environment", + "Framework :: Sphinx :: Extension", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Topic :: Documentation", + "Topic :: Documentation :: Sphinx", + "Topic :: Software Development :: Documentation", + "Topic :: Text Processing", + "Topic :: Utilities", +] +dependencies = [ + "docutils", + "pygments", + "sphinx", +] + +[project.optional-dependencies] +code_style = [ + "pre-commit==2.13.0", +] +testing = [ + "bs4", + "coverage", + "pygments", + "pytest-cov", + "pytest-regressions", + "pytest>=7.1,<8", + "rinohtype", +] + +[project.urls] +Homepage = "https://github.com/executablebooks/sphinx-tabs" + +[tool.hatch.version] +path = "sphinx_tabs/__init__.py" + +[tool.hatch.build.targets.sdist] +include = [ + "/sphinx_tabs", + "/__tests__", + "/CHANGELOG.md", + "/*.js", + "/*.json" +] diff --git a/setup.py b/setup.py deleted file mode 100755 index 924a140..0000000 --- a/setup.py +++ /dev/null @@ -1,61 +0,0 @@ -from os import path -import re -from setuptools import setup - - -def get_version(): - text = open(path.join(path.dirname(__file__), "sphinx_tabs", "__init__.py")).read() - match = re.compile(r"^__version__\s*\=\s*[\"\']([^\s\'\"]+)", re.M).search(text) - return match.group(1) - - -with open("README.md") as readme: - long_description = readme.read() - -setup( - name="sphinx-tabs", - version=get_version(), - description="Tabbed views for Sphinx", - long_description=open("README.md").read(), - long_description_content_type="text/markdown", - author="djungelorm", - author_email="djungelorm@users.noreply.github.com", - packages=["sphinx_tabs"], - include_package_data=True, - url="https://github.com/executablebooks/sphinx-tabs", - license="MIT", - python_requires="~=3.7", - install_requires=["sphinx", "pygments", "docutils"], - extras_require={ - "testing": [ - "coverage", - "pytest>=7.1,<8", - "pytest-cov", - "pytest-regressions", - "pygments", - "bs4", - "rinohtype", - ], - "code_style": ["pre-commit==2.13.0"], - }, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Plugins", - "Environment :: Web Environment", - "Framework :: Sphinx :: Extension", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python", - "Topic :: Documentation :: Sphinx", - "Topic :: Documentation", - "Topic :: Software Development :: Documentation", - "Topic :: Text Processing", - "Topic :: Utilities", - ], -) From 41c1edf66887df36e6c174d18ee5b71bfc49f907 Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Mon, 22 Jan 2024 11:47:28 +0000 Subject: [PATCH 2/2] chore: drop manifest check --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d21ed03..93ec1bb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,10 +10,10 @@ repos: exclude: ".xml" - - repo: https://github.com/mgedmin/check-manifest - rev: "0.48" + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.15 hooks: - - id: check-manifest + - id: validate-pyproject - repo: https://github.com/psf/black rev: 22.3.0