Skip to content

Commit

Permalink
The beginning of our glorious new python reusable core
Browse files Browse the repository at this point in the history
  • Loading branch information
revmischa committed May 8, 2019
0 parents commit 3671cf0
Show file tree
Hide file tree
Showing 21 changed files with 1,816 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .ackrc
@@ -0,0 +1,5 @@
--ignore-dir=node_modules/
--ignore-dir=.serverless/
--ignore-dir=.git/
--ignore-dir=__pycache__
--color
36 changes: 36 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,36 @@
version: 2
jobs:
build:
docker:
- image: circleci/python:3.7.1
environment:
PIPENV_VENV_IN_PROJECT: true
TEST_DATABASE_URL: postgresql://postgres@localhost/circle_test?sslmode=disable
# CircleCI PostgreSQL images available at: https://hub.docker.com/r/circleci/postgres/
- image: circleci/postgres:9.6.2-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_DB: circle
steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
- restore_cache:
key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
- run:
command: |
sudo pip install pipenv
pipenv install --dev
- save_cache: # cache Python dependencies using checksum of Pipfile as the cache-key
key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
paths:
- ".venv"
- "/usr/local/bin"
- "/usr/local/lib/python3.7/site-packages"
- run:
command: |
mkdir test-reports
pipenv run pytest --junitxml=test-reports/junit.xml
pipenv run flake8
- store_test_results: # Upload test results for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
path: test-reports
26 changes: 26 additions & 0 deletions .gitignore
@@ -0,0 +1,26 @@
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# Serverless directories
.serverless
.serverless-wsgi

__pycache__
node_modules
instance.cfg
script/initialize_project.sh
3 changes: 3 additions & 0 deletions .style.yapf
@@ -0,0 +1,3 @@
[style]
based_on_style = pep8
column_limit = 120
26 changes: 26 additions & 0 deletions .travis.yml
@@ -0,0 +1,26 @@
dist: xenial
language: python
python:
"3.7"
services:
- postgresql

env:
global:
- PIPENV_VENV_IN_PROJECT=1
- PIPENV_IGNORE_VIRTUALENVS=1

before_script:
- createdb TEMPLATE

install:
- pip install pipenv
- pipenv install --dev

script:
- pipenv run pytest
- pipenv run flake8

cache:
directories:
- ".venv"
47 changes: 47 additions & 0 deletions Pipfile
@@ -0,0 +1,47 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
"boto3" = "*"
psycopg2 = "*"
marshmallow-enum = "*"
Flask = "*"
Flask-Cors = "*"
SQLAlchemy = "*"
Werkzeug = "*"
Flask-Script = "*"
marshmallow = "==3.0.0rc5"
flask-rest-api = "*"
marshmallow-sqlalchemy = "*"
pytest-factoryboy = "*"
requests = "*"
pytest-sqlalchemy = "*"
furl = "*"

[dev-packages]
"flake8" = "*"
pytest = "*"
mypy = "*"
"flake8-mypy" = {ref = "27f1888d7e6766d1b4357cb7a2ecede4bc95b281", git = "https://github.com/jetbridge/flake8-mypy.git"}
importmagic = "*"
epc = "*"
pytest-xdist = "*"
watchdog = "*"
pytest-postgresql = "*"
pudb = "*"
ipdb = "*"
mypy_extensions = ">=0.4.1"
Faker = "*"
autoflake = "*"
"python-language-server[all]" = "*"
yapf = "*"
pytest-sqlalchemy = "*"
yaspin = "*"

[requires]
python_version = "3.7"

[pipenv]
allow_prereleases = true

0 comments on commit 3671cf0

Please sign in to comment.