Skip to content

Commit

Permalink
telegram-text v0.1.1 (#23)
Browse files Browse the repository at this point in the history
* Add `__radd__` method
* Update typehints according to mypy
  • Loading branch information
SKY-ALIN authored Dec 29, 2022
1 parent 9ed12ba commit 24b9572
Show file tree
Hide file tree
Showing 23 changed files with 390 additions and 394 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
1 change: 1 addition & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ jobs:
source .venv/bin/activate
flake8 telegram_text
find . -iname "*.py" -not -path "./.venv/*" -not -path "./docs/*" | xargs pylint
mypy telegram_text
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
fail_ci_if_error: false
10 changes: 10 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
multi_line_output=9
line_length=120
force_sort_within_sections=True
lexicographical=True
order_by_type=False
group_by_package=True
combine_as_imports=True
known_typing=typing
sections=FUTURE,TYPING,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
4 changes: 4 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[mypy]

[mypy-telebot]
ignore_missing_imports = True
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.1 (30.12.2022)
* Add `__radd__` method
* Update typehints according to mypy

## 0.1.0 (11.05.2022)
* Add `telegram_text.bases` submodule
* `Chain`
Expand Down
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
lint:
no: # Replace `Optional[T]` with `Union[T, None]`
find telegram_text -iname "*.py" | xargs python -m no_optional
find tests -iname "*.py" | xargs python -m no_optional
isort: # Sort import statements
isort .
lint: # Check code quality
flake8
find . -iname "*.py" -not -path "./.venv/*" -not -path "./docs/*" | xargs pylint
test:
find telegram_text tests -iname "*.py" | xargs pylint
mypy .
test: # Run tests
pytest --cov=telegram_text tests/
html_docs:
html_docs: # Build html docs
cd docs/ && $(MAKE) clean && $(MAKE) html
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ markup fast and render it to specific _html_ and _MarkdownV2_ formats.**
### Installation
Install using `pip install telegram-text` or `poetry add telegram-text`

Also, `telegram-text` is integrated into following packages:

| Module | Installation | Import | Documentation |
| ------ | ------------ | ------ | ------------- |
| [OrigamiBot](https://github.com/cmd410/OrigamiBot) | `pip install origamibot[telegram-text]` | `from origamibot.text import ...` | [Release](https://github.com/cmd410/OrigamiBot/releases/tag/v2.3.0) |
| [TGramBot](https://github.com/KeralaBots/TGramBot) | `pip install tgrambot` | `from tgrambot.text import ...` | [Readme](https://github.com/KeralaBots/TGramBot/blob/alpha/README.md) |

### Basic Example

```python
Expand Down
5 changes: 3 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import os
import sys

sys.path.insert(0, os.path.abspath('../../'))


Expand All @@ -22,7 +23,7 @@
author = 'Vladimir Alinsky'

# The full version, including alpha/beta/rc tags
release = '0.1.0'
release = '0.1.1'


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -50,7 +51,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
exclude_patterns = [] # type: ignore


# -- Options for HTML output -------------------------------------------------
Expand Down
19 changes: 19 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,25 @@ Installation

Install using :code:`pip install telegram-text` or :code:`poetry add telegram-text`.

Also, :code:`telegram-text` is integrated into following packages:

.. list-table::
:align: center
:header-rows: 1

* - Module
- Installation
- Import
- Documentation
* - `OrigamiBot <https://github.com/cmd410/OrigamiBot>`_
- :code:`pip install origamibot[telegram-text]`
- :code:`from origamibot.text import ...`
- `Release <https://github.com/cmd410/OrigamiBot/releases/tag/v2.3.0>`_
* - `TGramBot <https://github.com/KeralaBots/TGramBot>`_
- :code:`pip install tgrambot`
- :code:`from tgrambot.text import ...`
- `Readme <https://github.com/KeralaBots/TGramBot/blob/alpha/README.md>`_


Basic Example
-------------
Expand Down
6 changes: 4 additions & 2 deletions docs/source/user_guide/code_example.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import os
from typing import Optional, Tuple
from time import time

from datetime import datetime
import os
from time import time

from telebot import TeleBot

from telegram_text import Bold, Chain, Code, InlineCode, Italic, Underline

API_TOKEN = os.getenv('API_TOKEN') # Your bot secret token
Expand Down
Loading

0 comments on commit 24b9572

Please sign in to comment.