From eeddf3dce3a90014a9b9b584631a07ee5b2b1dc3 Mon Sep 17 00:00:00 2001 From: Zooxy Le <elhoangvu@gmail.com> Date: Tue, 16 Apr 2024 11:50:35 +0700 Subject: [PATCH] chore(ci): extra deploy info (2) --- pyproject.toml | 2 +- setup.py | 38 ++++++++++++++++++------------------- src/dictrule/__init__.py | 36 +++++++++++++++++++++++++++++++++++ src/dictrule/__version__.py | 9 +++++++++ 4 files changed, 65 insertions(+), 20 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8a990c9..ffef0b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.isort] profile = "black" -src_paths = ["src/dictrule"] +src_paths = ["src/dictrule", "src/dictrule/built_in_rules"] honor_noqa = true [tool.pytest.ini_options] diff --git a/setup.py b/setup.py index 931535b..3c98d46 100644 --- a/setup.py +++ b/setup.py @@ -7,37 +7,37 @@ """ +from pathlib import Path from setuptools import setup -__title__ = "dictrule" -__description__ = "Python rules defined by a dict and a text generator from the rules" -__url__ = "https://github.com/elhoangvu/dictrule" -__version__ = "0.1.0" -__author__ = "Zooxy Le" -__author_email__ = "elhoangvu@gmail.com" -__license__ = "Apache-2.0" -__copyright__ = "Copyright Zooxy Le" -__readme__ = "" +this_directory = Path(__file__).parent -with open(file="README.md", mode="r", encoding="utf-8") as f: - readme = f.read() +about = {} +with open( + file=this_directory / "src" / "dictrule" / "__version__.py", + mode="r", + encoding="utf-8", +) as file: + exec(file.read(), about) + +long_description = (this_directory / "README.md").read_text() if __name__ == "__main__": setup( - name=__title__, - version=__version__, - description=__description__, - long_description=__readme__, + name=about["__title__"], + version=about["__version__"], + description=about["__description__"], + long_description=long_description, long_description_content_type="text/markdown", - author=__author__, - author_email=__author_email__, - url=__url__, + author=about["__author__"], + author_email=about["__author_email__"], + url=about["__url__"], packages=["dictrule"], package_data={"": ["LICENSE", "NOTICE"]}, package_dir={"": "src"}, include_package_data=True, python_requires=">=3.7", - license=__license__, + license=about["__license__"], zip_safe=False, classifiers=[ "Development Status :: 5 - Production/Stable", diff --git a/src/dictrule/__init__.py b/src/dictrule/__init__.py index c3fd3e7..d882334 100644 --- a/src/dictrule/__init__.py +++ b/src/dictrule/__init__.py @@ -10,6 +10,16 @@ from .generator import Generator from .rule import Rule from .context import Context +from .__version__ import ( + __title__, + __description__, + __url__, + __version__, + __author__, + __author_email__, + __license__, + __copyright__, +) from .exceptions import ( NoneValueException, @@ -28,3 +38,29 @@ JoinEvalRule, FormatRule, ) + +__all__ = [ + "Generator", + "Rule", + "Context", + "NoneValueException", + "InvalidTypeException", + "InvalidValueException", + "BlockRule", + "CommentRule", + "EvalRule", + "InlineRule", + "IndentRule", + "ForInRule", + "JoinBlockRule", + "JoinEvalRule", + "FormatRule", + "__title__", + "__description__", + "__url__", + "__version__", + "__author__", + "__author_email__", + "__license__", + "__copyright__", +] diff --git a/src/dictrule/__version__.py b/src/dictrule/__version__.py index 47eaded..666c7d3 100644 --- a/src/dictrule/__version__.py +++ b/src/dictrule/__version__.py @@ -6,3 +6,12 @@ \__,_/_/\___/\__/_/ \__,_/_/\___/ |___/\___/_/ /____/_/\____/_/ /_/ """ + +__title__ = "dictrule" +__description__ = "Python rules defined by a dict and a text generator from the rules" +__url__ = "https://github.com/elhoangvu/dictrule" +__version__ = "0.1.0" +__author__ = "Zooxy Le" +__author_email__ = "elhoangvu@gmail.com" +__license__ = "Apache-2.0" +__copyright__ = "Copyright Zooxy Le"