-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce new code format workflow and update existing files (#8)
* update and fix linting issues Signed-off-by: kta-intel <[email protected]> * fix requirements filename Signed-off-by: kta-intel <[email protected]> * remove unused import Signed-off-by: kta-intel <[email protected]> * remove unused import Signed-off-by: kta-intel <[email protected]> * isort, black, flake8 formatting Signed-off-by: kta-intel <[email protected]> --------- Signed-off-by: kta-intel <[email protected]>
- Loading branch information
Showing
21 changed files
with
113 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
minimum_pre_commit_version: 3.3.3 | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
files: \.py$ | ||
- id: requirements-txt-fixer | ||
- id: check-merge-conflict | ||
- id: check-case-conflict | ||
- id: check-json | ||
files: \.json$ | ||
- id: check-yaml | ||
files: \.yaml$ | ||
- id: debug-statements | ||
- id: pretty-format-json | ||
args: | ||
- --autofix | ||
files: \.json$ | ||
- id: trailing-whitespace | ||
files: \.py$ | ||
- repo: https://github.com/PyCQA/autoflake | ||
rev: v2.3.1 | ||
hooks: | ||
- id: autoflake | ||
args: | ||
- --in-place | ||
- --remove-unused-variables | ||
- --recursive | ||
- --ignore-pass-statements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
"""openfl-contrib version information.""" | ||
__version__ = '0.1.0' | ||
__version__ = "0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
torch==2.3.1 | ||
torchvision==0.18.1 | ||
torchvision==0.18.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# SPDX-License-Identifier: Apache-2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
openfl_contrib_workspace/torch_cnn_mnist_custom_weighted_average/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
tensorboard | ||
torch==2.3.0 | ||
torchvision==0.18 | ||
tensorboard | ||
wheel>=0.38.0 # not directly required, pinned by Snyk to avoid a vulnerability |
2 changes: 1 addition & 1 deletion
2
openfl_contrib_workspace/torch_cnn_mnist_skc_compression/requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
tensorboard | ||
torch==2.3.0 | ||
torchvision==0.18 | ||
tensorboard | ||
wheel>=0.38.0 # not directly required, pinned by Snyk to avoid a vulnerability |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[tool.black] | ||
line-length = 100 | ||
|
||
[tool.isort] | ||
profile = "black" | ||
force_single_line = "False" | ||
line_length = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,4 @@ | ||
black | ||
flake8 | ||
flake8-broken-line | ||
flake8-bugbear | ||
flake8-builtins | ||
flake8-comprehensions | ||
flake8-copyright | ||
flake8-docstrings | ||
flake8-eradicate | ||
flake8-import-order | ||
flake8-import-single | ||
flake8-quotes | ||
flake8-use-fstring | ||
pep8-naming | ||
setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability | ||
isort | ||
pre-commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
pytest==8.2.0 | ||
pytest==8.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[flake8] | ||
ignore = | ||
# Conflicts with black | ||
E203 | ||
# Line break occurred before a binary operator. Update by W504 Line | ||
W503 | ||
# Allow "import torch.nn.functional as F" | ||
N812 | ||
|
||
per-file-ignores = | ||
# Unused imports in __init__.py are OK | ||
**/__init__.py:F401 | ||
|
||
exclude = | ||
*_pb2*, | ||
|
||
max-line-length = 100 | ||
|
||
copyright-check = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,4 @@ | |
'openfl @ git+https://github.com/securefederatedai/openfl.git@develop', | ||
], | ||
python_requires='>=3.8, <3.12' | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
set -Eeuo pipefail | ||
|
||
base_dir=$(dirname $(dirname $0)) | ||
|
||
# Run the pre-commit checks | ||
pre-commit run --all-files | ||
|
||
isort --sp "${base_dir}/pyproject.toml" openfl_contrib | ||
|
||
black --config "${base_dir}/pyproject.toml" openfl_contrib | ||
|
||
flake8 --config "${base_dir}/setup.cfg" openfl_contrib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
set -Eeuo pipefail | ||
|
||
base_dir=$(dirname $(dirname $0)) | ||
|
||
# Run the pre-commit checks | ||
pre-commit run --all-files | ||
|
||
isort --sp "${base_dir}/pyproject.toml" --check openfl_contrib | ||
|
||
black --config "${base_dir}/pyproject.toml" --check openfl_contrib | ||
|
||
flake8 --config "${base_dir}/setup.cfg" --show-source openfl_contrib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters