-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from DMcP89/release/v0.4.0-Beta
Release/v0.4.0 beta
- Loading branch information
Showing
41 changed files
with
1,710 additions
and
998 deletions.
There are no files selected for viewing
This file contains 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,47 @@ | ||
# Contributing to harambot | ||
|
||
PRs are welcome provided they follow the guidelines and procedures below. | ||
|
||
## Procedure | ||
1. Open an issue/feature request to discuss the changes you want to make | ||
2. Fork the repository | ||
3. Create a new branch | ||
4. Make your changes | ||
5. Create tests for your changes | ||
6. Run tests | ||
7. Commit your changes | ||
8. Push your changes | ||
9. Create a pull request | ||
|
||
## Guidelines | ||
- Follow the GitHub Community Guidelines | ||
- Be responsive and open to discussions and suggestions from the project maintainers and contributors | ||
- Toxic behavior or bullying will not be tolerated | ||
|
||
## Setting up development environment | ||
|
||
### Prerequisites | ||
- Python 3.8 or higher | ||
- pyenv | ||
- pyenv-virtualenv | ||
- poetry | ||
|
||
### Environment setup | ||
Use the following commands to setup your local environment | ||
``` | ||
git clone [your fork url] | ||
cd harambot | ||
pyenv virtual-env 3.8 harambot | ||
pyenv local harambot | ||
poerty install --with dev | ||
precommit install | ||
precommit autoupdate | ||
precommit run --all-files | ||
``` | ||
|
||
### Running tests | ||
You can run the tests by running the following from the projects root directory | ||
``` | ||
pytest | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains 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,57 @@ | ||
name: run-pytest | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11"] | ||
steps: | ||
#---------------------------------------------- | ||
# check-out repo and set-up python | ||
#---------------------------------------------- | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
#---------------------------------------------- | ||
# ----- install & configure poetry ----- | ||
#---------------------------------------------- | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root --with dev | ||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install project | ||
run: poetry install --no-interaction | ||
#---------------------------------------------- | ||
# run test suite | ||
#---------------------------------------------- | ||
- name: Run tests | ||
run: | | ||
source .venv/bin/activate | ||
pytest --disable-warnings |
This file contains 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
This file contains 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
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
[default] | ||
LOGLEVEL = "DEBUG" | ||
VERSION = "0.3.1-Beta" | ||
VERSION = "0.4.0-Beta" | ||
RUN_MIGRATIONS = false | ||
PORT = 10000 | ||
WEBHOOK_AVATAR_URL = "https://raw.githubusercontent.com/DMcP89/harambot/main/assests/harambot-1.jpg" | ||
REPORT_EXECUTORS = 5 |
File renamed without changes.
File renamed without changes.
This file contains 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,34 @@ | ||
FROM python:3.10.7-slim as python-base | ||
ENV PIP_NO_CACHE_DIR=off \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=on \ | ||
PIP_DEFAULT_TIMEOUT=100 | ||
ENV PATH="/root/.local/bin:$PATH" | ||
|
||
RUN apt-get update | ||
RUN apt-get upgrade -y | ||
RUN apt-get install -y gcc libc-dev make git libffi-dev python3-dev libxml2-dev libxslt-dev | ||
RUN apt-get install -y default-libmysqlclient-dev pkg-config | ||
RUN apt-get install -y libpq-dev | ||
|
||
FROM python-base as poetry | ||
RUN apt-get install --no-install-recommends -y \ | ||
# deps for installing poetry | ||
curl \ | ||
# deps for building python deps | ||
build-essential | ||
|
||
# install poetry | ||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
RUN poetry --version | ||
RUN poetry config virtualenvs.create false | ||
|
||
|
||
# cleanup | ||
RUN rm -rf /var/lib/apt/lists/ | ||
|
||
COPY . ./ | ||
RUN poetry install | ||
|
||
FROM poetry as runtime | ||
WORKDIR /app | ||
CMD ["harambot"] |
File renamed without changes.
Oops, something went wrong.