update python to 3.9, fix gitlab-ci test step

This commit is contained in:
Aarni Halinen
2021-04-14 16:48:44 +03:00
parent 441227bc15
commit 5049ef415d
5 changed files with 14 additions and 90 deletions
+7 -16
View File
@@ -1,23 +1,14 @@
*.swp
.DS_Store
.env
*~
*.pyc
*.sqlite3
uwsgi.ini
uwsgi.log
members/logs/*
.idea/
logs/
/collected_static/
/media/
logs/
members/logs/*
node_modules/
.coverage
db.sqlite3
requirements_henu.txt
/collected_static/
mydatabase
settings.json
.vscode/
.DS_Store
.idea/
*.code-workspace
sik_test
venv/
venv/
.venv/
+5 -4
View File
@@ -16,7 +16,7 @@ install:
expire_in: 1 week
test:
image: python:3.7
image: python:3.9
stage: test
needs: []
services:
@@ -28,14 +28,15 @@ test:
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
DB_HOST: postgres
script:
- python -V
- pip install -r requirements.txt
- pip install poetry==1.1.4
- poetry config virtualenvs.create false
- poetry install --no-dev --no-interaction --no-ansi
- python manage.py migrate --noinput
- python manage.py createdefaultadmin
- python manage.py test
lint:py:
image: python:3.7
image: python:3.9
stage: lint
needs: []
script:
+1 -1
View File
@@ -1 +1 @@
3.7.4
3.9
+1 -1
View File
@@ -12,5 +12,5 @@
"reportMissingImports": true,
"reportMissingTypeStubs": false,
"pythonVersion": "3.7.4"
"pythonVersion": "3.9"
}
-68
View File
@@ -1,68 +0,0 @@
#!/bin/bash
echo "SIK WEB 2.0"
echo "This script will set up the environment for this project."
echo "========================================================="
echo "Dependencies: python3.7"
INTERACTIVE="true"
USE_NPM="true"
if [[ $* == *--no-input* ]]
then
INTERACTIVE="false"
fi
if [[ $* == *--no-npm* ]]
then
USE_NPM="false"
fi
$INTERACTIVE || (echo "Running in non-interactive mode." && env)
$INTERACTIVE && read -p "Are these programs installed? [y/n]" -n 1 -r || REPLY="y"
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo "Please install the dependencies. Exiting."
exit 0
fi
$INTERACTIVE && read -p "Is virtualenv activated? [y/n]" -n 1 -r || REPLY="y"
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo "Please activate virtualenv first. Exiting."
exit 0
fi
$INTERACTIVE && read -p "Copy pre-push hook to .git/hooks? (recommended) [y/n]" -n 1 -r || REPLY="y"
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]
then
cp "$PWD/scripts/git/pre-push" "$PWD/.git/hooks/pre-push"
fi
$INTERACTIVE && read -p "Start setup? [y/n]" -n 1 -r || REPLY="y"
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo "Exiting."
exit 0
fi
set -e
set -x
pip install -r requirements.txt
pip install -r requirements.production.txt
$USE_NPM && npm install
python manage.py migrate
python manage.py createdefaultadmin
set +e
set +x
echo "Done."
echo "Run 'python manage.py runserver 0.0.0.0:8000' to start the development server!"