Skip to content

Commit

Permalink
Feature/devx upgrade packages (Udayraj123#144)
Browse files Browse the repository at this point in the history
* feat: upgrade dev packages; update pre-commit config

* feat: add and apply pretty-format-json; add large file hook

* feat: improve devx

* fix: remove traceback for exception raised from try except

* feat: upgrade requirements
  • Loading branch information
Udayraj123 authored Jun 25, 2023
1 parent d777136 commit 9147316
Show file tree
Hide file tree
Showing 33 changed files with 1,343 additions and 466 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
custom: ['https://www.paypal.me/Udayraj123/','https://www.buymeacoffee.com/Udayraj123']
4 changes: 2 additions & 2 deletions .github/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.8'
- uses: pre-commit/action@v2.0.3
python-version: '3.11'
- uses: pre-commit/action@v3.0.0
17 changes: 12 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ exclude: "__snapshots__/.*$"
default_install_hook_types: [pre-commit, pre-push]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.4.0
hooks:
- id: check-yaml
stages: [commit]
- id: check-added-large-files
args: ['--maxkb=300']
fail_fast: false
stages: [commit]
- id: pretty-format-json
args: ['--autofix', '--no-sort-keys']
- id: end-of-file-fixer
exclude_types: ["csv", "json"]
stages: [commit]
Expand All @@ -18,17 +24,18 @@ repos:
args: ["--profile", "black"]
stages: [commit]
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.3.0
hooks:
- id: black
fail_fast: true
stages: [commit]
- repo: https://github.com/pycqa/flake8
rev: 3.7.9
rev: 6.0.0
hooks:
- id: flake8
args:
- "F401,F841" # unused imports, unused variables
- "--ignore=E501,W503,E203,E741" # Line too long, Line break occurred before a binary operator, Whitespace before ':'
- "--ignore=E501,W503,E203,E741,F541" # Line too long, Line break occurred before a binary operator, Whitespace before ':'
fail_fast: true
stages: [commit]
- repo: local
hooks:
Expand Down
13 changes: 13 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

import argparse
import sys
from pathlib import Path

from src.entry import entry_point
Expand All @@ -30,6 +31,15 @@ def parse_args():
help="Specify an input directory.",
)

argparser.add_argument(
"-d",
"--debug",
required=False,
dest="debug",
action="store_false",
help="Enables debugging mode for showing detailed errors",
)

argparser.add_argument(
"-o",
"--outputDir",
Expand Down Expand Up @@ -74,6 +84,9 @@ def parse_args():


def entry_point_for_args(args):
if args["debug"] is True:
# Disable tracebacks
sys.tracebacklimit = 0
for root in args["input_paths"]:
entry_point(
Path(root),
Expand Down
9 changes: 5 additions & 4 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-r requirements.txt
pytest>=7.1.3
pytest-mock>=3.10.0
syrupy>=3.0.6
flake8>=6.0.0
freezegun>=1.2.2
pre-commit>=2.20.0
pre-commit>=3.3.3
pytest-mock>=3.11.1
pytest>=7.4.0
syrupy>=4.0.4
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
deepmerge>=1.0.1
deepmerge>=1.1.0
dotmap>=1.3.30
jsonschema>=4.16.0
matplotlib>=3.5.3
numpy>=1.23.2
pandas>=1.4.3
rich>=12.6.0
jsonschema>=4.17.3
matplotlib>=3.7.1
numpy>=1.25.0
pandas>=2.0.2
rich>=13.4.2
screeninfo>=0.8.1
56 changes: 35 additions & 21 deletions samples/community/Antibodyy/template.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
{
"pageDimensions": [ 299, 398 ],
"bubbleDimensions": [ 42, 42 ],
"fieldBlocks": {
"MCQBlock1": {
"fieldType": "QTYPE_MCQ5",
"origin": [65, 79],
"bubblesGap":43,
"labelsGap": 50,
"fieldLabels": ["q1..6"]
}
},
"preProcessors": [
{
"name": "CropPage",
"options": {
"morphKernel": [ 10, 10 ]
}
}
]
}
{
"pageDimensions": [
299,
398
],
"bubbleDimensions": [
42,
42
],
"fieldBlocks": {
"MCQBlock1": {
"fieldType": "QTYPE_MCQ5",
"origin": [
65,
79
],
"bubblesGap": 43,
"labelsGap": 50,
"fieldLabels": [
"q1..6"
]
}
},
"preProcessors": [
{
"name": "CropPage",
"options": {
"morphKernel": [
10,
10
]
}
}
]
}
Loading

0 comments on commit 9147316

Please sign in to comment.