Skip to content

Commit da968ce

Browse files
Merge branch 'master' into doc_requirements
2 parents 6628b08 + 97d0f2c commit da968ce

File tree

15 files changed

+83
-70
lines changed

15 files changed

+83
-70
lines changed

.github/workflows/docs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ jobs:
66
docs:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v3
10-
- uses: actions/setup-python@v3
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-python@v5
11+
with:
12+
python-version: '3.10'
1113
- name: Install dependencies
1214
run: |
1315
python -m pip install --upgrade pip
@@ -16,7 +18,7 @@ jobs:
1618
run: |
1719
sphinx-build -b html docs/source docs/build/html
1820
- name: Deploy
19-
uses: peaceiris/actions-gh-pages@v3
21+
uses: peaceiris/actions-gh-pages@v4
2022
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
2123
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/testing' }}
2224
with:

.github/workflows/pythonapp.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,21 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
steps:
21-
- uses: actions/checkout@v2
22-
- name: Set up Python 3.8
23-
uses: actions/setup-python@v1
21+
- uses: actions/checkout@v4
22+
- name: Set up Python 3.10
23+
uses: actions/setup-python@v5
2424
with:
25-
python-version: 3.8
25+
python-version: '3.10'
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
29-
pip install .
29+
pip install '.[dev]'
3030
- name: Lint with flake8
3131
run: |
32-
pip install flake8
3332
# stop the build if there are Python syntax errors or undefined names
3433
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
3534
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3635
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3736
- name: Test with pytest
3837
run: |
39-
pip install pytest
4038
pytest

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: ubuntu-22.04
55
tools:
6-
python: "3.9"
6+
python: "3.10"
77

88
python:
99
install:

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,13 @@ Despues instala el paquete en modo desarrollo en un virtualenv
2525
~~~bash
2626
virtualenv -p python3 venv
2727
source venv/bin/activate
28-
pip install -e .
28+
pip install -e '.[dev]'
2929
~~~
3030

3131
y estas listo para trabajar.
3232

3333
`pip install freezegun` para correr los tests.
3434

35-
### Python 3.12
36-
37-
`pip install setuptools`
38-
3935
## Testeo
4036

4137
Para correr el bot ejecutá (desde el virtualenv):

bin/run_bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
from pycamp_bot.commands import schedule
1414
from pycamp_bot.commands import announcements
1515
from pycamp_bot.commands import devtools
16+
from pycamp_bot.constants import SENTRY_DATA_SOURCE_NAME_ENVVAR
1617
from pycamp_bot.models import models_db_connection
1718
from pycamp_bot.logger import logger
1819

1920

20-
SENTRY_DATA_SOURCE_NAME_ENVVAR = 'SENTRY_DATA_SOURCE_NAME'
2121
if SENTRY_DATA_SOURCE_NAME_ENVVAR in os.environ:
2222
sentry_sdk.init(dsn=os.environ[SENTRY_DATA_SOURCE_NAME_ENVVAR])
2323

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3636

3737
html_theme = 'sphinx_rtd_theme'
38-
html_static_path = ['_static']
38+
# html_static_path = ['_static']
3939
# html_favicon = '_static/img/icon.svg'
4040
# html_logo = '_static/img/logo.png'
4141

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies = [
99
"munch==4.0.0",
1010
"python-telegram-bot==21.3",
1111
"peewee==3.17.5",
12-
"sentry-sdk==2.6.0",
12+
"sentry-sdk==2.8.0",
1313
]
1414
requires-python = "==3.10.*"
1515
authors = [
@@ -19,6 +19,11 @@ description = "Bot de telegram para organizar pycamp"
1919
readme = "README.md"
2020

2121
[project.optional-dependencies]
22+
dev = [
23+
"flake8==7.1.0",
24+
"freezegun==1.5.1",
25+
"pytest==8.2.2",
26+
]
2227
doc = [
2328
"sphinx==7.3.7",
2429
"sphinx_rtd_theme==2.0.0",

src/pycamp_bot/commands/auth.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from telegram.ext import CommandHandler
33
from pycamp_bot.models import Pycampista
44
from pycamp_bot.logger import logger
5+
from pycamp_bot.utils import escape_markdown
56

67

78
def get_admins_username():
@@ -84,8 +85,11 @@ async def revoke_admin(update, context):
8485
user = Pycampista.select().where(Pycampista.username == fallen_admin)[0]
8586
user.admin = False
8687
user.save()
87-
await context.bot.send_message(chat_id=chat_id,
88-
text='Un admin ha caido --{}--.'.format(fallen_admin))
88+
await context.bot.send_message(
89+
chat_id=chat_id,
90+
text=f'Un admin ha caído ~{escape_markdown(fallen_admin)}~\\.',
91+
parse_mode='MarkdownV2',
92+
)
8993

9094

9195
async def list_admins(update, context):

src/pycamp_bot/commands/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async def start(update, context):
3232

3333
async def help(update, context):
3434
logger.info('Returning help message')
35-
await context.bot.send_message(chat_id=update.message.chat_id, text=get_help(update, context), parse_mode='Markdown')
35+
await context.bot.send_message(chat_id=update.message.chat_id, text=get_help(update, context), parse_mode='MarkdownV2')
3636

3737

3838
# async def error(update, context):

0 commit comments

Comments
 (0)