Skip to content

Commit

Permalink
Migrate to pyproject.toml for dependencies and build
Browse files Browse the repository at this point in the history
  • Loading branch information
tandemdude committed Feb 25, 2024
1 parent 8538fd8 commit e3beed3
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 121 deletions.
7 changes: 5 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ build:
# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: requirements.txt
- requirements: dev-requirements/docs.txt
- method: pip
path: .
extra_requirements:
- crontrigger
- dev.docs
2 changes: 0 additions & 2 deletions crontrigger_requirements.txt

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

3 changes: 0 additions & 3 deletions dev_requirements.txt

This file was deleted.

2 changes: 2 additions & 0 deletions lightbulb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
"""A simple-to-use command handler for Hikari."""

from lightbulb import exceptions
from lightbulb import utils
from lightbulb.client import *
Expand Down
16 changes: 5 additions & 11 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,38 +37,32 @@

@nox.session()
def format_fix(session):
session.install("-Ur", "dev-requirements/formatting.txt")
session.install(".[crontrigger,dev.format]")
session.run("python", "-m", "ruff", "format", *SCRIPT_PATHS)
session.run("python", "-m", "ruff", "--fix", *SCRIPT_PATHS)


@nox.session()
def format_check(session: nox.Session):
session.install("-Ur", "dev-requirements/formatting.txt")
session.install(".[crontrigger,dev.format]")
session.run("python", "-m", "ruff", "format", *SCRIPT_PATHS, "--check")
session.run("python", "-m", "ruff", "--output-format", "github", *SCRIPT_PATHS)


@nox.session()
def typecheck(session: nox.Session):
session.install("-Ur", "requirements.txt")
session.install("-Ur", "crontrigger_requirements.txt")
session.install("-Ur", "dev-requirements/pyright.txt")
session.install(".[crontrigger,dev.typecheck]")
session.run("python", "-m", "pyright")


@nox.session()
def slotscheck(session: nox.Session):
session.install("-Ur", "requirements.txt")
session.install("-Ur", "crontrigger_requirements.txt")
session.install("-Ur", "dev-requirements/slotscheck.txt")
session.install(".[crontrigger,dev.slotscheck]")
session.run("python", "-m", "slotscheck", "-m", "lightbulb")


@nox.session(reuse_venv=True)
def sphinx(session: nox.Session):
session.install("-Ur", "dev-requirements/docs.txt")
session.install("-Ur", "crontrigger_requirements.txt")
session.install("-Ur", "requirements.txt")
session.install(".[crontrigger,dev.docs]")
session.run("python", "./scripts/docs/api_reference_generator.py")
session.run("python", "-m", "sphinx.cmd.build", "docs/source", "docs/build", "-b", "html")
48 changes: 46 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,50 @@
[build-system]
requires = ["wheel", "setuptools"]
build-backend = "setuptools.build_meta"
requires = ["flit_core >=3.9,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "hikari-lightbulb"
readme = "README.md"
requires-python = ">=3.10.0,<3.13"
license = {file = "LICENSE"}
authors = [{name = "tandemdude", email = "tandemdude1@gmail.com"}]
keywords = ["hikari"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Framework :: AsyncIO",
"Intended Audience :: Developers",
"Natural Language :: English",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = ["hikari>=2.0.0.dev122, <3", "typing-extensions>=4.9.0, <5", "svcs>=23.21.0, <24"]
dynamic = ["version", "description"]

[project.urls]
Homepage = "https://github.com/tandemdude/hikari-lightbulb"
Repository = "https://github.com/tandemdude/hikari-lightbulb"
Documentation = "https://hikari-lightbulb.readthedocs.io/en/latest/"
Changelog = "https://hikari-lightbulb.readthedocs.io/en/latest/changelog.html"

[project.optional-dependencies]
crontrigger = ["croniter>=2.0.1, <3", "types-croniter>=2.0.0, <3"]
dev = ["nox==2023.4.22"]
"dev.docs" = ["sphinx>=7.2.6, <8", "furo==2024.1.29"]
"dev.format" = ["ruff>=0.2.1, <1"]
"dev.typecheck" = ["pyright>=1.1.350, <2"]
"dev.slotscheck" = ["slotscheck>=0.17.3, <1"]

[tool.flit.module]
name = "lightbulb"

[tool.black]
line-length = 120
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

93 changes: 0 additions & 93 deletions setup.py

This file was deleted.

0 comments on commit e3beed3

Please sign in to comment.