Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Python Tests

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Create database directory
run: |
mkdir -p db
mkdir -p tests

- name: Run tests
run: |
pytest tests/ --cov=. --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: false
43 changes: 42 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,42 @@
db/tobedo.sqlite3
# Database files
db/tobedo.sqlite3
*.sqlite3

# IDE files
.idea/
.vscode/
*.swp
*.swo

# Virtual environments
venv/
venv310/
.venv/
env/

# Python bytecode
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
dist/
build/
*.egg-info/

# Unit test / coverage reports
.coverage
.coverage.*
coverage.xml
*.cover
.pytest_cache/

# Logs
*.log

# Environment variables
.env

# OS specific files
.DS_Store
Thumbs.db
34 changes: 33 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ Want to use the deployed version?
2) Make tobedo_bot a group admin so he can read the messages
3) The bot will automatically turn any messages into a checklist, parsing line by line

## Features

- Create checklists from any message
- Toggle items by clicking on them
- View all your todo items with `/todos`
- View only incomplete items with `/pending`
- View only completed items with `/completed`

# Deploy own instance of bot

If you want to extend functionality, you can fork this repo and redeploy the bot.
Expand All @@ -31,7 +39,7 @@ docker run -e TG_TOKEN=<your token> -v /volumes/tobedo/:/code/db/ devforth/tobed
Compose example:

```yaml
version: '3.3'
version: '3.3'

services:
tobedo:
Expand All @@ -41,3 +49,27 @@ services:
volumes:
- /volumes/tobedo/:/code/db/
```

## Development

### Running Tests

To run the tests, you need to have Python 3.10 or higher installed. Then, you can run the tests with:

```sh
# Install dependencies
pip install -r requirements.txt

# Run tests
python run_tests.py
```

Or using pytest directly:

```sh
python -m pytest tests/ --cov=.
```

### GitHub Actions

This project uses GitHub Actions to run tests automatically on every push and pull request. The workflow is defined in `.github/workflows/python-tests.yml`.
13 changes: 13 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-

# Create a mock Filters class for testing
class Filters:
class command:
@staticmethod
def filter(update):
return update.message and update.message.text and update.message.text.startswith('/')

def __invert__(self):
return ~self

Filters = Filters()
Loading