From 03fefc79aa8cae24c2f9a3aebccf68cc3dded8ab Mon Sep 17 00:00:00 2001 From: Alexis Praga Date: Thu, 29 Jul 2021 16:27:28 +0200 Subject: [PATCH] Use flit for packaging. Add LICENSE and tests --- LICENSE.md => LICENSE | 0 pyproject.toml | 22 +++++++++++++++++++ setup.py | 1 + .../sphinxext_opengraph}/__init__.py | 3 +++ .../sphinxext_opengraph}/descriptionparser.py | 0 .../sphinxext_opengraph}/titleparser.py | 0 6 files changed, 26 insertions(+) rename LICENSE.md => LICENSE (100%) create mode 100644 pyproject.toml rename {sphinxext/opengraph => src/sphinxext_opengraph}/__init__.py (97%) rename {sphinxext/opengraph => src/sphinxext_opengraph}/descriptionparser.py (100%) rename {sphinxext/opengraph => src/sphinxext_opengraph}/titleparser.py (100%) diff --git a/LICENSE.md b/LICENSE similarity index 100% rename from LICENSE.md rename to LICENSE diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..fb9a3b6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,22 @@ +[build-system] +requires = ["flit_core >=2,<4"] +build-backend = "flit_core.buildapi" + + +[tool.flit.metadata] +module = "sphinxext_opengraph" +author = "Itay Ziv" +author-email = "itay220204@gmail.com" +home-page = "https://github.com/wpilibsuite/sphinxext-opengraph" +description-file = "README.md" +requires-python = ">=3.6" +requires = ["sphinx >= 2"] + +# [tool.flit.metadata.requires-extra] +# test = [ +# "conftest.py", +# "roots", +# "test_options.py" + +# ] +# doc = [" \ No newline at end of file diff --git a/setup.py b/setup.py index 6541242..beb1053 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/wpilibsuite/sphinxext-opengraph", + license="LICENSE.md", install_requires=["sphinx>=2.0"], packages=["sphinxext/opengraph"], classifiers=[ diff --git a/sphinxext/opengraph/__init__.py b/src/sphinxext_opengraph/__init__.py similarity index 97% rename from sphinxext/opengraph/__init__.py rename to src/sphinxext_opengraph/__init__.py index 9c25885..f867286 100644 --- a/sphinxext/opengraph/__init__.py +++ b/src/sphinxext_opengraph/__init__.py @@ -1,3 +1,5 @@ +"""Sphinx extension to generate OpenGraph metadata (https://ogp.me/)""" + from typing import Any, Dict from urllib.parse import urljoin, urlparse, urlunparse from pathlib import Path, PosixPath @@ -11,6 +13,7 @@ import os +__version__ = "0.4.2" DEFAULT_DESCRIPTION_LENGTH = 200 diff --git a/sphinxext/opengraph/descriptionparser.py b/src/sphinxext_opengraph/descriptionparser.py similarity index 100% rename from sphinxext/opengraph/descriptionparser.py rename to src/sphinxext_opengraph/descriptionparser.py diff --git a/sphinxext/opengraph/titleparser.py b/src/sphinxext_opengraph/titleparser.py similarity index 100% rename from sphinxext/opengraph/titleparser.py rename to src/sphinxext_opengraph/titleparser.py