Skip to content

Commit 7ff8bba

Browse files
committed
fix: GitHub Actions workflow and flake8 configuration
- Fixed indentation in test-and-build.yml test-install job - Added --exclude flag to flake8 commands to skip cryptod directory - Created .flake8 config file to globally exclude cryptod from linting - Updated black and isort commands to exclude cryptod - All 117 tests passing locally
1 parent 6236654 commit 7ff8bba

2 files changed

Lines changed: 27 additions & 13 deletions

File tree

.flake8

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[flake8]
2+
max-line-length = 120
3+
max-complexity = 12
4+
exclude =
5+
.git,
6+
__pycache__,
7+
.venv,
8+
venv,
9+
build,
10+
dist,
11+
*.egg-info,
12+
src/libcrypto/cryptod,
13+
.pytest_cache,
14+
.mypy_cache

.github/workflows/test-and-build.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,21 @@ jobs:
8383
- name: Lint with flake8
8484
run: |
8585
# Stop the build if there are Python syntax errors or undefined names
86-
flake8 src/libcrypto --count --select=E9,F63,F7,F82 --show-source --statistics
86+
flake8 src/libcrypto --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=src/libcrypto/cryptod
8787
# Exit-zero treats all errors as warnings
88-
flake8 src/libcrypto --count --exit-zero --max-complexity=12 --max-line-length=120 --statistics
88+
flake8 src/libcrypto --count --exit-zero --max-complexity=12 --max-line-length=120 --statistics --exclude=src/libcrypto/cryptod
8989
9090
- name: Check formatting with black (optional)
9191
continue-on-error: true
9292
run: |
9393
pip install black
94-
black --check src/libcrypto
94+
black --check src/libcrypto --exclude="cryptod"
9595
9696
- name: Check import sorting with isort (optional)
9797
continue-on-error: true
9898
run: |
9999
pip install isort
100-
isort --check-only src/libcrypto
100+
isort --check-only src/libcrypto --skip-glob="*/cryptod/*"
101101
102102
build:
103103
name: Build Distribution
@@ -164,14 +164,14 @@ jobs:
164164
run: |
165165
pip install dist/*.whl
166166
167-
- name: Test basic import
168-
run: |
169-
python -c "import libcrypto; from libcrypto import PrivateKey, Wallet, generate_mnemonic; print('LibCrypto imported successfully')"
167+
- name: Test basic import
168+
run: |
169+
python -c "import libcrypto; from libcrypto import PrivateKey, Wallet, generate_mnemonic; print('LibCrypto imported successfully')"
170170
171-
- name: Verify no external crypto dependencies
172-
run: |
173-
python -c "import sys; import libcrypto; assert 'ecdsa' not in sys.modules, 'ecdsa should not be loaded'; print('No external crypto dependencies detected')"
171+
- name: Verify no external crypto dependencies
172+
run: |
173+
python -c "import sys; import libcrypto; assert 'ecdsa' not in sys.modules, 'ecdsa should not be loaded'; print('No external crypto dependencies detected')"
174174
175-
- name: Test key generation
176-
run: |
177-
python -c "from libcrypto import PrivateKey; pk = PrivateKey(1); print('Public key: ' + pk.get_public_key().hex[:32] + '...'); print('Key generation works')"
175+
- name: Test key generation
176+
run: |
177+
python -c "from libcrypto import PrivateKey; pk = PrivateKey(1); print('Public key: ' + pk.get_public_key().hex[:32] + '...'); print('Key generation works')"

0 commit comments

Comments
 (0)