Skip to content

Commit

Permalink
Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
JerBouma committed Feb 15, 2024
1 parent 6270fa9 commit bb1a15e
Show file tree
Hide file tree
Showing 8 changed files with 2,724 additions and 31 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: General Linting

on:
pull_request:
types: [opened, synchronize, edited]
push:
branches:
- 'main'

jobs:
code-linting:
name: General Code Linting
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: x64
- name: Install Poetry
uses: snok/install-poetry@v1
- run: |
poetry install
- run: poetry run black --diff --check thepassiveinvestor
- run: poetry run codespell
- run: poetry run ruff thepassiveinvestor
- run: poetry run pylint thepassiveinvestor

markdown-link-check:
name: Markdown Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Check out the code
- name: Lint Code Base
uses: docker://avtodev/markdown-lint:v1
49 changes: 49 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
exclude_types: [css, markdown, text, svg]
- id: trailing-whitespace
exclude_types: [html, markdown, text]
- id: check-merge-conflict
- id: detect-private-key
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.1.1"
hooks:
- id: ruff
entry: ruff --ignore PLR0915,S301
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
entry: codespell
args:
[
"--ignore-words-list=plaform,VAI,nam,tha,MIS,shs,amplitud,gard,te,commun,ro,zar,vie,hel,jewl,zlot,ba,buil,coo,ether,hist,hsi,mape,navagation,operatio,pres,ser,yeld,shold,ist,varian,datas,ake,creat,statics,ket,toke,certi,buidl,ot",
"--quiet-level=2",
"--skip=./tests,.git,*.css,*.csv,*.html,*.ini,*.ipynb,*.js,*.json,*.lock,*.scss,*.txt,*.yaml,build/pyinstaller/*,pyproject.toml",
"-x=.github/workflows/linting.yml"
]
- repo: local
hooks:
- id: mypy
name: mypy
description: ""
entry: mypy
language: python
"types_or": [python, pyi]
args: ["--ignore-missing-imports", "--scripts-are-modules"]
require_serial: true
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint financetoolkit
language: system
types: [python]
Binary file removed SSL/libcrypto-1_1-x64.dll
Binary file not shown.
Binary file removed SSL/libssl-1_1-x64.dll
Binary file not shown.
2,539 changes: 2,539 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
[tool.poetry]
name = "thepassiveinvestor"
version = "1.2.2"
description = "Passive Investing for the Average Joe."
license = "MIT"
authors = ["Jeroen Bouma"]
packages = [
{ include = "thepassiveinvestor" },
]
include = ['normalization/*.csv']
readme = "README.md"
homepage = "https://www.jeroenbouma.com/projects/thepassiveinvestor"
repository = "https://github.com/JerBouma/thepassiveinvestor"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Financial and Insurance Industry",
"Topic :: Office/Business :: Financial :: Investment",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
keywords = [
"Passive",
"Investing",
"Financial",
"Analysis",
"Fundamental",
"Technical",
"Quantitative",
"Database",
"Equities",
"Currencies",
"Economics",
"ETFs",
"Funds",
"Indices",
"Moneymarkets",
"Commodities",
"Options"
]

[tool.poetry.dependencies]
python = ">=3.10, <3.13"
pandas = {extras = ["computation", "performance", "excel"], version = "^2.2"}
yahooquery = "^2.2"
urllib3 = "^1.26"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.1"
pylint = "^2.17.5"
codespell = "^2.2.5"
black = "^23.7.0"
pytest-mock = "^3.11.1"
pytest-recording = "^0.13.0"
pytest-cov = "^4.1.0"
ruff = "^0.0.287"
pytest-timeout = "^2.1.0"
pytest-recorder = "^0.2.3"
ipykernel = "^6.25.2"

[build-system]
requires = ["setuptools<65.5.0", "poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.ruff]
line-length = 122
select = ["E", "W", "F", "Q", "W", "S", "UP", "I", "PD", "SIM", "PLC", "PLE", "PLR", "PLW"]
ignore = ["S105", "S106", "S107", "PLR0913", "PLR0912", "PLR0911", "PLR0915", "PD010", "PD013", "S310", "S301"]
exclude = ["conftest.py"]

[tool.pylint]
max-line-length = 122
disable = ["R0913", "W1514", "R0911", "R0912", "R0915", "R0801", "W0221", "C0103", "E1131"]

[tool.ruff.isort]
combine-as-imports = true
force-wrap-aliases = true

[tool.isort]
profile = "black"
line_length = 122
skip_gitignore = true
combine_as_imports = true

[tool.codespell]
ignore-words-list = 'te,hsi,amplitud,nam,tha,plaform'
skip = '*.json,./.git,pyproject.toml,poetry.lock,examples'

[tool.mypy]
disable_error_code = "misc"

[tool.pytest.ini_options]
filterwarnings = [
"ignore::pytest.PytestAssertRewriteWarning:",
]
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

27 changes: 0 additions & 27 deletions setup.py

This file was deleted.

0 comments on commit bb1a15e

Please sign in to comment.