-
-
Notifications
You must be signed in to change notification settings - Fork 0
Ornate Orbits #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
janine9vn
wants to merge
9
commits into
main
Choose a base branch
from
ornate-orbits
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c925ac8
Initial commit
cin-lawrence 9d021e7
feat: initial setup (#2)
cin-lawrence a7f019d
fix: add dockerfile (#3)
cin-lawrence 772b8c3
feat: add watch attr to docker-compose.yml
boxlesscat 4082573
Merge pull request #4 from cin-lawrence/feat/update-docker-compose
boxlesscat eb0cbfe
feat: add word generator (#5)
cin-lawrence b39947c
feat: wordle logic (#6)
cin-lawrence a326407
feat: update README (#8)
cin-lawrence 3b9db27
Add 'ornate-orbits/' from commit 'a32640723f223fbf79df9d846a977e082f2…
janine9vn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| .PHONY: tc | ||
| tc: | ||
| @python -m mypy . | ||
|
|
||
|
|
||
| .PHONY: test | ||
| test: | ||
| @python -m pytest . | ||
|
|
||
|
|
||
| .PHONY: testv | ||
| testv: | ||
| @python -m pytest -s . | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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