diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index d9facf0ca..18a266263 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -10,7 +10,7 @@ the library off of pip: .. code-block:: bash - pip install -U discord-py-interactions + pip install -U discord-py-interactions[dev] Once you have the library installed in Python, you are able to instantiate and run a basic bot with a logging level that is set for debugging purposes. This is recommend in order to make it easier diff --git a/requirements-docs.txt b/requirements-docs.txt new file mode 100644 index 000000000..8d734362a --- /dev/null +++ b/requirements-docs.txt @@ -0,0 +1,2 @@ +Sphinx==4.1.2 +sphinx-hoverxref==1.0.0 diff --git a/requirements-lint.txt b/requirements-lint.txt new file mode 100644 index 000000000..ac84521b7 --- /dev/null +++ b/requirements-lint.txt @@ -0,0 +1,4 @@ +black==21.11b1 +flake8==3.9.2 +isort==5.9.3 +pre-commit==2.16.0 diff --git a/requirements.txt b/requirements.txt index 9dd71bcc3..5ba54d59d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,3 @@ aiohttp==3.7.4.post0 -black==21.11b1 colorama==0.4.4 -flake8==3.9.2 -isort==5.9.3 -orjson -pre-commit==2.16.0 -Sphinx==4.1.2 -sphinx-hoverxref==1.0.0 +orjson==3.6.3 diff --git a/setup.py b/setup.py index 84e8899c4..7a074db10 100644 --- a/setup.py +++ b/setup.py @@ -12,14 +12,18 @@ with open(path.join(HERE, PACKAGE_NAME, "base.py"), encoding="utf-8") as fp: VERSION = re.search('__version__ = "([^"]+)"', fp.read()).group(1) + +def read_requirements(filename): + with open(filename, "r", encoding="utf-8") as fp: + return fp.read().strip().splitlines() + + extras = { - "lint": ["black", "flake8", "isort"], - "readthedocs": ["sphinx", "karma-sphinx-theme"], + "lint": read_requirements("requirements-lint.txt"), + "readthedocs": read_requirements("requirements-docs.txt"), } -extras["lint"] += extras["readthedocs"] extras["dev"] = extras["lint"] + extras["readthedocs"] - -requirements = open("requirements.txt").read().split("\n")[:-1] +requirements = read_requirements("requirements.txt") setup( name="discord-py-interactions",