Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: replace if_parser with esp_bool_parser package #176

Merged
merged 4 commits into from
Jan 9, 2025

Conversation

horw
Copy link
Member

@horw horw commented Jan 7, 2025

Description

We have already moved the if_parser logic outside of idf-build-apps, so it's time to replace the if_parser in idf-build-apps with esp_bool_parser.

Also, I think we can mention SUPPORTED_TARGET in the esp_bool_parser docs, because some libraries will be using it.

Related

Testing


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@horw horw force-pushed the feat/use-esp-bool-parser branch 2 times, most recently from 1a2f8fa to a88fa72 Compare January 7, 2025 06:32
@horw horw requested a review from hfudev January 7, 2025 06:32
Copy link
Member

@hfudev hfudev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think we shall make a few more changes on the esp-bool-parser package before we merge this PR.

idf_build_apps/manifest/__init__.py Outdated Show resolved Hide resolved
idf_build_apps/manifest/manifest.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
tests/test_manifest.py Outdated Show resolved Hide resolved
@horw horw force-pushed the feat/use-esp-bool-parser branch from a88fa72 to 8adac3b Compare January 7, 2025 08:47
Copy link
Member

@hfudev hfudev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

idf_build_apps/manifest/manifest.py Outdated Show resolved Hide resolved
@horw horw force-pushed the feat/use-esp-bool-parser branch 2 times, most recently from dba0a9b to d1380bb Compare January 7, 2025 11:58
@hfudev
Copy link
Member

hfudev commented Jan 7, 2025

could you also replace those constants in idf_build_apps.constants to "import from esp-bool-parser" as well? Otherwise it would be a breaking change of the codes which call from idf_build_apps.constants import SUPPORTED_TARGETS (for example)

so we could put all the parsing logic in one place.

@horw horw force-pushed the feat/use-esp-bool-parser branch 3 times, most recently from f17c37c to 1485eaf Compare January 7, 2025 12:30
@horw
Copy link
Member Author

horw commented Jan 7, 2025

@hfudev What about this SHA test? Is it related to this PR?

@hfudev
Copy link
Member

hfudev commented Jan 7, 2025

@hfudev What about this SHA test? Is it related to this PR?

Yes the failure is related. I'm afraid we have to update the

The code is pickle.dumps(obj). now we change the obj class so the sha value is changed.

We shall somehow rely on the obj.stmt.value, instead of the object. could you help update the sha function and fixing the test cases?

@horw horw force-pushed the feat/use-esp-bool-parser branch from 61bc052 to 67f1ea6 Compare January 8, 2025 08:58
Copy link

github-actions bot commented Jan 8, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
idf_build_apps
   __main__.py330%4–9
   app.py5238185%206, 251, 260–262, 294, 306, 323, 364–365, 368, 378–379, 390–393, 453–458, 478, 516, 572–580, 590–591, 601, 619–620, 622, 638–647, 663–701, 706–707, 711–712, 723–725, 731, 832–840, 850–880, 884–894, 985–991, 994, 1016
   args.py2913389%154, 310, 323, 330, 351–356, 366–371, 537, 540–541, 547, 557–559, 562, 587–588, 591–592, 721–722, 783, 785, 845, 864–874
   autocompletions.py292417%16–23, 31–54
   finder.py84693%79–80, 150, 167–169
   log.py48492%37, 50, 55, 80
   main.py1996169%76–80, 94–99, 140–144, 174, 198–200, 204, 209–222, 237–240, 251–276, 366–373, 382–383, 405–413, 416, 422–423, 429–431
   session_args.py54787%46–50, 56, 70
   utils.py1882786%26, 35, 113, 130–131, 151–155, 203, 246, 273–279, 292–295, 309–315, 380
idf_build_apps/junit
   report.py93990%82, 92, 109–111, 137, 144–145, 170
   utils.py291066%18, 26–35
idf_build_apps/manifest
   manifest.py223896%98, 147, 169, 314, 345–346, 365, 409
   soc_header.py220%4–6
idf_build_apps/vendors
   pydantic_sources.py64691%50, 73, 76–79, 96
TOTAL192628185% 

Tests Skipped Failures Errors Time
109 0 💤 0 ❌ 0 🔥 9m 12s ⏱️

@horw
Copy link
Member Author

horw commented Jan 8, 2025

We shall somehow rely on the obj.stmt.value, instead of the object. could you help update the sha function and fixing the test cases?

I used __repr__ to make sha depend on the class arguments. WDYT?

@horw horw force-pushed the feat/use-esp-bool-parser branch from 67f1ea6 to 92fc2e9 Compare January 8, 2025 09:24
idf_build_apps/manifest/constants.py Outdated Show resolved Hide resolved
idf_build_apps/manifest/manifest.py Show resolved Hide resolved
idf_build_apps/manifest/manifest.py Show resolved Hide resolved
@horw horw force-pushed the feat/use-esp-bool-parser branch from 92fc2e9 to 00f7342 Compare January 8, 2025 09:54
@horw horw requested a review from hfudev January 8, 2025 11:09
@hfudev hfudev merged commit d8f4bea into main Jan 9, 2025
8 checks passed
@hfudev
Copy link
Member

hfudev commented Jan 9, 2025

LGTM! Nice cleanup. Could you help create a follow-up PR to update the documentation to mention that the limitation of "chained operators" has been eliminated?

@hfudev hfudev deleted the feat/use-esp-bool-parser branch January 9, 2025 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants