Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #102 from bankroll-py/split-up-project
Browse files Browse the repository at this point in the history
Split up project
  • Loading branch information
jspahrsummers authored Aug 29, 2019
2 parents e438968 + 7e2f166 commit 8f0b138
Show file tree
Hide file tree
Showing 57 changed files with 1,279 additions and 6,191 deletions.
167 changes: 80 additions & 87 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,119 +3,112 @@
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2

defaults: &defaults
docker:
# https://circleci.com/docs/2.0/circleci-images/
- image: circleci/python:3.7.2-stretch

working_directory: ~/bankroll

jobs:
shellcheck:
build:
docker:
- image: koalaman/shellcheck-alpine:stable
steps:
- checkout
- run:
name: Check Scripts
command: shellcheck --external-sources script/*
# specify the version you desire here
# use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers`
- image: circleci/python:3.7.4

test:
<<: *defaults
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4

parallelism: 4
working_directory: ~/repo

steps:
- checkout

# Note that race conditions between workflows are possible here:
# https://circleci.com/docs/2.0/caching/#writing-to-the-cache-in-workflows
#
# As long as the caching is deterministic, this _should_ be OK.
- restore_cache: &default_restore_cache
- restore_cache:
keys:
- v1-pip-cache-{{ checksum "setup.py" }}
- v1-pip-cache-

- restore_cache:
keys:
# When requirements change, use increasingly general patterns to restore cache.
- v2-dependencies-{{ checksum "requirements.txt" }}
- v2-dependencies-

- run: &bootstrap
- run:
name: install dependencies
command: script/bootstrap
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- save_cache: &default_save_cache
- save_cache:
paths:
- ./venv
key: v2-dependencies-{{ checksum "requirements.txt" }}

- run:
name: typecheck
command: |
. venv/bin/activate
mypy --namespace-packages --strict --implicit-reexport bankroll
mypy --namespace-packages --strict --implicit-reexport -p tests
- run:
name: run tests
command: script/test
command: |
. venv/bin/activate
python -m unittest -v
test installing:
<<: *defaults
- store_artifacts:
path: test-reports
destination: test-reports

steps:
- checkout

- run:
command: script/test_install

contribution guidelines:
<<: *defaults

steps:
- checkout

- restore_cache: *default_restore_cache
- run: *bootstrap
- save_cache: *default_save_cache
name: linting
command: |
. venv/bin/activate
black --check bankroll tests
- run:
name: typecheck
command: script/typecheck

name: test ibkr install
command: |
python3 -m venv --clear venv
. venv/bin/activate
pip install .[ibkr]
bankroll -h | grep ibkr
- run:
name: check formatting
when: always
command: script/reformat --diff

deploy:
<<: *defaults
name: test schwab install
command: |
python3 -m venv --clear venv
. venv/bin/activate
pip install .[schwab]
bankroll -h | grep schwab
steps:
- checkout

- run:
name: deploy
command: script/deploy

versiontags: &versiontags
tags:
only: /^v.*/
name: test fidelity install
command: |
python3 -m venv --clear venv
. venv/bin/activate
pip install .[fidelity]
bankroll -h | grep fidelity
workflows:
version: 2
workflow:
jobs:
- shellcheck:
filters:
<<: *versiontags
- test:
filters:
<<: *versiontags
- test installing:
filters:
<<: *versiontags
- contribution guidelines:
filters:
<<: *versiontags
- deploy:
requires:
- test
- test installing
- contribution guidelines
filters:
<<: *versiontags
branches:
ignore: /.*/
- run:
name: test vanguard install
command: |
python3 -m venv --clear venv
. venv/bin/activate
pip install .[vanguard]
bankroll -h | grep vanguard
- run:
name: test installing all extras
command: |
python3 -m venv --clear venv
. venv/bin/activate
pip install .[ibkr,schwab,fidelity,vanguard]
bankroll -h | grep ibkr
bankroll -h | grep schwab
bankroll -h | grep fidelity
bankroll -h | grep vanguard
- save_cache:
paths:
- ~/.cache/pip
key: v1-pip-cache-{{ checksum "setup.py" }}
35 changes: 0 additions & 35 deletions CONTRIBUTING.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Justin Spahr-Summers
Copyright (c) 2019 Justin Spahr-Summers and bankroll contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 8f0b138

Please sign in to comment.