From 92b690eac306abbaa326e12a9f90ac3777e673d7 Mon Sep 17 00:00:00 2001 From: "thomm.o" Date: Mon, 13 Dec 2021 22:10:01 +0000 Subject: [PATCH] Repackage into lightbulb extension library --- README.md | 2 +- docs/source/conf.py | 6 +++--- docs/source/index.rst | 4 ++-- {wtf => lightbulb/ext/wtf}/__init__.py | 18 +++++++++--------- {wtf => lightbulb/ext/wtf}/base.py | 0 {wtf => lightbulb/ext/wtf}/basic.py | 2 +- {wtf => lightbulb/ext/wtf}/commands.py | 8 ++++---- {wtf => lightbulb/ext/wtf}/executable.py | 2 +- {wtf => lightbulb/ext/wtf}/options.py | 4 ++-- {wtf => lightbulb/ext/wtf}/py.typed | 0 setup.py | 8 ++++---- 11 files changed, 27 insertions(+), 27 deletions(-) rename {wtf => lightbulb/ext/wtf}/__init__.py (69%) rename {wtf => lightbulb/ext/wtf}/base.py (100%) rename {wtf => lightbulb/ext/wtf}/basic.py (97%) rename {wtf => lightbulb/ext/wtf}/commands.py (99%) rename {wtf => lightbulb/ext/wtf}/executable.py (97%) rename {wtf => lightbulb/ext/wtf}/options.py (98%) rename {wtf => lightbulb/ext/wtf}/py.typed (100%) diff --git a/README.md b/README.md index d909815..f1fd594 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ A basic command: ```python import lightbulb -from wtf import * +from lightbulb.ext.wtf import * bot = lightbulb.BotApp(...) diff --git a/docs/source/conf.py b/docs/source/conf.py index f2404c1..8cd3ced 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,17 +14,17 @@ import re import sys -sys.path.insert(0, os.path.abspath(os.path.join("..", ".."))) +sys.path.insert(0, os.path.abspath(os.path.join("..", "..", "lightbulb", "ext"))) sys.setrecursionlimit(1500) # -- Project information ----------------------------------------------------- -project = "lightbulb-wtf" +project = "lightbulb-ext-wtf" copyright = "2021-present, tandemdude" author = "tandemdude" -with open("../../wtf/__init__.py") as fp: +with open("../../lightbulb/ext/wtf/__init__.py") as fp: file = fp.read() version = re.search(r"__version__ = \"([^\"]+)", file).group(1) release = version diff --git a/docs/source/index.rst b/docs/source/index.rst index 0b65dc3..084882f 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -31,7 +31,7 @@ Use the package manager `pip `_ to install light .. code-block:: bash - pip install lightbulb-wtf + pip install lightbulb-ext-wtf Issues @@ -44,7 +44,7 @@ Please also open an issue for any new features you would like to see added. Links ===== -**Repository:** `GitHub `_ +**Repository:** `GitHub `_ **Documentation:** `View Here `_ diff --git a/wtf/__init__.py b/lightbulb/ext/wtf/__init__.py similarity index 69% rename from wtf/__init__.py rename to lightbulb/ext/wtf/__init__.py index 723b782..0e72b85 100644 --- a/wtf/__init__.py +++ b/lightbulb/ext/wtf/__init__.py @@ -1,13 +1,13 @@ # -*- coding: utf-8 -*- # Copyright © tandemdude 2021-present -from wtf import basic -from wtf import commands -from wtf import executable -from wtf import options -from wtf.basic import * -from wtf.commands import * -from wtf.executable import * -from wtf.options import * +from . import basic +from . import commands +from . import executable +from . import options +from .basic import * +from .commands import * +from .executable import * +from .options import * __all__ = [ "Name", @@ -39,4 +39,4 @@ "Option", ] -__version__ = "0.0.1" +__version__ = "0.1.0" diff --git a/wtf/base.py b/lightbulb/ext/wtf/base.py similarity index 100% rename from wtf/base.py rename to lightbulb/ext/wtf/base.py diff --git a/wtf/basic.py b/lightbulb/ext/wtf/basic.py similarity index 97% rename from wtf/basic.py rename to lightbulb/ext/wtf/basic.py index 888ad24..02d3adf 100644 --- a/wtf/basic.py +++ b/lightbulb/ext/wtf/basic.py @@ -4,7 +4,7 @@ __all__ = ["Name", "Description"] -from wtf import base +from . import base class _Name(base._SingleArgBase[str]): diff --git a/wtf/commands.py b/lightbulb/ext/wtf/commands.py similarity index 99% rename from wtf/commands.py rename to lightbulb/ext/wtf/commands.py index 6edd86c..2c170fb 100644 --- a/wtf/commands.py +++ b/lightbulb/ext/wtf/commands.py @@ -28,10 +28,10 @@ import hikari import lightbulb -from wtf import base -from wtf import basic -from wtf import executable -from wtf import options +from . import base +from . import basic +from . import executable +from . import options _CommandCallbackT = t.TypeVar("_CommandCallbackT", bound=t.Callable[..., t.Coroutine[t.Any, t.Any, None]]) diff --git a/wtf/executable.py b/lightbulb/ext/wtf/executable.py similarity index 97% rename from wtf/executable.py rename to lightbulb/ext/wtf/executable.py index f758440..1635f6a 100644 --- a/wtf/executable.py +++ b/lightbulb/ext/wtf/executable.py @@ -8,7 +8,7 @@ import lightbulb -from wtf import base +from . import base class _Executes(base._SingleArgBase[t.Callable[[lightbulb.Context], t.Union[None, t.Coroutine[t.Any, t.Any, None]]]]): diff --git a/wtf/options.py b/lightbulb/ext/wtf/options.py similarity index 98% rename from wtf/options.py rename to lightbulb/ext/wtf/options.py index 19c8c46..2d9d062 100644 --- a/wtf/options.py +++ b/lightbulb/ext/wtf/options.py @@ -9,8 +9,8 @@ import hikari import lightbulb -from wtf import base -from wtf import basic +from . import base +from . import basic class _Type(base._SingleArgBase[t.Any]): diff --git a/wtf/py.typed b/lightbulb/ext/wtf/py.typed similarity index 100% rename from wtf/py.typed rename to lightbulb/ext/wtf/py.typed diff --git a/setup.py b/setup.py index 5d34b00..ebd8535 100644 --- a/setup.py +++ b/setup.py @@ -7,11 +7,11 @@ from setuptools import find_namespace_packages from setuptools import setup -name = "wtf" +name = "lightbulb" def parse_meta(): - with open(os.path.join(name, "__init__.py")) as fp: + with open(os.path.join(name, "ext", "wtf", "__init__.py")) as fp: code = fp.read() token_pattern = re.compile( @@ -42,14 +42,14 @@ def parse_requirements_file(path): meta = parse_meta() setup( - name="lightbulb-wtf", + name="lightbulb-ext-wtf", version=meta.version, description="A very strange method of declaring commands with hikari-lightbulb", long_description=long_description(), long_description_content_type="text/markdown", author="tandemdude", author_email="tandemdude1@gmail.com", - url="https://github.com/tandemdude/lightbulb-wtf", + url="https://github.com/tandemdude/lightbulb-ext-wtf", packages=find_namespace_packages(include=[name + "*"]), license="Beerware", include_package_data=True,