Skip to content

Commit

Permalink
Merge pull request #311 from fabric-testbed/update-black
Browse files Browse the repository at this point in the history
Update black
  • Loading branch information
sajith authored May 8, 2024
2 parents af03216 + 629a982 commit 79957f1
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install black==23.* isort==5.*
python -m pip install black==24.* isort==5.*
- name: Run "black --check"
run: |
Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ $ pip install -e .[test]
$ pytest -s tests/integration/test_hello_fabric.py
```

If you want to format code with [black] and [isort]:

```
$ tox -e format
```


## Documenting FABlib

FABlib uses Sphinx to generate API documentation from Python
Expand Down
12 changes: 6 additions & 6 deletions fabrictestbed_extensions/editors/geo_topology_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1460,9 +1460,9 @@ def load_node(self, node_name):
self.current_node = node

self.dashboards["node_dashboard"]["node_name_widget"].value = node_name
self.dashboards["node_dashboard"][
"site_name_widget"
].value = node.get_property(pname="site")
self.dashboards["node_dashboard"]["site_name_widget"].value = (
node.get_property(pname="site")
)
self.dashboards["node_dashboard"]["core_slider"].value = int(
self.get_capacity_value(node, "core")
)
Expand All @@ -1475,9 +1475,9 @@ def load_node(self, node_name):
self.dashboards["node_dashboard"]["image_widget"].value = node.get_property(
pname="image_ref"
)
self.dashboards["node_dashboard"][
"image_type_widget"
].value = node.get_property(pname="image_type")
self.dashboards["node_dashboard"]["image_type_widget"].value = (
node.get_property(pname="image_type")
)

# TODO: LOAD Components

Expand Down
6 changes: 3 additions & 3 deletions fabrictestbed_extensions/fablib/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1200,9 +1200,9 @@ def get_notices(self) -> Dict[str, str]:
notices[node.get_reservation_id()] = node.get_error_message()

for network_service in self.get_network_services():
notices[
network_service.get_reservation_id()
] = network_service.get_error_message()
notices[network_service.get_reservation_id()] = (
network_service.get_error_message()
)

for component in self.get_components():
notices[component.get_reservation_id()] = component.get_error_message()
Expand Down
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ doc = [
"furo"
]
test = [
"black==23.*",
"black==24.*",
"isort==5.*",
"tox==4.*",
"pytest",
Expand All @@ -59,9 +59,6 @@ test = [
branch = true
omit = ["fabrictestbed_extensions/tests/*"]

[tool.black]
src_paths = ["fabrictestbed_extensions", "docs/source/conf.py", "tests"]

[tool.isort]
profile = "black"
src_paths = ["fabrictestbed_extensions", "docs/source/conf.py", "tests"]
Expand Down
12 changes: 12 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,15 @@ deps =

commands =
sphinx-build -W -b html {toxinidir}/docs/source/ {toxinidir}/docs/build/html

[testenv:format]
# An environment for formatting code.
deps =
black==24.*
isort==5.*

skip_install = True

commands =
black fabrictestbed_extensions tests
isort fabrictestbed_extensions tests

0 comments on commit 79957f1

Please sign in to comment.