-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
239 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
# Installing TwitchIO | ||
|
||
**TwitchIO 3 currently supports the following [Python](https://www.python.org/downloads/) versions:** | ||
|
||
|
||
| Python Version | Status | Notes | | ||
| ----------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | | ||
| **`<= 3.9`** | :fontawesome-solid-triangle-exclamation:{ .icon-warning .pythonista-tag title="Unsupported"} | Unsupported | | ||
| **`3.10, 3.11, 3.12`** | :fontawesome-solid-check:{ .icon-check .pythonista-tag title="Supported" } | Supported | | ||
| **`3.13`** | :fontawesome-solid-question:{ .icon-unknown .pythonista-tag title="Unknown" } | Unknown | | ||
|
||
|
||
## Virtual Environments | ||
|
||
TwitchIO recommends the use of Virtual Environments (venvs). | ||
|
||
You can read more about [Virtual Environments here.](https://realpython.com/python-virtual-environments-a-primer/) | ||
Below are some simple commands to help you get started with a **venv** and TwitchIO. | ||
|
||
=== "Windows" | ||
|
||
``` shell | ||
# Change into your projects root directory or open a terminal there... | ||
cd path/to/project | ||
|
||
# Create the virtual environment... | ||
# Replace 3.10 with the Python version you want to use... | ||
# You can check what Python versions you have installed with: | ||
# py -0 | ||
py -3.10 -m venv venv | ||
|
||
# Activate your venv... | ||
# Everytime you want to use your venv in a new terminal you should run this command... | ||
# You will know your venv is activated if you see the (venv) prefix in your terminal... | ||
venv/Scripts/Activate | ||
|
||
# Install your packages... | ||
pip install -U twitchio | ||
|
||
# You can use your venv python while it's activated simply by running py | ||
# E.g. py main.py | ||
# E.g. py --version | ||
py main.py | ||
|
||
# You can deactivate your venv in this terminal with | ||
deactivate | ||
|
||
# REMEMBER! | ||
# You have to re-activate your venv whenever it is deactivated to use for it for you project... | ||
# You will know your venv is activated by looking for the (venv) prefix in your terminal | ||
``` | ||
|
||
|
||
=== "Linux & MacOS" | ||
|
||
``` shell | ||
# Change into your projects root directory or open a terminal there... | ||
cd path/to/project | ||
|
||
# Create the virtual environment... | ||
# Replace 3.10 with the Python version you want to use... | ||
python3.10 -m venv venv | ||
|
||
# Activate your venv... | ||
# Everytime you want to use your venv in a new terminal you should run this command... | ||
# You will know your venv is activated if you see the (venv) prefix in your terminal... | ||
source venv/bin/activate | ||
|
||
# Install your packages... | ||
pip install -U twitchio | ||
|
||
# You can use your venv python while it's activated simply by running python | ||
# E.g. python main.py | ||
# E.g. python --version | ||
python main.py | ||
|
||
# You can deactivate your venv in this terminal with | ||
deactivate | ||
|
||
# REMEMBER! | ||
# You have to re-activate your venv whenever it is deactivated to use for it for you project... | ||
# You will know your venv is activated by looking for the (venv) prefix in your terminal | ||
``` | ||
|
||
|
||
## Extra and Optional Dependencies | ||
|
||
To use certain optional features of TwitchIO you will have to install the required packages needed to run them. | ||
|
||
The following commands can be used to install TwitchIO with optional features: | ||
|
||
**To use the StarletteAdapter**: | ||
```shell | ||
pip install -U twitchio[starlette] | ||
``` | ||
|
||
**For development purposes**: | ||
```shell | ||
pip install -U twitchio[dev] | ||
``` | ||
|
||
**For documentation puposes**: | ||
```shell | ||
pip install -U twitchio[docs] | ||
``` | ||
|
||
|
||
## Custom Index | ||
|
||
Using TwitchIO with `Python >= 3.12` may require the use of a custom pip index. | ||
|
||
The index allows pip to fetch pre-built wheels for some dependencies that may require build-tools for C/C++ due to not having released their own wheels for recent versions of Python. | ||
|
||
Usually with time, dependencies will eventually release wheels for new Python releases. | ||
|
||
For convenience we provide an index thanks to [Abstract Umbra](https://github.com/AbstractUmbra) | ||
|
||
**To install with prebuilt wheels:** | ||
``` shell | ||
pip install -U twitchio --extra-index-url https://pip.pythonista.gg | ||
|
||
``` | ||
|
||
## Installation Issues | ||
Make sure you have the latest version of Python installed, or if you prefer, a Python version of 3.10 or greater. | ||
|
||
If you have any other issues feel free to search for duplicates and then create a new issue on [GitHub](https://github.com/PythonistaGuild/twitchio) with as much detail as possible. Including providing the output of pip, your OS details and Python version. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mkdocs-material | ||
-i https://pypi.pythonista.gg/simple | ||
griffe | ||
mkdocstrings-python | ||
mkdocstrings | ||
mkdocs-material |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 21 additions & 90 deletions
111
docs/templates/python/material/docstring/attributes.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,21 @@ | ||
{{ log.debug("Rendering attributes section") }} | ||
|
||
{% import "language.html" as lang with context %} | ||
|
||
{% if config.docstring_section_style == "table" %} | ||
{% block table_style %} | ||
<p><strong>{{ section.title or lang.t("Attributes:") }}</strong></p> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>{{ lang.t("Name") }}</th> | ||
<th>{{ lang.t("Type") }}</th> | ||
<th>{{ lang.t("Description") }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for attribute in section.value %} | ||
<tr> | ||
<td><code>{{ attribute.name }}</code></td> | ||
<td> | ||
{% if attribute.annotation %} | ||
{% with expression = attribute.annotation %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
{% endif %} | ||
</td> | ||
<td> | ||
<div class="doc-md-description"> | ||
{{ attribute.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endblock table_style %} | ||
{% elif config.docstring_section_style == "list" %} | ||
{% block list_style %} | ||
<p class="pythonista-docs-heading">{{ section.title or lang.t("Attributes:") }}</p> | ||
<ul> | ||
{% for attribute in section.value %} | ||
<li class="field-body"> | ||
<b>{{ attribute.name }}</b> | ||
{% if attribute.annotation %} | ||
{% with expression = attribute.annotation %} | ||
(<code>{% include "expression.html" with context %}</code>) | ||
{% endwith %} | ||
{% endif %} | ||
– | ||
<div class="doc-md-description"> | ||
{{ attribute.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endblock list_style %} | ||
{% elif config.docstring_section_style == "spacy" %} | ||
{% block spacy_style %} | ||
<table> | ||
<thead> | ||
<tr> | ||
<th><b>{{ (section.title or lang.t("ATTRIBUTE")).rstrip(":").upper() }}</b></th> | ||
<th><b>{{ lang.t("DESCRIPTION") }}</b></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for attribute in section.value %} | ||
<tr> | ||
<td><code>{{ attribute.name }}</code></td> | ||
<td class="doc-attribute-details"> | ||
<div class="doc-md-description"> | ||
{{ attribute.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
<p> | ||
{% if attribute.annotation %} | ||
<span class="doc-attribute-annotation"> | ||
<b>TYPE:</b> | ||
{% with expression = attribute.annotation %} | ||
<code>{% include "expression.html" with context %}</code> | ||
{% endwith %} | ||
</span> | ||
{% endif %} | ||
</p> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endblock spacy_style %} | ||
{% endif %} | ||
{% extends "_base/docstring/attributes.html" %} | ||
{% block contents %} | ||
{% block list_style scoped %} | ||
<ul> | ||
{% for attribute in section.value %} | ||
<li class="field-body"> | ||
<b><code><a href="#{{ obj.path }}.{{ attribute.name }}" data-autorefs-optional-hover="{{ obj.path }}.{{ attribute.name }}">{{ attribute.name }}</a></code></b> | ||
{% if attribute.annotation %} | ||
{% with expression = attribute.annotation %} | ||
(<code>{% include "expression.html" with context %}</code>) | ||
{% endwith %} | ||
{% endif %} | ||
– | ||
<div class="doc-md-description"> | ||
{{ attribute.description|convert_markdown(heading_level, html_id) }} | ||
</div> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endblock list_style %} | ||
{% endblock contents %} |
Oops, something went wrong.