Skip to content

Commit

Permalink
release: now open source
Browse files Browse the repository at this point in the history
Co-authored-by: bluefcat <[email protected]>
Co-authored-by: cuizzang <[email protected]>
  • Loading branch information
3 people committed Feb 14, 2023
0 parents commit 8c15034
Show file tree
Hide file tree
Showing 74 changed files with 4,417 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @team-crescendo/rena-staff
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: CI

on:
push:
branches: [main]
paths-ignore: "**.md"

pull_request:
branches: [main]
paths-ignore: "**.md"

release:
types: [published]

jobs:

style:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Setup python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup poetry
run: |
python -m pip install pip
pip install poetry
#add path for poetry
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install --no-interaction --with style
- name: Check style with black
run: poetry run black --check .
- name: Check style with isort
run: poetry run isort --check .

type:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Setup python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup poetry
run: |
python -m pip install pip
pip install poetry
#add path for poetry
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install --no-interaction --with type
- name: Check type
run: poetry run mypy ./crenata

test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: test
POSTGRES_DB: rena
ports:
- 127.0.0.1:5432:5432
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Setup python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Setup poetry
run: |
python -m pip install pip
pip install poetry
#add path for poetry
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install --no-interaction --with test
- name: Check test
run: poetry run pytest --asyncio-mode=auto





160 changes: 160 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-python.vscode-pylance",
"ms-python.python"
]
}
33 changes: 33 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"python.poetryPath": "poetry",
"python.analysis.typeCheckingMode": "strict",
"python.formatting.provider": "black",
"python.linting.mypyEnabled": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.formatOnSave": true,
"python.testing.pytestArgs": [
"tests",
"--asyncio-mode=auto"
],
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestEnabled": true,
"python.envFile": "${workspaceFolder}/.env",
"cSpell.words": [
"aiohttp",
"ATPT",
"checkfirst",
"Crenata",
"distutil",
"MLSV",
"MMEAL",
"Neispy",
"OFCDC",
"pydantic",
"pyright",
"sqlalchemy"
],
"python.linting.enabled": false,
}
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BSD 3-Clause License

Copyright (c) 2023, Team Crescendo

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 🌲 Crenata

[![Code Style](https://img.shields.io/badge/code%20style-black-black)](https://github.com/psf/black)

Crenata는 모든 학생들이 편한 학교생활을 경험할 수 있는것을 목표로하는 오픈소스 프로젝트 디스코드 봇입니다.

소스의 문서는 [docs/README.md](docs/README.md)를 참고해주세요.
23 changes: 23 additions & 0 deletions crenata/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""
MIT License
Copyright (c) 2022 Team Crescendo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
24 changes: 24 additions & 0 deletions crenata/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from argparse import ArgumentParser
from sys import argv

from crenata.argparser import parse_args
from crenata.config import CrenataConfig
from crenata.discord.client import create_client
from crenata.discord.commands import commands
from crenata.discord.events.error import on_error
from discord import Intents, Object

if __name__ == "__main__":
config = CrenataConfig()
parser = ArgumentParser("crenata")
args = parse_args(parser, argv[1:])
config.update_with_args(args)

client = create_client(config, intents=Intents.default())
for command in commands:
if config.PRODUCTION:
client.tree.add_command(command) # type: ignore
else:
client.tree.add_command(command, guild=Object(config.TEST_GUILD_ID)) # type: ignore
setattr(client.tree, "on_error", on_error)
client.run()
Empty file added crenata/abc/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions crenata/abc/domain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from abc import ABC


class AbstractDomain(ABC):
...
Loading

0 comments on commit 8c15034

Please sign in to comment.