Skip to content

Commit

Permalink
Merge pull request #4160 from OpenBB-finance/feature/remove-pyupgrade
Browse files Browse the repository at this point in the history
Removed Pyupgrade From CI
  • Loading branch information
jmaslek committed Feb 7, 2023
2 parents 826522b + 48b8df4 commit 5bb0f25
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 139 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,14 @@ jobs:
restore-keys: ${{ runner.os }}-linting-${{ hashFiles('**/poetry.lock') }}

- run: |
pip install bandit black codespell mypy==0.982 pyupgrade safety pylint==2.15.2 packaging==22 ruff==0.0.236
pip install bandit black codespell mypy==0.982 safety pylint==2.15.2 packaging==22 ruff==0.0.243
pip install types-pytz types-requests types-termcolor types-tabulate types-PyYAML types-python-dateutil types-setuptools types-six
- run: bandit -x ./tests -r . || true
- run: black --diff --check .
- run: codespell --ignore-words-list=commun,statics,ro,zar,zlot,jewl,ba,buil,coo,ether,hist,hsi,mape,navagation,operatio,pres,ser,yeld,shold,ist,varian,datas,ake,creat,vie,hel,ket,toke,certi,buidl,ot,te --quiet-level=2 --skip=./tests,.git,*.css,*.csv,*.html,*.ini,*.ipynb,*.js,*.json,*.lock,*.scss,*.txt,*.yaml,./build/pyinstaller,./website/config.toml
- run: ruff .
- run: mypy --ignore-missing-imports openbb_terminal
- run: shopt -s globstar && pyupgrade --py38-plus **/*.py
- run: |
pylint terminal.py openbb_terminal tests
- run: pylint terminal.py openbb_terminal tests

markdown-link-check:
name: Markdown Linting
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ jobs:
key: ${{ runner.os }}-linting-${{ hashFiles('**/poetry.lock') }}
restore-keys: ${{ runner.os }}-linting-${{ hashFiles('**/poetry.lock') }}

