Skip to content

Commit

Permalink
feat: Dev Environment setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyvy-vi committed Aug 7, 2021
1 parent c6cda6f commit 92624ef
Show file tree
Hide file tree
Showing 5 changed files with 1,260 additions and 0 deletions.
131 changes: 131 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# 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/
pip-wheel-metadata/
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/

# 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
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.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

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__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/

.DS_store
62 changes: 62 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: check-merge-conflict
stages: [push]
- id: check-yaml
stages: [push]
- id: end-of-file-fixer
stages: [push]
- id: mixed-line-ending
args: [ --fix=lf ]
stages: [push]
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
stages: [push]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.5.1
hooks:
- id: python-check-blanket-noqa
stages: [push]

- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.2.1
hooks:
- id: python-safety-dependencies-check
stages: [push]

- repo: local
hooks:
- id: isort
name: isort
description: This hook runs isort within the project env
language: system
entry: poetry run isort
types: [python]
stages: [push]

- id: black
name: black
description: This hook runs black within the project env
language: system
entry: poetry run black
types: [python]
stages: [push]

- id: flake8
name: flake8
description: This hook runs flake8 with the project env
language: system
entry: poetry run flake8
types: [python]
stages: [push]

- id: pytest
name: pytest
description: Runs tests on the project
language: system
entry: echo "No tests found"
types: [python]
stages: [push]
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Heptagram API

This is an API made for the [Heptagram Bot](https://github.com/Heptagram-Bot/).
For contributing to the project, check out the [CONTRIBUTING.md](./CONTRIBUTING.md) file.

## Features

_Coming soon..._


## Requirements

- `Python` v3.7+
- `fastapi` (API framework)
- `poetry` (dependency manager)
- `pip` (needed to install poetry)

## Setting up the dev environment

1. Install Poetry
```
pip install poetry
```

2. Set up the project dependencies and the pre-commit hooks
```
poetry install
poetry run task precommit
```
3. Set up the MongoDB instance
<!--#TODO: Fill more setup info here, after setting up the docker container-->

4. Run the project
```
poetry run start
```

5. Linting your code
```
poetry run task lint
```
## Usage

<!#TODO: Fill info about usage here, after the API is sorta ready-->

Loading

0 comments on commit 92624ef

Please sign in to comment.