Skip to content

Commit

Permalink
MNT: Update pre-commit and reprocess
Browse files Browse the repository at this point in the history
The version of flake8 didn't seem compatible with python 3.12
  • Loading branch information
ndevenish committed Aug 28, 2024
1 parent 0647689 commit 08996aa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
# Syntax validation and some basic sanity checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.6.0
hooks:
- id: check-merge-conflict
- id: check-ast
Expand All @@ -11,7 +11,7 @@ repos:

# Automatically sort imports
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: [
Expand All @@ -28,14 +28,14 @@ repos:

# Automatic source code formatting
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 24.8.0
hooks:
- id: black
args: [--safe, --quiet]

# Linting
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: ['flake8-comprehensions==3.8.0']
4 changes: 3 additions & 1 deletion src/ispyb/xmltools.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def __init__(self, parent_element):
currentValue = self[element.tag]
currentValue.append(aDict)
self.update({element.tag: currentValue})
except Exception: # the first of its kind, an empty list must be created
except (
Exception
): # the first of its kind, an empty list must be created
self.update(
{element.tag: [aDict]}
) # aDict is written in [], i.e. it will be a list
Expand Down
6 changes: 3 additions & 3 deletions tests/test_mxacquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ def test_mxacquisition_methods(testdb):

params = mxacquisition.get_data_collection_file_attachment_params()
params["parentid"] = id1
params[
"file_full_path"
] = "/dls/mx/data/mx12345/mx12345-6/processed/xia2_run/result.json"
params["file_full_path"] = (
"/dls/mx/data/mx12345/mx12345-6/processed/xia2_run/result.json"
)
params["file_type"] = "log"
dcfa_id = mxacquisition.upsert_data_collection_file_attachment(
list(params.values())
Expand Down
1 change: 1 addition & 0 deletions tests/test_xtalimaging.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import time


def test_xtal_imaging(testdb):
testdb.set_role("ispyb_import")
xtalimaging = testdb.xtal_imaging
Expand Down

0 comments on commit 08996aa

Please sign in to comment.