Skip to content

Commit

Permalink
Merge pull request #8 from AllSpiceIO/develop
Browse files Browse the repository at this point in the history
Fix CI and Update README
  • Loading branch information
kdumontnu authored Sep 5, 2024
2 parents 6154d3b + 7fa591b commit 6cb38f6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/check-formatting-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: Lint and test

on:
push:
branches: [main]
branches:
- main
tags:
- "v*"
pull_request:
branches: ["**"]

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Add the following step to your actions:

```yaml
- name: Generate HTML component report using DigiKey API
uses: https://hub.allspice.io/Actions/digikey-search-html-report.git@v1
uses: https://hub.allspice.io/Actions/digikey-search-html-report.git@v3
with:
bom_file: bom.csv
digikey_client_id: ${{ secrets.DIGIKEY_CLIENT_ID }}
Expand Down
24 changes: 12 additions & 12 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def get_prices_for_target_qtys(part_data, single_pcb_part_qty, pcb_quantities):
# Initialize a dict for populating COGS for this PCB quantity
pricing_for_pcb_qty = {
"pcb_qty": pcb_qty,
"total_part_qty": part_qty
"total_part_qty": part_qty,
}
# Set the breakpoint index to start or end of list, or as None,
# depending on the quantity. Set pricing for edge case
Expand All @@ -247,12 +247,12 @@ def get_prices_for_target_qtys(part_data, single_pcb_part_qty, pcb_quantities):
else None
)
if breakpoint_idx is not None:
pricing_for_pcb_qty["break_qty"] = std_pricing[
pricing_for_pcb_qty["break_qty"] = std_pricing[breakpoint_idx][
"BreakQuantity"
]
pricing_for_pcb_qty["price_per_unit"] = std_pricing[
breakpoint_idx
]["BreakQuantity"]
pricing_for_pcb_qty["price_per_unit"] = (
std_pricing[breakpoint_idx]["UnitPrice"]
)
]["UnitPrice"]
pricing_for_pcb_qty["total_price"] = (
std_pricing[breakpoint_idx]["UnitPrice"] * part_qty
)
Expand All @@ -261,12 +261,12 @@ def get_prices_for_target_qtys(part_data, single_pcb_part_qty, pcb_quantities):
for breakpoint in std_pricing:
# If breakpoint index already set, populate
if part_qty >= breakpoint["BreakQuantity"]:
pricing_for_pcb_qty["break_qty"] = (
breakpoint["BreakQuantity"]
)
pricing_for_pcb_qty["price_per_unit"] = (
breakpoint["UnitPrice"]
)
pricing_for_pcb_qty["break_qty"] = breakpoint[
"BreakQuantity"
]
pricing_for_pcb_qty["price_per_unit"] = breakpoint[
"UnitPrice"
]
pricing_for_pcb_qty["total_price"] = (
breakpoint["UnitPrice"] * part_qty
)
Expand Down

0 comments on commit 6cb38f6

Please sign in to comment.