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 all minor versions (prod-2-9-advance) (minor) #1541

Merged
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
3 changes: 0 additions & 3 deletions custom/.bandit.yaml

This file was deleted.

11 changes: 7 additions & 4 deletions custom/.prospector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ inherits:
- utils:base
- utils:fix
- utils:no-design-checks
- utils:c2cwsgiutils
- duplicated

pylint:
ruff:
disable:
- missing-timeout # Default timeout set by c2cwsgiutils
- D101 # Missing docstring in public class
- D102 # Missing docstring in public method
- D103 # Missing docstring in public function

bandit:
mypy:
options:
config: .bandit.yaml
python_version: '3.10'
2 changes: 1 addition & 1 deletion custom/custom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def main(global_config, **settings):
"""This function returns a Pyramid WSGI application."""
"""Get the Pyramid WSGI application."""
del global_config # Unused.
with Configurator(settings=settings) as config:
config.include("pyramid_mako")
Expand Down
5 changes: 1 addition & 4 deletions custom/custom/scripts/initialize_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@


def setup_models(dbsession):
"""
Add or update models / fixtures in the database.

"""
"""Add or update models / fixtures in the database."""
del dbsession # Unused


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,18 @@ def get_dwell_demographics(self, postal_code: int, date_time: datetime) -> Featu
return self.error
return self.response_to_geojson_result(response.json())

def check_api_error(self, response: Response):
def check_api_error(self, response: Response) -> None:
if response.status_code != 200:
err_code = response.status_code
err_txt = response.text
LOG.warning("External API error (code %s): %s", err_code, err_txt)
self.error = Response(err_txt, status=err_code)
raise ExternalAPIError("External api error")

def limit_query(self):
def limit_query(self) -> None:
"""
Limit amount of allowed queries per day.

[bgerber] It's rude, but we are using my own key !
"""
delta = datetime.now() - self.request_date
Expand Down
136 changes: 83 additions & 53 deletions custom/poetry.lock

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

Loading
Loading