diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bec2e2cc..c077d633 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,8 +17,6 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install - run: | - python -m pip install -r requirements-dev.txt - python setup.py install + run: python -m pip install .[dev] - name: Test with pytest run: pytest diff --git a/.gitignore b/.gitignore index 3d7edd2f..429ac009 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ dist/ /.idea/ __pycache__ .coverage +.pytest_cache/ diff --git a/.isort.cfg b/.isort.cfg deleted file mode 100644 index 317f1d34..00000000 --- a/.isort.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[settings] -profile=black -multi_line_output=3 \ No newline at end of file diff --git a/.readthedocs.yml b/.readthedocs.yml index 388f9a1f..5c1dd92f 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -9,5 +9,4 @@ build: python: version: 3.8 install: - - requirements: requirements.txt - - requirements: requirements-docs.txt + - requirements: docs/requirements.txt diff --git a/MANIFEST.in b/MANIFEST.in index dc068afa..a0e44e5b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,18 @@ -include LICENSE -include requirements.txt -include README.rst +prune .github +prune .pytest_cache +prune .ruff_cache +prune build +prune docs +prune examples +prune scripts +prune tests + +exclude .coverage +exclude .gitignore +exclude .readthedocs.yml +exclude ISSUE_TEMPLATE.md +exclude mypy.ini +exclude PULL_REQUEST_TEMPLATE.md +exclude pytest.ini +exclude ruff.toml +exclude LICENSE \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..50e29c39 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +sphinx>=8.2.3 +insegel>=1.3.1 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..7f800f43 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +[build-system] +requires = ["setuptools"] + +[project] +name = "topggpy" +version = "3.0.0" +description = "A community-maintained Python API Client for the Top.gg API." +readme = "README.md" +license = { text = "MIT" } +authors = [{ name = "null8626" }, { name = "Top.gg" }] +keywords = ["discord", "discord-bot", "topgg"] +dependencies = ["aiohttp>=3.12.15"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Topic :: Internet", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Utilities" +] +requires-python = ">=3.9" + +[project.optional-dependencies] +dev = ["mock>=5.2.0", "pytest>=8.4.2", "pytest-asyncio>=1.2.0", "pytest-mock>=3.15.0", "pytest-cov>=7.0.0", "ruff>=0.13.0"] + +[project.urls] +Documentation = "https://topggpy.readthedocs.io/en/latest/" +"Raw API Documentation" = "https://docs.top.gg/docs/" +Repository = "https://github.com/top-gg-community/python-sdk" +"Support server" = "https://discord.gg/dbl" \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index e5d5d951..00000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Formatting -git+https://github.com/timothycrosley/isort -git+https://github.com/psf/black - -# Unit Testing -mock -pytest -pytest-asyncio -pytest-mock -pytest-cov - -# Linting -flake8 diff --git a/requirements-docs.txt b/requirements-docs.txt deleted file mode 100644 index e75c15e9..00000000 --- a/requirements-docs.txt +++ /dev/null @@ -1,2 +0,0 @@ -sphinx -insegel diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 9ad05803..00000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -aiohttp>=3.6.0,<3.9.0 \ No newline at end of file diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 00000000..730e2221 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,10 @@ +indent-width = 4 + +[format] +docstring-code-format = true +docstring-code-line-length = 88 +line-ending = "lf" +quote-style = "double" + +[lint] +ignore = ["E402"] \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 36733afb..00000000 --- a/setup.py +++ /dev/null @@ -1,64 +0,0 @@ -import os -import pathlib -import re -import types - -from setuptools import find_packages, setup - -HERE = pathlib.Path(__file__).parent - -txt = (HERE / "topgg" / "__init__.py").read_text("utf-8") - -groups = {} - -for match in re.finditer(r'__(?P.*)__\s*=\s*"(?P[^"]+)"\r?', txt): - group = match.groupdict() - groups[group["identifier"]] = group["value"] - -metadata = types.SimpleNamespace(**groups) - -on_rtd = os.getenv("READTHEDOCS") == "True" - -with open("requirements.txt") as f: - requirements = f.read().splitlines() - -if on_rtd: - requirements.append("sphinxcontrib-napoleon") - requirements.append("sphinx-rtd-dark-mode") - -with open("README.rst") as f: - readme = f.read() - -setup( - name="topggpy", - author=f"{metadata.author}, Top.gg", - author_email="shivaco.osu@gmail.com", - maintainer=f"{metadata.maintainer}, Top.gg", - url="https://github.com/top-gg/python-sdk", - version=metadata.version, - packages=find_packages(), - license=metadata.license, - description="A simple API wrapper for Top.gg written in Python.", - long_description=readme, - package_data={"topgg": ["py.typed"]}, - include_package_data=True, - python_requires=">= 3.6", - install_requires=requirements, - keywords="discord bot server list discordservers serverlist discordbots botlist topgg top.gg", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: MIT License", - "Intended Audience :: Developers", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Topic :: Internet", - "Topic :: Software Development :: Libraries", - "Topic :: Software Development :: Libraries :: Python Modules", - "Topic :: Utilities", - ], -) diff --git a/topgg/py.typed b/topgg/py.typed deleted file mode 100644 index e69de29b..00000000