Browse Source

Add base files for the CI

pull/9/head
Dashie der otter 11 months ago
parent
commit
371217cdc0
Signed by: Dashie <dashie@sigpipe.me> GPG Key ID: C2D57B325840B755
9 changed files with 140 additions and 0 deletions
  1. 2
    0
      .coveragerc
  2. 3
    0
      .dockerignore
  3. 64
    0
      .drone.yml
  4. 3
    0
      .gitignore
  5. 3
    0
      .isort.cfg
  6. 4
    0
      babel.cfg
  7. 12
    0
      pyproject.toml
  8. 10
    0
      setup.cfg
  9. 39
    0
      setup.py

+ 2
- 0
.coveragerc View File

@@ -0,0 +1,2 @@
[run]
omit = tests/*

+ 3
- 0
.dockerignore View File

@@ -0,0 +1,3 @@
.git
LICENSE
README.md

+ 64
- 0
.drone.yml View File

@@ -0,0 +1,64 @@
clone:
git:
image: plugins/git:1
depth: 50
tags: true

pipeline:
restore-cache:
image: drillster/drone-volume-cache
restore: true
mount:
- .cache
volumes:
- /tmp/cache:/cache

build:
image: python:3-alpine
commands:
- pip install --upgrade pip setuptools
- pip install --cache-dir=/cache flake8
- pip install --cache-dir=/cache black
- pip install --cache-dir=/cache -r requirements.txt
- python setup.py install
- black --check .
- flake8 .
- cp tests/config_test.py config.py
- python setup.py test

migrations:
image: python:3-alpine
commands:
- pip install --upgrade pip setuptools
- pip install --cache-dir=/cache flake8
- pip install --cache-dir=/cache black
- pip install --cache-dir=/cache -r requirements.txt
- python setup.py install
- psql -U postgres -h database -w -c 'CREATE DATABASE ahrl'
- cp config.py.sample config.py
- flask db upgrade

rebuild-cache:
image: drillster/drone-volume-cache
rebuild: true
mount:
- .cache
volumes:
- /tmp/cache:/cache

notify:
image: plugins/slack
channel: gitea
secrets:
- SLACK_WEBHOOK
when:
event: [ push, tag, pull_request ]
status: [ changed, failure, success ]

services:
database:
image: postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_DB=ahrl_test


+ 3
- 0
.gitignore View File

@@ -8,3 +8,6 @@ tmp/cty.xml
.ropeproject/
venv
*.log
.coverage
ahrl.egg-info
.eggs

+ 3
- 0
.isort.cfg View File

@@ -0,0 +1,3 @@
[settings]
line_length=120
force_single_line=false

+ 4
- 0
babel.cfg View File

@@ -0,0 +1,4 @@
[python: **.py]
[jinja2: **/templates/**.jinja2]
[jinja2: **/templates/**.html]
extensions=jinja2.ext.autoescape,jinja2.ext.with_

+ 12
- 0
pyproject.toml View File

@@ -0,0 +1,12 @@
[tool.black]
line-length = 120
py36 = true
exclude = '''
/(
\.git
| \.eggs
| \.idea
| \__pycache__
)/
'''
skip-numeric-underscore-normalization = true

+ 10
- 0
setup.cfg View File

@@ -0,0 +1,10 @@
[aliases]
test=pytest

[tool:pytest]
addopts = --verbose --cov=.
python_files = tests/*.py

[flake8]
max-line-length = 120
ignore = E501

+ 39
- 0
setup.py View File

@@ -0,0 +1,39 @@
from setuptools import setup

setup(
name="ahrl",
version="0.0.1",
license="MIT",
python_requires=">=3.6",
long_description=open("README.md").read(),
url="http://github.com/rhaamo/ahrl",
author="Dashie",
author_email="dashie@sigpipe.me",
install_requires=[
"Flask",
"SQLAlchemy",
"WTForms",
"WTForms-Alchemy",
"SQLAlchemy-Searchable",
"SQLAlchemy-Utils",
"Flask-Bootstrap",
"Flask-DebugToolbar",
"Flask-Login",
"Flask-Mail",
"Flask-Migrate",
"Flask-Principal",
"Flask-Security",
"Flask-SQLAlchemy",
"Flask-Uploads",
"Flask-WTF",
"bcrypt",
"psycopg2-binary",
"unidecode",
"Flask_Babelex",
"texttable",
"python-slugify",
"flask-accept",
],
setup_requires=["pytest-runner"],
tests_require=["pytest", "pytest-cov", "jsonschema"],
)

Loading…
Cancel
Save