Skip to content

Commit

Permalink
Add support for pyrankvote, multiple voting strategies, integration…
Browse files Browse the repository at this point in the history
… with MongoDB (#9)

* Initial commits

* Updated db and election

* Updated add and remove election

* Updated add vote

* Added removeVote

* Minor refactor and rename

* Remove .idea directory

* Update docker setup

* Add updateElection

* Add TTL to elections

* Update README and minor changes
  • Loading branch information
aditeyabaral committed May 10, 2023
1 parent 130151c commit a4bd542
Show file tree
Hide file tree
Showing 15 changed files with 1,081 additions and 1,265 deletions.
5 changes: 4 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
APP_DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"
MONGO_URI=mongodb://mongo:27017/
TTL_SECONDS=2592000
HOST="0.0.0.0"
PORT=5000
34 changes: 17 additions & 17 deletions .github/workflows/python-versioning.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: Python Version Compatibility

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
__pycache__
.vscode
.idea/

*.log

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python

RUN apt update -y
RUN apt upgrade -y
RUN apt install python3-pip libpq-dev python3-dev -y && pip3 install --upgrade pip
RUN apt install python3-pip -y && pip3 install --upgrade pip

COPY app/ app/
COPY README.md README.md
Expand Down
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

248 changes: 141 additions & 107 deletions README.md

Large diffs are not rendered by default.

Loading

0 comments on commit a4bd542

Please sign in to comment.