Skip to content

Commit

Permalink
Switch to pyproject.toml project
Browse files Browse the repository at this point in the history
  • Loading branch information
davfsa committed Mar 3, 2025
1 parent e11a688 commit d3b1acb
Show file tree
Hide file tree
Showing 19 changed files with 137 additions and 208 deletions.
9 changes: 0 additions & 9 deletions MANIFEST.in

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements/audit.txt

This file was deleted.

2 changes: 0 additions & 2 deletions dev-requirements/build.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements/codespell.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements/coverage.txt

This file was deleted.

21 changes: 0 additions & 21 deletions dev-requirements/flake8.txt

This file was deleted.

21 changes: 0 additions & 21 deletions dev-requirements/mkdocs.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements/mypy.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements/pyright.txt

This file was deleted.

11 changes: 0 additions & 11 deletions dev-requirements/pytest.txt

This file was deleted.

3 changes: 0 additions & 3 deletions dev-requirements/release.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements/ruff.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements/slotscheck.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev-requirements/towncrier.txt

This file was deleted.

154 changes: 137 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,126 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
[build-system]
requires = ["wheel", "setuptools"]
requires = ["wheel", "setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
where = ["."]
include = ["hikari*"]

[tool.setuptools.dynamic]
version = { attr = "hikari._about.__version__" }

[project]
dynamic = ["version"]
name = "hikari"
description = "A sane Discord API for Python 3 built on asyncio and good intentions"
requires-python = ">=3.9.0,<3.14"
dependencies = [
"aiohttp~=3.11",
"attrs~=25.1",
"colorlog~=6.9",
"multidict~=6.1",
]
scripts = { "hikari" = "hikari.cli:main" }

license = { text = "MIT" }
readme = "README.md"
authors = [
{ name = "Nekokatt" },
{ name = "davfsa" },
{ name = "FasterSpeeding" },
]
maintainers = [{ name = "davfsa", email = "[email protected]" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Framework :: AsyncIO",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"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",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Communications :: Chat",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries",
]

[project.optional-dependencies]
speedups = ["aiohttp[speedups]~=3.11", "ciso8601~=2.3", "orjson~=3.10"]
server = ["pynacl~=1.5"]

[project.urls]
"Documentation" = "https://docs.hikari-py.dev/en/stable"
"Source (GitHub)" = "https://github.com/hikari-py/hikari"
"Discord" = "https://discord.gg/Jx4cNGG"
"Issue Tracker" = "https://github.com/hikari-py/hikari/issues"
"CI" = "https://github.com/hikari-py/hikari/actions"

[dependency-groups]
audit = ["pip-audit"]
codespell = ["codespell==2.3.0"]
coverage = ["coverage[toml]==7.6.12"]
flake8 = [
"flake8==7.1.2",
#
# Plugins
# Ref: https://github.com/DmytroLitvinov/awesome-flake8-extensions
"flake8-bandit~=4.1.1", # runs bandit
"flake8-builtins==2.5.0", # builtin shadowing checks
"flake8-comprehensions==3.16.0", # comprehension checks
"flake8-docstrings==1.7.0", # pydocstyle support
"flake8-executable==2.1.3", # shebangs
"flake8-fixme==1.1.1", # "fix me" counter
"flake8-functions==0.0.8", # function linting
"flake8-html==0.4.3", # html output
"flake8-mutable==1.2.0", # mutable default argumet detection
"flake8-pep3101==2.1.0", # new-style format strings only
"flake8-print==5.0.0", # complain about print statements in code
"flake8-printf-formatting==1.1.2", # forbey printf-style python2 string formatting
"flake8-pytest-style==2.1.0", # pytest checks
"flake8-raise==0.0.5", # exception raising linting
"flake8-use-fstring==1.4", # format string checking
"flake8-noqa==1.4.0", # validate noqa commands
]
mkdocs = [
"mkdocs==1.6.1",
# Mkdocs Material
"mkdocs-material[imaging]==9.6.5",
# Docstring parsing for API reference
"mkdocstrings[python]==0.27.0",
"griffe-inherited-docstrings==1.1.1",
# Generate API reference pages dynamically
"mkdocs-gen-files==0.5.0",
"mkdocs-literate-nav==0.6.1",
# Minify
"mkdocs-minify-plugin==0.8.0",
# Towncrier draft changelogs
"mkdocs-towncrier==0.1.3",
# Image viewer ext
# "mkdocs-glightbox==0.3.7",
]
mypy = ["mypy[faster-cache]==1.15.0"]
pyright = ["pyright==1.1.395"]
pytest = [
"mock==5.1.0",
"pytest==8.3.4",
"pytest-asyncio==0.25.3",
"pytest-cov==6.0.0",
"pytest-randomly==3.16.0",
"async-timeout==5.0.1",
{ include-group = "coverage" },
]
release = ["twine==6.1.0"]
ruff = ["ruff==0.9.9"]
slotscheck = ["slotscheck==0.19.1"]
towncrier = ["towncrier==24.8.0"]

[tool.ruff]
line-length = 120
target-version = "py39"
Expand All @@ -43,10 +160,7 @@ parallel = true
branch = true
timid = false
source = ["hikari"]
omit = [
"hikari/__main__.py",
"hikari/cli.py",
]
omit = ["hikari/__main__.py", "hikari/cli.py"]

[tool.coverage.report]
precision = 2
Expand All @@ -71,16 +185,21 @@ exclude_lines = [

[tool.pyright]
include = ["hikari", "examples"]
exclude = ["examples/simple_dashboard.py", "**/__init__.py", "hikari/internal/enums.py", "hikari/internal/fast_protocol.py"]
exclude = [
"examples/simple_dashboard.py",
"**/__init__.py",
"hikari/internal/enums.py",
"hikari/internal/fast_protocol.py",
]
pythonVersion = "3.9"
typeCheckingMode = "strict"

reportUnnecessaryTypeIgnoreComment = "error"
reportMissingTypeStubs = "none"
reportImportCycles = "none" # Doesn't account for TYPE_CHECKING
reportIncompatibleMethodOverride = "none" # This relies on ordering for keyword-only arguments
reportOverlappingOverload = "none" # Type-Vars in last overloads may interfere
reportIncompatibleVariableOverride = "none" # Cannot overwrite abstract properties using attrs
reportImportCycles = "none" # Doesn't account for TYPE_CHECKING
reportIncompatibleMethodOverride = "none" # This relies on ordering for keyword-only arguments
reportOverlappingOverload = "none" # Type-Vars in last overloads may interfere
reportIncompatibleVariableOverride = "none" # Cannot overwrite abstract properties using attrs

# Attrs validators will always be unknown
# https://github.com/python-attrs/attrs/issues/795
Expand All @@ -103,8 +222,9 @@ norecursedirs = [
"public",
"ci",
]
# Treat warnings as errors
filterwarnings = [
"error", # Treat warnings as errors
"error",
"ignore:.*assertions not in test modules or plugins will be ignored .*:pytest.PytestConfigWarning",
]
required_plugins = ["pytest-asyncio"]
Expand All @@ -120,11 +240,11 @@ issue_format = "[#{issue}](https://github.com/hikari-py/hikari/issues/{issue})"
# We use these values for headers in the template
underlines = [2, 3]
type = [
{ name = "Breaking Changes", directory = "breaking", showcontent = true },
{ name = "Deprecation", directory = "deprecation", showcontent = true },
{ name = "Features", directory = "feature", showcontent = true },
{ name = "Bugfixes", directory = "bugfix", showcontent = true },
{ name = "Documentation Improvements", directory = "documentation", showcontent = true },
{ name = "Breaking Changes", directory = "breaking", showcontent = true },
{ name = "Deprecation", directory = "deprecation", showcontent = true },
{ name = "Features", directory = "feature", showcontent = true },
{ name = "Bugfixes", directory = "bugfix", showcontent = true },
{ name = "Documentation Improvements", directory = "documentation", showcontent = true },
]

[tool.mypy]
Expand All @@ -135,7 +255,7 @@ incremental = true
namespace_packages = true
no_implicit_optional = true
pretty = true
python_version = 3.9
python_version = "3.9"
show_column_numbers = true
show_error_codes = true
show_error_context = true
Expand Down
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion server-requirements.txt

This file was deleted.

Loading

0 comments on commit d3b1acb

Please sign in to comment.