Skip to content

Commit

Permalink
#280 Add review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
viliambalaz committed Jun 30, 2020
1 parent 0d579d5 commit 45486a0
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 35 deletions.
81 changes: 51 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
Expand All @@ -15,7 +12,7 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [2.7.17, 2.7.18]
python-version: [2.7.18]

steps:
- uses: actions/checkout@v2
Expand All @@ -25,32 +22,56 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install virtualenv && sudo apt-get install gettext
python -m pip install --upgrade pip
printf "%s\n" \
"1" \
"y" \
"y" \
"y" \
"y" \
"localhost:8000" \
"" \
"" \
"" \
"" \
"[email protected]"\
"" \
"" \
"y" \
"y" \
"y" \
"y" \
"admin" \
"" \
"" \
"" \
"" \
| PYTHONUNBUFFERED=1 python setup.py
sudo apt-get update && sudo apt-get install virtualenv gettext
- name: Run setup
run: |
CREDENTIALS=(
# Server mode: Local development mode with dummy email infrastructure.
"2"
# Mock libreoffice?
"y"
# Mock imagemagic?
"y"
# Mock abbyyocr11?
"y"
# Install requirements for unittesting?
"y"
# Server domain
"localhost:8000"
# Admin e-mail (default)
""
# Support e-mail (default)
""
# Inforequest unique e-mail (default)
""
# Default from e-mail (default)
""
# Obligee dummy e-mail
"[email protected]"
# Unique cache key prefix (default)
""
# Google Custom Search API key (default)
""
# Load datasheets / Neighbourhood dummy was omitted / Delete it?
"y"
# Load datasheets / Municipality dummy was omitted / Delete it?
"y"
# Load datasheets / District dummy was omitted / Delete it?
"y"
# Load datasheets / Region dummy was omitted / Delete it?
"y"
# Admin password
"admin"
# Facebook OAuth Client ID (default)
""
# Facebook OAuth Secret (default)
""
# Google OAuth Client ID (default)
""
# Google OAuth Secret (default)
""
)
printf "%s\n" "${CREDENTIALS[@]}" | PYTHONUNBUFFERED=1 python setup.py
- name: Test
run: |
env/bin/python manage.py test
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import string
import random
import json
import getpass
import textwrap
import unicodedata

Expand Down Expand Up @@ -102,7 +103,7 @@ def input_password(self, key, prompt, hasher=None, required=False):
configured = self.data.get(key, u'')
prompt = u'\n{} [{}]: '.format(prompt, u'*****' if configured else u'')
while True:
inputed = raw_input(PROMPT + prompt + RESET)
inputed = getpass.getpass(PROMPT + prompt + RESET)
if required and not inputed and not configured:
print(ERROR + u'\nError: The value is required.' + RESET)
continue
Expand Down Expand Up @@ -280,10 +281,7 @@ def install_requirements(configure):
],
}[server_mode]
requirements += {
u'Y': [
u'-r', u'requirements/tests.txt',
u'-r', u'poleno/dummymail/requirements.txt'
],
u'Y': [u'-r', u'requirements/tests.txt'],
u'N': [],
}[enable_unittests]
call(u'Installing requirements for the selected server mode:',
Expand Down

0 comments on commit 45486a0

Please sign in to comment.