Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dev deps #4440

Merged
merged 10 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
restore-keys: ${{ runner.os }}-linting-${{ hashFiles('**/poetry.lock') }}

- run: |
pip install bandit black codespell mypy==1.0.0 pylint==2.15.2 ruff==0.0.247
pip install bandit black codespell mypy==1.1.1 pylint==2.17.0 ruff==0.0.256
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 .
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ repos:
hooks:
- id: black
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.247'
rev: 'v0.0.256'
hooks:
- id: ruff
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.2.4
hooks:
- id: codespell
entry: codespell
Expand Down Expand Up @@ -47,7 +47,7 @@ repos:
hooks:
- id: pylint
name: pylint
entry: pylint openbb_terminal terminal.py tests -j 4
entry: pylint openbb_terminal terminal.py tests -j 0
language: system
types: [python]
- repo: https://github.com/Yelp/detect-secrets
Expand Down
5 changes: 3 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ confidence=
# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call
# disable=too-many-instance-attributes,len-as-condition,too-few-public-methods,anomalous-backslash-in-string,no-else-return,simplifiable-if-statement,too-many-arguments,duplicate-code,no-name-in-module,no-member,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,missing-docstring,invalid-name,bad-whitespace,consider-using-enumerate,unexpected-keyword-arg

disable=useless-return,missing-docstring,invalid-name,import-error,broad-except,unnecessary-lambda,missing-timeout,duplicate-code,consider-using-generator,unbalanced-tuple-unpacking,use-list-literal,no-name-in-module,use-sequence-for-iteration,use-dict-literal,unspecified-encoding,unsubscriptable-object
disable=useless-return,missing-docstring,invalid-name,import-error,broad-except,unnecessary-lambda,missing-timeout,duplicate-code,consider-using-generator,unbalanced-tuple-unpacking,use-list-literal,no-name-in-module,use-sequence-for-iteration,use-dict-literal,unspecified-encoding,unsubscriptable-object,broad-exception-raised

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down Expand Up @@ -395,4 +395,5 @@ min-public-methods=1

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
overgeneral-exceptions=builtins.BaseException,
builtins.Exception
16 changes: 8 additions & 8 deletions openbb_terminal/alternative/realestate/landRegistry_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,19 @@ def get_towns_sold_prices(
prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix lrcommon: <http://landregistry.data.gov.uk/def/common/>

SELECT ?paon ?saon ?street ?county ?postcode ?amount ?date ?category
SELECT ?paon ?saon ?street ?county ?postcode ?amount ?date ?category
WHERE
{{
VALUES ?town {{"{town}"^^xsd:string}}

?addr lrcommon:town ?town ;
lrcommon:postcode ?postcode.

?transx lrppi:propertyAddress ?addr ;
lrppi:pricePaid ?amount ;
lrppi:transactionDate ?date ;
lrppi:transactionCategory/skos:prefLabel ?category.

FILTER (
?date > "{start_date}"^^xsd:date &&
?date < "{end_date}"^^xsd:date
Expand Down Expand Up @@ -220,13 +220,13 @@ def get_region_stats(
prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix lrcommon: <http://landregistry.data.gov.uk/def/common/>

SELECT ?month ?avgPrice ?avgPriceCash ?totalSalesVolume ?avgPriceExistingProperty
?avgPriceFirstTimeBuyer
?avgPriceDetached ?hpi ?detachedhpi ?newbuildhpi
SELECT ?month ?avgPrice ?avgPriceCash ?totalSalesVolume ?avgPriceExistingProperty
?avgPriceFirstTimeBuyer
?avgPriceDetached ?hpi ?detachedhpi ?newbuildhpi
{{
values ?refRegion {{<http://landregistry.data.gov.uk/id/region/{region}>}}
?region ukhpi:refPeriodStart ?month ;
ukhpi:housePriceIndex ?hpi ;
ukhpi:housePriceIndex ?hpi ;
ukhpi:refRegion ?refRegion ;
ukhpi:averagePrice ?avgPrice ;
ukhpi:averagePriceCash ?avgPriceCash ;
Expand All @@ -242,7 +242,7 @@ def get_region_stats(
?month > "{start_date}"^^xsd:date &&
?month < "{end_date}"^^xsd:date
)

OPTIONAL {{?region ukhpi:housePriceIndexDetached ?detachedhpi}}
OPTIONAL {{?region ukhpi:housePriceIndexNewBuild ?newbuildhpi }}
OPTIONAL {{?region ukhpi:averagePrice ?averagePrice }}
Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/core/plots/plotly_helper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Chart and style helpers for Plotly."""
# pylint: disable=C0302,R0902
# pylint: disable=C0302,R0902,W3301
import json
import os
import textwrap
Expand Down
12 changes: 6 additions & 6 deletions openbb_terminal/core/session/current_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

__profile = ProfileModel()
__local_user = UserModel( # type: ignore
credentials=__credentials,
preferences=__preferences,
credentials=__credentials, # type: ignore
preferences=__preferences, # type: ignore
profile=__profile,
)
__current_user = __local_user
Expand Down Expand Up @@ -101,8 +101,8 @@ def set_preference(
Preference value
"""
current_user = get_current_user()
updated_preferences = dataclasses.replace(current_user.preferences, **{name: value})
updated_user = dataclasses.replace(current_user, preferences=updated_preferences)
updated_preferences = dataclasses.replace(current_user.preferences, **{name: value}) # type: ignore
updated_user = dataclasses.replace(current_user, preferences=updated_preferences) # type: ignore
set_current_user(updated_user)


Expand All @@ -117,6 +117,6 @@ def set_credential(name: str, value: str):
Credential value
"""
current_user = get_current_user()
updated_credentials = dataclasses.replace(current_user.credentials, **{name: value})
updated_user = dataclasses.replace(current_user, credentials=updated_credentials)
updated_credentials = dataclasses.replace(current_user.credentials, **{name: value}) # type: ignore
updated_user = dataclasses.replace(current_user, credentials=updated_credentials) # type: ignore
set_current_user(updated_user)
1 change: 1 addition & 0 deletions openbb_terminal/keys_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def __str__(self):
return self.value

def colorize(self):
c = ""
if self.name == self.DEFINED_TEST_FAILED.name:
c = "red"
elif self.name == self.NOT_DEFINED.name:
Expand Down
54 changes: 27 additions & 27 deletions poetry.lock

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

10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ doc = ["docstring-parser"]
[tool.poetry.group.dev.dependencies]
pytest-xdist = "^3.2.0"
pytest = "^6.2.2"
pylint = "2.15.2"
mypy = "^1.0.0"
pylint = "2.17.0"
mypy = "^1.1.1"
mock = "^4.0.3"
codespell = "^2.0.0"
codespell = "^2.2.4"
pydocstyle = "^6.3.0"
sphinx = "^4.5.0"
myst-parser = "^0.15.2"
Expand All @@ -154,7 +154,7 @@ pre-commit = "^2.16.0"
pytest-cov = "^3.0.0"
types-six = "^1.16.12"
nbmake = ">0.5.0"
ruff = "^0.0.247"
ruff = "^0.0.256"
pytest-timeout = "^2.1.0"

[build-system]
Expand All @@ -174,7 +174,7 @@ target-version = "py38"
# All options here: https://github.com/charliermarsh/ruff#supported-rules
select = ["E", "W", "F", "Q", "S", "UP", "I", "PLC", "PLE", "PLR", "PLW", "SIM"]
# These ignores should be seen as temporary solutions to problems that will NEED fixed
ignore = ["S105", "S106", "S107", "S110", "PLR2004", "PLR0911", "PLR0913", "PLR0912", "PLR0915", "SIM114", "SIM105", "SIM117"]
ignore = ["S105", "S106", "S107", "S110", "PLR2004", "PLR0911", "PLR0913", "PLR0912", "PLR0915", "SIM114", "SIM105", "SIM117", "PLC1901", "PLR5501","PLW2901","PLW0603"]

[tool.ruff.per-file-ignores]
"tests/*" = ["S101"]
Expand Down
Loading