Skip to content

Commit

Permalink
Update gitlab CI with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiencyr committed Dec 13, 2024
1 parent ad36564 commit a0c9e5b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ lint:
stage: lint
script:
- python -m pip install --upgrade pip
- pip install flake8
- flake8 .
- pip install ruff
- ruff format
- ruff check
except:
- tags

Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2024, SERTIT-ICube - France, https://sertit.unistra.fr/
# This file is part of sertit-utils project
# https://github.com/sertit/sertit-utils
Expand All @@ -16,6 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os

import sertit

# -- General configuration ------------------------------------------------
Expand All @@ -37,7 +37,7 @@
"sphinx.ext.napoleon",
"sphinx_copybutton",
"myst_nb",
"IPython.sphinxext.ipython_console_highlighting"
"IPython.sphinxext.ipython_console_highlighting",
]
myst_enable_extensions = [
"amsmath",
Expand All @@ -57,7 +57,7 @@
nb_execution_timeout = -1

# Manage new READTHEDOCS output mechanism
cache_path = os.getenv('READTHEDOCS_OUTPUT')
cache_path = os.getenv("READTHEDOCS_OUTPUT")
if cache_path is not None:
nb_execution_cache_path = f"{cache_path}/../docs/_build/.jupyter_cache"

Expand Down
7 changes: 3 additions & 4 deletions docs/notebooks/01_getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@
"metadata": {},
"outputs": [],
"source": [
"from sertit import AnyPath, rasters\n",
"from sertit.unistra import unistra_s3\n",
"from sertit import AnyPath\n",
"from sertit import rasters\n",
"\n",
"with unistra_s3():\n",
" pth = AnyPath(\"s3://sertit-sertit-utils-ci/tutorials/getting_started/image.tif\")\n",
Expand Down Expand Up @@ -301,9 +300,9 @@
"outputs": [],
"source": [
"import xarray\n",
"\n",
"from sertit import AnyPath, rasters\n",
"from sertit.unistra import unistra_s3\n",
"from sertit import AnyPath\n",
"from sertit import rasters\n",
"\n",
"with unistra_s3():\n",
" pth = AnyPath(\n",
Expand Down
2 changes: 1 addition & 1 deletion sertit/__meta__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2024, SERTIT-ICube - France, https://sertit.unistra.fr/
# This file is part of sertit-utils project
# https://github.com/sertit/sertit-utils
Expand All @@ -17,4 +16,5 @@
"""
Sertit Utils library
"""

__version__ = "1.44.1"
2 changes: 1 addition & 1 deletion sertit/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def dict_to_xml(dict_to_cv: dict, attributes: list = None) -> _Element:
elif isinstance(val, datetime):
str_val = val.isoformat()
else:
with contextlib.supress(AttributeError):
with contextlib.suppress(AttributeError):
# gpd, pd...
val = val.iat[0]
str_val = str(val)
Expand Down

0 comments on commit a0c9e5b

Please sign in to comment.