- run: pip install bandit black codespell mypy==0.982 pyupgrade safety pylint==2.15.2 packaging==22 ruff==0.0.212
- run: pip install bandit black codespell mypy==0.982 safety pylint==2.15.2 packaging==22 ruff==0.0.243
- run: pip install types-pytz types-requests types-termcolor types-tabulate types-PyYAML types-python-dateutil types-setuptools types-six
- run: bandit -x ./tests -r . || true
- run: black --diff --check .
- run: codespell --ignore-words-list=commun,statics,ro,zar,zlot,jewl,ba,buil,coo,ether,hist,hsi,mape,navagation,operatio,pres,ser,yeld,shold,ist,varian,datas,ake,creat,vie,hel,ket,toke,certi,buidl,ot,te --quiet-level=2 --skip=./tests,.git,*.css,*.csv,*.html,*.ini,*.ipynb,*.js,*.json,*.lock,*.scss,*.txt,*.yaml,./build/pyinstaller,./website/config.toml
- run: ruff .
- run: mypy --ignore-missing-imports openbb_terminal
- run: shopt -s globstar && pyupgrade --py38-plus **/*.py
- run: safety check
- run: |
pylint terminal.py openbb_terminal tests
- run: pylint terminal.py openbb_terminal tests
test:
name: Base Tests - Ubuntu-latest - Python 3.9
runs-on: ubuntu-latest
Expand Down
7 changes: 1 addition & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.236'
rev: 'v0.0.243'
hooks:
- id: ruff
- repo: https://github.com/codespell-project/codespell
Expand Down Expand Up @@ -64,11 +64,6 @@ repos:
"website/content/api/*",
]
exclude: package.lock.json
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: local
hooks:
- id: reserved_args
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -1100,9 +1100,8 @@ The following linters are used by our codebase:
| bandit | security analyzer |
| black | code formatter |
| codespell | spelling checker |
| flake8 | style guide enforcer |
| ruff | a fast python linter |
| mypy | static typing checker |
| pyupgrade | upgrade syntax for newer versions |
| safety | checks security vulnerabilities |
| pylint | bug and quality checker |
| markdownlint | markdown linter |
Expand Down
23 changes: 1 addition & 22 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ pylint = "2.15.2"
mypy = "^0.930"
mock = "^4.0.3"
codespell = "^2.0.0"
pyupgrade = "^2.11.0"
sphinx = "^4.5.0"
myst-parser = "^0.15.2"
black = "^23.1.0"
Expand Down Expand Up @@ -160,8 +159,9 @@ target-version = "py38"
# This is an introductory addition of ruff. We should look to adding:
# D: pydocstyle, PD: pandas-vet
# All options here: https://github.com/charliermarsh/ruff#supported-rules
select = ["E", "W", "F", "Q", "W", "S", "UP", "I"]
ignore = ["S105", "S106", "S107"]
select = ["E", "W", "F", "Q", "W", "S", "UP", "I", "PLC", "PLE", "PLR", "PLW"]
# These ignores should be seen as temporary solutions to problems that will NEED fixed
ignore = ["S105", "S106", "S107", "S110", "PLR2004", "PLR0911", "PLR0913", "PLR0912", "PLR0915"]

[tool.ruff.per-file-ignores]
"tests/*" = ["S101"]
Expand All @@ -176,6 +176,12 @@ seaborn = "sns"
combine-as-imports = true
force-wrap-aliases = true

[tool.ruff.pylint]
max-args=8
max-branches=25
max-returns=9
max-statements=30

[tool.isort]
profile = "black"
line_length = 122
Expand Down
15 changes: 1 addition & 14 deletions requirements-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ ansiwrap==0.8.4; python_version >= "3.7"
anyio==3.6.2; python_full_version >= "3.6.2" and python_version >= "3.8" and python_version < "4.0"
appdirs==1.4.4
appnope==0.1.3; sys_platform == "darwin" and python_version >= "3.8" and platform_system == "Darwin" and python_full_version >= "3.7.0" and python_full_version < "4.0.0"
arch==5.3.1; python_version >= "3.7"
argon2-cffi-bindings==21.2.0; python_version >= "3.7"
argon2-cffi==21.3.0; python_version >= "3.7"
ascii-magic==1.6; python_version >= "3.5"
astor==0.8.1; python_full_version >= "3.7.1" and python_full_version < "4.0.0" and python_version >= "3.8"
astroid==2.13.5; python_full_version >= "3.7.2"
astropy==5.2.1; python_version >= "3.8"
asttokens==2.2.1; python_version >= "3.8"
async-timeout==4.0.2; python_version >= "3.8" and python_version < "4.0" and python_full_version >= "3.7.0"
atomicwrites==1.4.1; sys_platform == "win32" and python_version >= "3.7" and python_full_version >= "3.7.0" and python_full_version < "4.0.0"
Expand Down Expand Up @@ -51,7 +49,6 @@ convertdate==2.4.0; python_version >= "3.7" and python_version < "4"
coverage==7.1.0; python_version >= "3.7"
cryptography==39.0.0; python_version >= "3.6"
cssselect==1.2.0; python_version >= "3.8" and python_version < "4.0"
cvxpy==1.3.0; python_version >= "3.7"
cycler==0.11.0; python_version >= "3.7"
cython==0.29.33; python_version >= "3.8" and python_full_version < "3.0.0" and sys_platform == "darwin" or python_full_version >= "3.3.0" and sys_platform == "darwin" and python_version >= "3.8"
dateparser==1.1.7; python_version >= "3.7"
Expand All @@ -66,7 +63,6 @@ dill==0.3.6; python_version >= "3.7" and python_full_version >= "3.7.2"
distlib==0.3.6; python_version >= "3.7"
dnspython==2.3.0; python_version >= "3.7" and python_version < "4.0"
docutils==0.17.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
ecos==2.0.12; python_version >= "3.7"
entrypoints==0.4; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.8" and (python_version >= "3.7" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.7")
ephem==4.1.4; python_version >= "3.7" and python_version < "4"
et-xmlfile==1.1.0; python_version >= "3.6"
Expand Down Expand Up @@ -164,7 +160,6 @@ nbconvert==7.2.9; python_version >= "3.7"
nbformat==5.7.3; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.7"
nbmake==1.3.5; python_full_version >= "3.7.0" and python_full_version < "4.0.0"
nest-asyncio==1.5.6; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.8"
networkx==3.0; python_version >= "3.8"
nfoursid==1.0.1; python_version >= "3.7"
nodeenv==1.7.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.7.0" and python_version >= "3.7"
notebook-shim==0.2.2; python_version >= "3.7"
Expand All @@ -175,7 +170,6 @@ oandapyv20==0.6.3
oauthlib==3.2.2; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.4.0" and python_version >= "3.6"
onetimepass==1.0.1; python_full_version >= "3.7.1" and python_full_version < "4.0.0"
openpyxl==3.1.0; python_version >= "3.6"
osqp==0.6.2.post8; python_version >= "3.7"
packaging==23.0; python_version >= "3.7"
pandas-datareader==0.10.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.6"
pandas-market-calendars==3.2; python_full_version >= "3.7.0"
Expand Down Expand Up @@ -218,7 +212,6 @@ pycparser==2.21; python_version >= "3.6" and python_full_version < "3.0.0" or py
pydantic==1.10.4; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.7"
pydeck==0.8.0; python_version >= "3.7" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.7"
pydeprecate==0.3.2; python_version >= "3.7"
pyerfa==2.0.0.1; python_version >= "3.8"
pyex==0.5.0
pyflakes==2.5.0; python_version >= "3.6" and python_full_version >= "3.7.0"
pygments==2.14.0; python_version >= "3.6"
Expand Down Expand Up @@ -248,12 +241,10 @@ pytorch-lightning==1.6.5; python_version >= "3.7"
pytrends==4.9.0; python_version >= "3.7"
pytz-deprecation-shim==0.1.0.post0; python_version >= "3.7" and python_full_version < "3.0.0" or python_version >= "3.7" and python_full_version < "3.9.7" and python_full_version >= "3.6.0" or python_full_version > "3.9.7" and python_version >= "3.7"
pytz==2022.7.1; python_full_version >= "3.7.1" and python_full_version < "4.0.0" and python_version >= "3.8" and (python_version >= "3.8" and python_full_version < "3.9.7" or python_full_version > "3.9.7" and python_version >= "3.8") and python_version < "4.0"
pyupgrade==2.38.4; python_version >= "3.7"
pywin32==305; sys_platform == "win32" and platform_python_implementation != "PyPy" and python_version >= "3.8"
pywinpty==2.0.10; os_name == "nt" and python_version >= "3.7"
pyyaml==6.0; python_version >= "3.8"
pyyaml==6.0; python_version >= "3.7"
pyzmq==25.0.0; python_full_version >= "3.7.0" and python_full_version < "4.0.0" and python_version >= "3.8"
qdldl==0.1.5.post3; python_version >= "3.7"
quandl==3.7.0; python_version >= "3.6"
rapidfuzz==1.9.1; python_version >= "2.7"
rdflib==6.2.0; python_version >= "3.7"
Expand All @@ -262,7 +253,6 @@ requests-oauthlib==1.3.1; python_version >= "3.7" and python_full_version < "3.0
requests==2.28.2; python_version >= "3.7" and python_version < "4"
rfc3986==1.5.0; python_version >= "3.8" and python_version < "4.0"
rich==12.6.0; python_full_version >= "3.6.3" and python_full_version < "4.0.0"
riskfolio-lib==3.3.0; python_version >= "3.7"
robin-stocks==2.1.0; python_version >= "3"
rsa==4.9; python_version >= "3.6" and python_version < "4" and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.7")
ruamel.yaml.clib==0.2.7; platform_python_implementation == "CPython" and python_version < "3.11" and python_version >= "3.5"
Expand All @@ -271,7 +261,6 @@ ruff==0.0.236; python_version >= "3.7"
scikit-learn==1.2.1; python_version >= "3.8" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.8"
scipy==1.10.0; python_version >= "3.8" and python_version < "3.12"
screeninfo==0.6.7
scs==3.2.2; python_version >= "3.7"
seaborn==0.11.2; python_version >= "3.6"
semver==2.13.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_version >= "3.7" and python_full_version < "3.9.7" and python_full_version >= "3.4.0" or python_full_version > "3.9.7"
send2trash==1.8.0; python_version >= "3.7"
Expand Down Expand Up @@ -314,7 +303,6 @@ textwrap3==0.9.2; python_version >= "3.7"
thepassiveinvestor==1.1.2
threadpoolctl==3.1.0; python_version >= "3.8" and python_full_version < "3.0.0" or python_full_version >= "3.6.0" and python_version >= "3.8"
tinycss2==1.2.1; python_version >= "3.7"
tokenize-rt==4.2.1; python_full_version >= "3.6.1" and python_version >= "3.7"
tokenterminal==1.0.1
toml==0.10.2; python_version >= "3.7" and python_full_version < "3.9.7" and python_full_version >= "3.7.0" or python_full_version > "3.9.7" and python_version >= "3.7" and python_full_version < "4.0.0"
tomli==2.0.1; python_version < "3.11" and python_full_version >= "3.7.2" and python_version >= "3.8" and python_full_version <= "3.11.0a6"
Expand Down Expand Up @@ -359,7 +347,6 @@ win32-setctime==1.1.0; python_version >= "3.5" and python_full_version >= "3.7.0
wrapt==1.14.1; python_full_version >= "3.7.2" and python_full_version < "4.0.0" and (python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7") and python_version >= "3.8" and python_version < "3.11"
xarray==2023.1.0; python_version >= "3.8"
xgboost==1.7.3; python_version >= "3.8"
xlsxwriter==3.0.8; python_version >= "3.7"
yarl==1.8.2; python_version >= "3.8" and python_version < "4.0" and python_full_version >= "3.7.0"
yfinance==0.2.9
zipp==3.12.0; python_version >= "3.7" and python_full_version < "3.9.7" and python_version < "3.10" or python_full_version > "3.9.7" and python_version >= "3.7" and python_version < "3.10"
Expand Down
Loading

0 comments on commit 5bb0f25

Please sign in to comment.