Skip to content

Commit

Permalink
Initial code base
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed Jan 25, 2024
1 parent ddb0e7f commit 22e12d4
Show file tree
Hide file tree
Showing 4 changed files with 180 additions and 35 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/coverage_and_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Type Coverage and Linting

on:
push:
branches:
- dev/3.0

jobs:
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.x"]

name: "Type Coverage and Linting @ ${{ matrix.python-version }}"
steps:
- name: "Checkout Repository"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Setup Python @ ${{ matrix.python-version }}"
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
cache: "pip"

- name: "Install Python deps @ ${{ matrix.python-version }}"
id: install-deps
run: |
pip install -U -r requirements.txt
- name: "Run Pyright @ ${{ matrix.python-version }}"
uses: jakebailey/pyright-action@v1
with:
no-comments: ${{ matrix.python-version != '3.x' }}
warnings: false

- name: Lint
if: ${{ always() && steps.install-deps.outcome == 'success' }}
uses: github/super-linter/slim@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BRANCH: dev/3.0
VALIDATE_ALL_CODEBASE: false
VALIDATE_PYTHON_BLACK: true
VALIDATE_PYTHON_ISORT: true
LINTER_RULES_PATH: /
PYTHON_ISORT_CONFIG_FILE: pyproject.toml
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
111 changes: 111 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
[build-system]
requires = ["setuptools", "wheel", "setuptools-git-versioning<2"]
build-backend = "setuptools.build_meta"

[tool.setuptools-git-versioning]
enabled = true
starting_version = "3.0.0.dev0"

[project]
name = "twitchio"
authors = [
{ name="PythonistaGuild" },
]
dynamic = ["dependencies", "version"]
description = "A fully asynchronous and modern Python wrapper around the Twitch API."
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
]

[project.urls]
"Homepage" = "https://github.com/PythonistaGuild/TwitchIO"

[tool.setuptools]
packages = ["twitchio", "twitchio.types"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[project.optional-dependencies]
docs = [
"mkdocs-material",
"mkdocstrings-python",
"mkdocstrings",
]

dev = [
"ruff",
"pyright",
"isort",
]

[tool.ruff]
line-length = 120
exclude = ["venv"]
select = [
"C4",
"F",
"G",
"I",
"PTH",
"RUF",
"SIM",
"TCH",
"UP",
"W",
"PERF",
"ANN",
]
ignore = [
"F401",
"F402",
"F403",
"F405",
"PERF203",
"RUF001",
"RUF009",
"SIM105",
"UP034",
"UP038",
"ANN101",
"ANN102",
"ANN401",
"UP031",
"PTH123",
]

[tool.ruff.isort]
split-on-trailing-comma = true
combine-as-imports = true
lines-after-imports = 2

[tool.ruff.flake8-annotations]
allow-star-arg-any = true

[tool.ruff.flake8-quotes]
inline-quotes = "double"

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[tool.pyright]
exclude = ["venv"]
useLibraryCodeForTypes = true
typeCheckingMode = "strict"
reportImportCycles = false
reportPrivateUsage = false
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
aiohttp>=3.6.0,<4
iso8601
typing-extensions
aiohttp>=3.9.1,<4
49 changes: 17 additions & 32 deletions twitchio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,27 @@
# -*- coding: utf-8 -*-

"""
The MIT License (MIT)
MIT License
Copyright (c) 2017-present TwitchIO
Copyright (c) 2017 - Present PythonistaGuild
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
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.
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.
"""

__title__ = "TwitchIO"
__author__ = "TwitchIO, PythonistaGuild"
__author__ = "PythonistaGuild"
__license__ = "MIT"
__copyright__ = "Copyright 2017-2022 (c) TwitchIO"
__version__ = "2.8.2"

from .client import Client
from .user import *
from .channel import Channel
from .chatter import Chatter, PartialChatter
from .enums import *
from .errors import *
from .message import Message, HypeChatData
from .models import *
from .rewards import *
from .utils import *
__copyright__ = "Copyright 2017-Present (c) TwitchIO, PythonistaGuild"

0 comments on commit 22e12d4

Please sign in to comment.