Skip to content
Merged
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
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
max_line_length = 120
13 changes: 11 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- master

jobs:
test:
ci:
runs-on: ubuntu-latest

steps:
Expand All @@ -23,8 +23,17 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install -e .[dev]

- name: Run tests
run: |
pytest

- name: Run linters
run: |
black --check .
autoflake --check --recursive .

- name: Run mypy
run: |
mypy .
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ env
*.log
*.egg-info

__pycache__
__pycache__
.history
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ COPY src /app/src

RUN pip install -e .

CMD ["python3", "src/bakabot/main.py"]
CMD ["python3", "-m", "src.main"]
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,34 +41,36 @@ And urls in these:

1. Clone the repository
2. Setup your `.env` file from `.env.example`
* Guide on how to get the YOUR DISCORD TOKEN can be found [here](https://www.writebots.com/discord-bot-token/).
* Aditionally you have to turn on all three options under "Privileged Gateway Intents" which can be found under the Bot option on left hand side.
* Guide on how to get the YOUR DISCORD ID can be found [here](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID).
3. Create a virtual environment *(not required, but well recommended)*
- Guide on how to get the YOUR DISCORD TOKEN can be found [here](https://www.writebots.com/discord-bot-token/).
- Aditionally you have to turn on all three options under "Privileged Gateway Intents" which can be found under the Bot option on left hand side.
- Guide on how to get the YOUR DISCORD ID can be found [here](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID).
3. Create a virtual environment _(not required, but well recommended)_

```sh
python -m venv env
```

4. Start the virtual environment

```sh
env\Scripts\activate.bat
```
5. Install all dependencies

5. Install dependencies
```sh
pip install -e .
```
_(If you're contributing to the project, install development dependencies:)_
```sh
pip install -e .[dev]
```
6. Install Playwright

```sh
playwright install
```

7. Start the bot
```sh
python src/BakaBot/main.py
python -m src.main
```








48 changes: 40 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
pythonpath = [
"src/bakabot"
]
[project]
name = "bakabot"
description = "Discord bot used for extracting information from Bakalari"
authors = [{ name = "Lukáš Průša" }]
license = { file = "LICENSE" }
requires-python = ">=3.8"
dynamic = ["version"]

dependencies = [
"playwright",
"disnake",
"bs4",
"python-dotenv",
"pytz",
"setuptools",
]

[project.optional-dependencies]
dev = [
# Types
"mypy",
"types-setuptools",
"types-pytz",
"types-beautifulsoup4",
# Pytest
"pytest",
"pytest-mock",
# Linters
"black",
"autoflake",
]

[tool.black]
line-length = 120

[tool.mypy]
strict = true

[tool.autoflake]
remove-all-unused-imports = true
25 changes: 0 additions & 25 deletions setup.cfg

This file was deleted.

File renamed without changes.
174 changes: 0 additions & 174 deletions src/bakabot/core/predictor.py

This file was deleted.

Loading
Loading