diff options
author | 2018-09-16 23:10:13 +0200 | |
---|---|---|
committer | 2018-09-16 23:10:13 +0200 | |
commit | d8628581535d7879ebd62b2b19aad8a32502c2ae (patch) | |
tree | ba9bfcbb3a9b19610e4e12ec19fc72eecb7ef514 | |
parent | Fix typo. (diff) |
Back to the roots.
-rw-r--r-- | .gitlab-ci.yml | 33 | ||||
-rw-r--r-- | Dockerfile | 4 | ||||
-rw-r--r-- | setup.py | 33 |
3 files changed, 42 insertions, 28 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 406d6055..3959b401 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,19 +3,12 @@ stages: - test - deploy image: python:3.7-alpine +variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache" cache: paths: - - .cache/ - -variables: - PIPENV_CACHE_DIR: "$CI_PROJECT_DIR/.cache" - PIPENV_HIDE_EMOJIS: 1 - PIPENV_IGNORE_VIRTUALENVS: 1 - PIPENV_MAX_SUBPROCESS: 2 - PIPENV_NOSPIN: 1 - PIPENV_VENV_IN_PROJECT: 1 - + - .cache .test-template: &test-template stage: test @@ -35,9 +28,7 @@ lint: stage: lint before_script: - apk add python3-dev git libpq postgresql-dev gcc cmake autoconf automake musl-dev - - python3 -m pip install poetry - - poetry config settings.virtualenvs.in-project true - - poetry install + - python3 -m pip install .[lint] script: - flake8 tags: @@ -48,9 +39,7 @@ test-3.7-alpine: image: python:3.7-alpine before_script: - apk add python3-dev git libpq postgresql-dev gcc cmake autoconf automake musl-dev - - python3 -m pip install poetry - - poetry config settings.virtualenvs.in-project true - - poetry install + - python3 -m pip install .[test] - python manage.py migrate script: - coverage run --source=api,home,pysite,wiki --branch manage.py test @@ -65,9 +54,7 @@ test-3.6-alpine: image: python:3.6-alpine before_script: - apk add python3-dev git libpq postgresql-dev gcc cmake autoconf automake musl-dev - - python3 -m pip install poetry - - poetry config settings.virtualenvs.in-project true - - poetry install + - python3 -m pip install .[test] - python manage.py migrate test-3.7-stretch: @@ -78,9 +65,7 @@ test-3.7-stretch: before_script: - apt-get update -y - apt-get install -y libpython3-dev git libpq-dev gcc cmake autoconf automake libc-dev - - python3 -m pip install poetry - - poetry config settings.virtualenvs.in-project true - - poetry install + - python3 -m pip install .[test] - python manage.py migrate test-3.6-stretch: @@ -91,9 +76,7 @@ test-3.6-stretch: before_script: - apt-get update -y - apt-get install -y libpython3-dev git libpq-dev gcc cmake autoconf automake libc-dev - - python3 -m pip install poetry - - poetry config settings.virtualenvs.in-project true - - poetry install + - python3 -m pip install .[test] - python manage.py migrate pages: @@ -1,13 +1,11 @@ FROM python:3.7-alpine RUN apk add python3-dev git libpq postgresql-dev gcc cmake autoconf automake musl-dev -RUN python3 -m pip install poetry COPY . /app WORKDIR /app -RUN python3 -m poetry config settings.virtualenvs.in-project true -RUN poetry install --no-dev +RUN python3 -m pip install .[deploy] RUN apk del git gcc cmake autoconf automake CMD ["gunicorn", "--workers", "4", "--bind", "0.0.0.0:4000", "pysite.wsgi:application"] diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..66b3b4d8 --- /dev/null +++ b/setup.py @@ -0,0 +1,33 @@ +from setuptools import find_packages, setup + + +setup( + name='pysite', + version='0.2.0', + packages=find_packages(), + install_requires=[ + 'django>=2.1.1', + 'djangorestframework>=3.8.2', + 'djangorestframework-bulk>=0.2.1', + 'django-hosts>=3.0', + 'django-environ>=0.4.5' + ], + extras_require={ + 'deploy': [ + 'gunicorn>=19.9.0', + ], + 'lint': [ + 'flake8>=3.5.0', + 'flake8-bandit>=1.0.2', + 'flake8-bugbear>=18.8.0', + 'flake8-import-order>=0.18', + 'flake8-string-format>=0.2.3', + 'flake8-tidy-imports>=1.1.0', + 'pep8-naming>=0.7.0', + 'mccabe>=0.6.1' + ], + 'test': [ + 'coverage>=4.5.1' + ] + } +) |