From 2e0d474d9020fafb22470c3326715cc583932625 Mon Sep 17 00:00:00 2001 From: Milka64 Date: Mon, 11 Dec 2023 18:15:49 +0100 Subject: [PATCH] fix for pkg --- pyproject.toml | 22 ++++++++++++++++++++++ setup.py | 4 ++-- sphinxcontrib/d2lang/__init__.py | 5 ++++- sphinxcontrib/requirements.txt | 7 ++++--- 4 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..1e1d20f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,22 @@ +[build-system] +requires = ["setuptools>=67.7.2","docutils>=0.20.0","Sphinx>=7.2.6","wheel>=0.42.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "sphinxcontrib-d2lang" +version = "0.0.1" +authors = [ + { name="Milka64", email="michael.ricart@0w.tf" }, +] +description = "an extension for sphinx to render d2lang diagrams in sphinx documents" +readme = "README.md" +requires-python = ">=3.8" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] + +[project.urls] +Homepage = "https://git.0w.tf/Milka64/sphinx-d2lang/" +Issues = "https://git.0w.tf/Milka64/sphinx-d2lang/issues" diff --git a/setup.py b/setup.py index 4f233c1..33d7139 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ this is the setup of this package. from setuptools import setup -from sphinxcontrib.d2lang import __version__ +#from .sphinxcontrib.d2lang import __version__ with open('sphinxcontrib/requirements.txt', 'r', encoding='utf8') as file: install_requires = list(map(lambda x: x.strip(), file.readlines())) @@ -14,7 +14,7 @@ with open('README.md', 'r', encoding='utf8') as file: setup( name='sphinxcontrib-d2lang', - version='.'.join(map(str, __version__)), + version='0.0.1', author='Milka64', author_email='michael.ricart@0w.tf', url='https://git.0w.tf/Milka64/sphinx-d2lang/', diff --git a/sphinxcontrib/d2lang/__init__.py b/sphinxcontrib/d2lang/__init__.py index c685e2f..53ee1b6 100644 --- a/sphinxcontrib/d2lang/__init__.py +++ b/sphinxcontrib/d2lang/__init__.py @@ -1,4 +1,7 @@ -from sphinx.application import Sphinx +try: + from sphinx.application import Sphinx +except: + pass from .d2lang import D2langDirective diff --git a/sphinxcontrib/requirements.txt b/sphinxcontrib/requirements.txt index e4761f0..3bcfd52 100644 --- a/sphinxcontrib/requirements.txt +++ b/sphinxcontrib/requirements.txt @@ -1,3 +1,4 @@ -Sphinx -docutils -wheel +docutils==0.20.1 +setuptools==67.7.2 +Sphinx==7.2.6 +wheel==0.42.0