Skip to content
Open
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
35 changes: 35 additions & 0 deletions ornate-orbits/.github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# GitHub Action workflow enforcing our code style.

name: Lint

# Trigger the workflow on both push (to the main repository, on the main branch)
# and pull requests (against the main repository, but from any repo, from any branch).
on:
push:
branches:
- main
pull_request:

# Brand new concurrency setting! This ensures that not more than one run can be triggered for the same commit.
# It is useful for pull requests coming from the main repository since both triggers will match.
concurrency: lint-${{ github.sha }}

jobs:
lint:
runs-on: ubuntu-latest

env:
# The Python version your project uses. Feel free to change this if required.
PYTHON_VERSION: "3.12"

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Run pre-commit hooks
uses: pre-commit/action@v3.0.1
31 changes: 31 additions & 0 deletions ornate-orbits/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Files generated by the interpreter
__pycache__/
*.py[cod]

# Environment specific
.venv
venv
.env
env

# Unittest reports
.coverage*

# Logs
*.log

# PyEnv version selector
.python-version

# Built objects
*.so
dist/
build/

# IDEs
# PyCharm
.idea/
# VSCode
.vscode/
# MacOS
.DS_Store
18 changes: 18 additions & 0 deletions ornate-orbits/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Pre-commit configuration.
# See https://github.com/python-discord/code-jam-template/tree/main#pre-commit-run-linting-before-committing

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
hooks:
- id: ruff
- id: ruff-format
7 changes: 7 additions & 0 deletions ornate-orbits/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2021 Python Discord

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.
13 changes: 13 additions & 0 deletions ornate-orbits/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.PHONY: tc
tc:
@python -m mypy .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to add Mypy to CI/Github Actions too



.PHONY: test
test:
@python -m pytest .


.PHONY: testv
testv:
@python -m pytest -s .
71 changes: 71 additions & 0 deletions ornate-orbits/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Mordle
Wordle with more fun and more information.
See more in [this slide](https://docs.google.com/presentation/d/1cCAn2Ggavuf-VrAuh-mOnEE_v00eoi68kCEKvENDXug/edit?usp=sharing) to acknowledge all of its functionalities.

## Installation
Mordle requires only several dependencies to run, be sure to clone it first:
```
git clone git@github.com:cin-lawrence/code-jam-2024
```
Ensure you have a Bot account and a server to run the Bot.

To create a Bot account, see more [here](https://discordpy.readthedocs.io/en/stable/discord.html#creating-a-bot-account).

Upon creating a Bot account and a Discord server, retrieve the Bot token and the server ID (see `Server Settings > Widget > Server ID`, then copy it).

**The application can be installed using either of 2 ways below.**

### In the host machine
Change your working directory to the project's root folder.
```
cd code-jam-2024
```
Install the dependencies. _It could be nicer if you have a virtual environment._
```
pip install -r requirements-dev.txt
```
Exports your environment variables, including the Bot token and the server ID retrieved.
```
export DISCORD_TOKEN=<your discord token>
export GUILD_ID=<your server ID>
```
Run the application from the current working directory.
```
python -m app.main
```

### Using Docker
Docker encapsulates all requirements needed for the application.

Though more advanced, this is the recommended way to run the app.

Follow the [official documentation](https://docs.docker.com/get-docker/) to install Docker.

Rename the `.env` in `./config` folder,
```
mv ./config/app/.env.example ./config/app/.env
```
and add your environment variables.
```
DISCORD_TOKEN=<your discord token>
GUILD_ID=<your server ID>
```
The latest version of Docker already has docker-compose included. To minimize the steps needed, it is recommended to use docker-compose.
```
docker compose build
docker compose up -d
```
The steps above are sufficient to spin up the application. To shut down the application:
```
docker compose down
```
If you want to use the pre-built image:
```
docker run --env-file ./config/app/.env mikosurge/mordle:v0.0.1
```

## The Ornate Orbits team
- **@Atonement**: repository setup, first bot implementation, code refactoring, trivia crawling, commits, and PRs managing.
- **@Xerif**: main game logic, most of the commands, slideshow creator.
- **@kvothe**: some nltk, crawling, math, and trivia logic.
- **@Bh**: tests writing, bug fixing.
Empty file added ornate-orbits/app/__init__.py
Empty file.
Loading