Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
guangrei committed Jan 30, 2024
1 parent 05fb9f0 commit 59461b6
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Test

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry && poetry update
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31 changes: 31 additions & 0 deletions .github/workflows/release_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: build

on:
push:
tags:
- "v*"

jobs:
build-n-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"

- name: Build source and wheel distributions
run: |
pip install --upgrade build twine
python -m build
twine check --strict dist/*
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![status workflow test](https://github.com/cirebon-dev/TelegramSDK/actions/workflows/python-app.yml/badge.svg)](https://github.com/cirebon-dev/TelegramSDK/actions)
[![status workflow build](https://github.com/cirebon-dev/TelegramSDK/actions/workflows/release_to_pypi.yml/badge.svg)](https://github.com/cirebon-dev/TelegramSDK/actions)
[![Downloads](https://static.pepy.tech/badge/TelSDK)](https://pepy.tech/project/TelSDK)

# TelegramSDK

Expand Down
2 changes: 1 addition & 1 deletion TelegramSDK/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def reply_message(*args, **kwargs):

def reply_file(path, **kwargs):
"""
Use this method to quick reply with document.
Use this method to quick reply with file.
"""
kwargs["chat_id"] = telegram.data.message.chat.id
kwargs["document"] = path
Expand Down
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tool.poetry]
name = "telegramsdk"
version = "0.1.0"
description = "Synchronous Telegram bot SDK for python 2 & 3"
authors = ["guangrei"]
license = "mit"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
requests = "^2.31.0"
zcache = "^1.0.1"


[tool.poetry.group.dev.dependencies]
flake8 = "^7.0.0"
black = "^24.1.1"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 59461b6

Please sign in to comment.