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
14 changes: 2 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ jobs:
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade -r requirements.txt
python -m pip install --upgrade -r requirements-dev.txt
python -m pip install -e ".[dev]"

- name: Test with pytest
id: test
Expand All @@ -76,16 +75,7 @@ jobs:
REDDIT_USERNAME: ${{ vars.REDDIT_USERNAME }}
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }}
shell: bash
run: |
python -m pytest \
-rxXs \
--tb=native \
--verbose \
--color=yes \
--cov=src \
--junitxml=junit.xml \
-o junit_family=legacy \
tests
run: python -m pytest tests

- name: Upload test coverage
# any except canceled or skipped
Expand Down
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ RUN <<_SETUP
#!/bin/bash
set -e

# replace the version in the code
sed -i "s/version = '0.0.0'/version = '${BUILD_VERSION}'/g" src/common/common.py
# write the version to the version file
cat > src/common/version.py <<EOF
"""Version information for support-bot."""

__version__ = "${BUILD_VERSION}"
EOF

# install dependencies
python -m pip install --no-cache-dir -r requirements.txt
python -m pip install --no-cache-dir .
_SETUP

CMD ["python", "-m", "src"]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ platforms such as GitHub discussions/issues might be added in the future.
| SUPPORT_COMMANDS_REPO | False | `https://github.com/LizardByte/support-bot-commands` | Repository for support commands. |
| SUPPORT_COMMANDS_BRANCH | False | `master` | Branch for support commands. |

### Install

Install the project and its dependencies:

```bash
python -m pip install -e .
```

For development (includes test dependencies):

```bash
python -m pip install -e ".[dev]"
```

### Start

```bash
Expand Down
97 changes: 97 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "support-bot"
dynamic = ["version"]
description = "Support bot written in python to help manage LizardByte communities"
readme = "README.md"
requires-python = ">=3.12"
license = {text = "AGPL-3.0-only"}
authors = [
{name = "LizardByte", email = "lizardbyte@users.noreply.github.com"}
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
]

dependencies = [
"cryptography==46.0.5",
"Flask==3.1.2",
"GitPython==3.1.46",
"libgravatar==1.0.4",
"mistletoe==1.5.1",
"praw==7.8.1",
"py-cord==2.6.1",
"python-dotenv==1.2.1",
"requests==2.32.5",
"requests-oauthlib==2.0.0",
"tinydb==4.8.2",
]

[project.optional-dependencies]
dev = [
"betamax==0.9.0",
"betamax-serializers==0.2.1",
"pytest==9.0.2",
"pytest-asyncio==1.3.0",
"pytest-cov==7.0.0",
"pytest-mock==3.15.1",
]

[project.urls]
Homepage = "https://github.com/LizardByte/support-bot"
Repository = "https://github.com/LizardByte/support-bot"
Issues = "https://github.com/LizardByte/support-bot/issues"

[tool.setuptools]
packages = ["src"]

[tool.setuptools.dynamic]
version = {attr = "src.common.version.__version__"}

[tool.setuptools.package-data]
"*" = ["*.md", "*.txt"]

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-rxXs",
"--tb=native",
"--verbose",
"--color=yes",
"--cov=src",
"--cov-report=term-missing",
"--junitxml=junit.xml",
"-o", "junit_family=legacy",
]
markers = [
"unit: Unit tests",
"integration: Integration tests",
]

[tool.coverage.run]
source = ["src"]
omit = [
"*/tests/*",
"*/__pycache__/*",
]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]
6 changes: 0 additions & 6 deletions requirements-dev.txt

This file was deleted.

11 changes: 0 additions & 11 deletions requirements.txt

This file was deleted.

5 changes: 4 additions & 1 deletion src/common/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
from libgravatar import Gravatar
import requests

# local imports
from src.common.version import __version__


colors = {
'black': 0x000000,
Expand Down Expand Up @@ -66,4 +69,4 @@ def get_app_dirs():
bot_name = f'{org_name}-Bot'
bot_url = 'https://app.lizardbyte.dev'
app_dir, data_dir = get_app_dirs()
version = '0.0.0'
version = __version__
3 changes: 3 additions & 0 deletions src/common/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Version information for support-bot."""

__version__ = "0.0.0"