Skip to content

Commit

Permalink
Update all minor versions (prod-2-9-advance) (minor) (#1541)
Browse files Browse the repository at this point in the history
* Update all minor versions

* Add Ruff

* Update from base branch

From the artifact of the previous workflow run

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Stéphane Brunner <[email protected]>
Co-authored-by: geo-ghci-int[bot] <146321879+geo-ghci-int[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 3, 2024
1 parent 5057310 commit eb5ae3e
Show file tree
Hide file tree
Showing 12 changed files with 200 additions and 172 deletions.
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

0 comments on commit eb5ae3e

Please sign in to comment.