Skip to content

Commit

Permalink
fix: Removed unused imports and fixed build
Browse files Browse the repository at this point in the history
Removed travis and added github actions
Removed unused imports
  • Loading branch information
SlashGordon committed Aug 11, 2021
1 parent 2430845 commit bb2b10d
Show file tree
Hide file tree
Showing 15 changed files with 157 additions and 38 deletions.
9 changes: 9 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[run]
relative_files = True

[report]
omit =
*/python?.?/*
*/pypy/*
*/site-packages/nose/*
tests/*
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches:
- '*' # matches every branch that doesn't contain a '/'
- '*/*' # matches every branch containing a single '/'
- '**' # matches every branch
- '!master' # excludes master

jobs:
# Test
test:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.8]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run tests
run: tox
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1.5
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: test-results/**/*.xml
41 changes: 41 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Pull Request

on:
pull_request:
branches: [master]
jobs:
# Test
test:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.8]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run tests
run: tox
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1.5
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: test-results/**/*.xml
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
debug: true
coveralls_finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
debug: true
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release Build

on:
push:
branches:
- master
jobs:
# Test
release:
if: "!contains(github.event.commits[0].message, '[skip ci]')"
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.8]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run tests
run: tox
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1.5
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: test-results/**/*.xml
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
debug: true
- name: Python Semantic Release
uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN_PP }}
coveralls_finish:
needs: release
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
debug: true
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# pystockfilter

[![Build Status](https://travis-ci.org/portfolioplus/pystockfilter.svg?branch=master)](https://travis-ci.org/portfolioplus/pystockfilter)
![Release Build](https://github.com/portfolioplus/pystockfilter/workflows/Release%20Build/badge.svg)
![CI Build](https://github.com/portfolioplus/pystockfilter/workflows/CI/badge.svg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/pystockfilter?style=plastic)
[![Coverage Status](https://coveralls.io/repos/github/portfolioplus/pystockfilter/badge.svg?branch=master)](https://coveralls.io/github/portfolioplus/pystockfilter?branch=master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/07e6231a5a8c415a9f27736e02a286da)](https://www.codacy.com/app/SlashGordon/pystockfilter?utm_source=github.com&utm_medium=referral&utm_content=portfolioplus/pystockfilter&utm_campaign=Badge_Grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ac0c6fc68b74408c976007bd3db823f0)](https://www.codacy.com/gh/portfolioplus/pystockfilter/dashboard?utm_source=github.com&utm_medium=referral&utm_content=portfolioplus/pystockfilter&utm_campaign=Badge_Grade)

Create your own fundamental or chart based stock filter. All you need is a database set up with [pystockdb](https://github.com/portfolioplus/pystockdb).

Expand Down
7 changes: 7 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[semantic_release]
version_variable=src/pystockfilter/__init__.py:__version__
branch=master
commit_version_number = True
commit_subject = release {version} [skip ci]
commit_message =
commit_author = release-bot <release@github>
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@
"""

from setuptools import setup, find_packages
import re


EXCLUDE_FROM_PACKAGES = ['test', 'test.*', 'test*']
VERSION = '1.0.8'
VERSION = '0.0.0'

with open('src/pystockfilter/__init__.py', 'r') as fd:
VERSION = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE
).group(1)

with open('README.md', 'r') as fh:
long_description = fh.read()
Expand Down
1 change: 1 addition & 0 deletions src/pystockfilter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.0.8"
2 changes: 0 additions & 2 deletions src/pystockfilter/filter/adx_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"""

import logging
from datetime import datetime

import numpy as np
import tulipy as ti
from dateutil.relativedelta import relativedelta
Expand Down
2 changes: 0 additions & 2 deletions src/pystockfilter/filter/price_target_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
can be found in the LICENSE file.
"""
import logging

from datetime import datetime
from dateutil.relativedelta import relativedelta

from pystockfilter.filter.base_filter import BaseFilter
Expand Down
2 changes: 0 additions & 2 deletions src/pystockfilter/filter/rsi_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
can be found in the LICENSE file.
"""
import logging
from datetime import datetime

import numpy as np
import tulipy as ti
from dateutil.relativedelta import relativedelta
Expand Down
2 changes: 0 additions & 2 deletions src/pystockfilter/filter/stock_is_hot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
can be found in the LICENSE file.
"""
import logging
from datetime import datetime

import numpy as np
from dateutil.relativedelta import relativedelta

Expand Down
8 changes: 4 additions & 4 deletions src/pystockfilter/filter/stock_is_hot_secure.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
can be found in the LICENSE file.
"""
import logging
from datetime import datetime

from dateutil.relativedelta import relativedelta

from pystockfilter.filter.base_filter import BaseFilter
Expand All @@ -17,8 +15,10 @@

class StockIsHotSecure(StockIsHot):
"""
This filter creates with the help of multiple polyfits in an given date range
a score for a stock. The value 1 is the best and 0 the worst.
This filter creates with the help of multiple polyfits in an
given date range a score for a stock. The value 1 is the best
and 0 the worst.
A stock with a score between 0.75 and 1. shows a good performance.
"""

Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
skipsdist = True
usedevelop = True
envlist = py36,
envlist = py38,
flake8

[testenv]
Expand All @@ -11,7 +11,7 @@ deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-dev.txt

basepython =
py36: python3.6
py38: python3.8
commands =
pytest tests/ --cov src/pystockfilter --cov-report term-missing
python setup.py bdist_wheel
Expand All @@ -22,7 +22,7 @@ ignore = E501
deps =
flake8
basepython =
python3.6
python3.8
commands =
flake8 src/pystockfilter/

Expand Down

0 comments on commit bb2b10d

Please sign in to comment.