esp-bool-parser 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. esp_bool_parser-0.1.0/.editorconfig +22 -0
  2. esp_bool_parser-0.1.0/.github/dependabot.yml +11 -0
  3. esp_bool_parser-0.1.0/.github/workflows/check-pre-commit.yml +18 -0
  4. esp_bool_parser-0.1.0/.github/workflows/issue_comment.yml +20 -0
  5. esp_bool_parser-0.1.0/.github/workflows/new_issues.yml +20 -0
  6. esp_bool_parser-0.1.0/.github/workflows/new_prs.yml +25 -0
  7. esp_bool_parser-0.1.0/.github/workflows/publish-pypi.yml +35 -0
  8. esp_bool_parser-0.1.0/.github/workflows/test-build-docs.yml +25 -0
  9. esp_bool_parser-0.1.0/.github/workflows/test-esp-bool-parser.yml +52 -0
  10. esp_bool_parser-0.1.0/.gitignore +161 -0
  11. esp_bool_parser-0.1.0/.pre-commit-config.yaml +49 -0
  12. esp_bool_parser-0.1.0/.readthedocs.yml +17 -0
  13. esp_bool_parser-0.1.0/CHANGELOG.md +10 -0
  14. esp_bool_parser-0.1.0/CONTRIBUTING.md +73 -0
  15. esp_bool_parser-0.1.0/LICENSE +202 -0
  16. esp_bool_parser-0.1.0/PKG-INFO +85 -0
  17. esp_bool_parser-0.1.0/README.md +51 -0
  18. esp_bool_parser-0.1.0/docs/_apidoc_templates/module.rst_t +8 -0
  19. esp_bool_parser-0.1.0/docs/_apidoc_templates/package.rst_t +49 -0
  20. esp_bool_parser-0.1.0/docs/_apidoc_templates/toc.rst_t +7 -0
  21. esp_bool_parser-0.1.0/docs/_static/espressif-logo.svg +77 -0
  22. esp_bool_parser-0.1.0/docs/_static/theme_overrides.css +55 -0
  23. esp_bool_parser-0.1.0/docs/_templates/layout.html +7 -0
  24. esp_bool_parser-0.1.0/docs/conf_common.py +53 -0
  25. esp_bool_parser-0.1.0/docs/en/Makefile +20 -0
  26. esp_bool_parser-0.1.0/docs/en/conf.py +11 -0
  27. esp_bool_parser-0.1.0/docs/en/index.rst +52 -0
  28. esp_bool_parser-0.1.0/docs/en/others/CHANGELOG.md +2 -0
  29. esp_bool_parser-0.1.0/docs/en/others/CONTRIBUTING.md +2 -0
  30. esp_bool_parser-0.1.0/esp_bool_parser/__init__.py +17 -0
  31. esp_bool_parser-0.1.0/esp_bool_parser/bool_parser.py +279 -0
  32. esp_bool_parser-0.1.0/esp_bool_parser/constants.py +61 -0
  33. esp_bool_parser-0.1.0/esp_bool_parser/soc_header.py +141 -0
  34. esp_bool_parser-0.1.0/esp_bool_parser/utils.py +26 -0
  35. esp_bool_parser-0.1.0/license_header.txt +2 -0
  36. esp_bool_parser-0.1.0/pyproject.toml +148 -0
  37. esp_bool_parser-0.1.0/tests/test_bool_parser.py +89 -0
  38. esp_bool_parser-0.1.0/tests/test_soc_caps.py +21 -0
@@ -0,0 +1,22 @@
1
+ # EditorConfig is awesome: https://EditorConfig.org
2
+
3
+ # top-most EditorConfig file
4
+ root = true
5
+
6
+ # Unix-style newlines with a newline ending every file
7
+ [*]
8
+ end_of_line = lf
9
+ insert_final_newline = true
10
+
11
+ [*.py]
12
+ charset = utf-8
13
+ indent_style = space
14
+ indent_size = 4
15
+
16
+ [*.rst]
17
+ indent_style = space
18
+ indent_size = 3
19
+
20
+ [*.md]
21
+ indent_style = space
22
+ indent_size = 4
@@ -0,0 +1,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "github-actions" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "weekly"
@@ -0,0 +1,18 @@
1
+ name: pre-commit check
2
+
3
+ on:
4
+ pull_request:
5
+
6
+ jobs:
7
+ pre-commit:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v4
11
+ with:
12
+ fetch-depth: 0
13
+ - uses: actions/setup-python@v5
14
+ - id: changed-files
15
+ uses: tj-actions/changed-files@v45
16
+ - uses: pre-commit/action@v3.0.1
17
+ with:
18
+ extra_args: --files ${{ steps.changed-files.outputs.all_changed_files }}
@@ -0,0 +1,20 @@
1
+ name: Sync issue comments to JIRA
2
+
3
+ # This workflow will be triggered when new issue comment is created (including PR comments)
4
+ on: issue_comment
5
+
6
+ jobs:
7
+ sync_issue_comments_to_jira:
8
+ name: Sync Issue Comments to Jira
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@master
12
+ - name: Sync issue comments to JIRA
13
+ uses: espressif/github-actions/sync_issues_to_jira@master
14
+ env:
15
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16
+ JIRA_PASS: ${{ secrets.JIRA_PASS }}
17
+ JIRA_PROJECT: RDT
18
+ JIRA_COMPONENT: idf-build-apps
19
+ JIRA_URL: ${{ secrets.JIRA_URL }}
20
+ JIRA_USER: ${{ secrets.JIRA_USER }}
@@ -0,0 +1,20 @@
1
+ name: Sync issues to Jira
2
+
3
+ # This workflow will be triggered when a new issue is opened
4
+ on: issues
5
+
6
+ jobs:
7
+ sync_issues_to_jira:
8
+ name: Sync issues to Jira
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@master
12
+ - name: Sync GitHub issues to Jira project
13
+ uses: espressif/github-actions/sync_issues_to_jira@master
14
+ env:
15
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16
+ JIRA_PASS: ${{ secrets.JIRA_PASS }}
17
+ JIRA_PROJECT: RDT
18
+ JIRA_COMPONENT: idf-build-apps
19
+ JIRA_URL: ${{ secrets.JIRA_URL }}
20
+ JIRA_USER: ${{ secrets.JIRA_USER }}
@@ -0,0 +1,25 @@
1
+ name: Sync remain PRs to Jira
2
+
3
+ # This workflow will be triggered every hour, to sync remaining PRs (i.e. PRs with zero comment) to Jira project
4
+ # Note that, PRs can also get synced when new PR comment is created
5
+ on:
6
+ schedule:
7
+ - cron: "0 * * * *"
8
+
9
+ jobs:
10
+ sync_prs_to_jira:
11
+ name: Sync PRs to Jira
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@master
15
+ - name: Sync PRs to Jira project
16
+ uses: espressif/github-actions/sync_issues_to_jira@master
17
+ with:
18
+ cron_job: true
19
+ env:
20
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21
+ JIRA_PASS: ${{ secrets.JIRA_PASS }}
22
+ JIRA_PROJECT: RDT
23
+ JIRA_COMPONENT: idf-build-apps
24
+ JIRA_URL: ${{ secrets.JIRA_URL }}
25
+ JIRA_USER: ${{ secrets.JIRA_USER }}
@@ -0,0 +1,35 @@
1
+ name: Publish PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ pypi-publish:
10
+ name: Upload release to PyPI
11
+ runs-on: ubuntu-22.04
12
+ # Specifying a GitHub environment is optional, but strongly encouraged
13
+ environment: pypi
14
+ permissions:
15
+ # IMPORTANT: this permission is mandatory for Trusted Publishing
16
+ id-token: write
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: '3.7'
25
+
26
+ - name: Install dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install flit
30
+
31
+ - name: Build package
32
+ run: flit build
33
+
34
+ - name: Publish package distributions to PyPI
35
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,25 @@
1
+ name: Test Build Docs
2
+
3
+ on:
4
+ pull_request:
5
+
6
+ jobs:
7
+ build-docs:
8
+ runs-on: ubuntu-22.04
9
+ steps:
10
+ - uses: actions/checkout@v4
11
+ - name: Set up Python
12
+ uses: actions/setup-python@v5
13
+ with:
14
+ python-version: '3.7'
15
+ - name: Install dependencies
16
+ run: |
17
+ python -m pip install --upgrade pip
18
+ pip install flit
19
+ flit install -s
20
+ - name: Build the docs
21
+ run: |
22
+ cd docs
23
+ pushd en && make html && popd
24
+ - name: markdown-link-check
25
+ uses: gaurav-nelson/github-action-markdown-link-check@1.0.15
@@ -0,0 +1,52 @@
1
+ name: Test ESP bool parser
2
+
3
+ on:
4
+ pull_request:
5
+ paths:
6
+ - 'esp_bool_parser/**'
7
+ push:
8
+ branches:
9
+ - main
10
+
11
+ env:
12
+ IDF_PATH: /opt/esp/idf
13
+
14
+ defaults:
15
+ run:
16
+ shell: bash
17
+
18
+ jobs:
19
+ build-python-packages:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: '3.7'
26
+ - run: |
27
+ pip install -U pip
28
+ pip install flit
29
+ flit build
30
+ - name: Upload built python packages
31
+ uses: actions/upload-artifact@v4
32
+ with:
33
+ name: wheel
34
+ path: dist/esp_bool_parser-*.whl
35
+
36
+
37
+ basic-testest:
38
+ runs-on: ubuntu-latest
39
+ env:
40
+ FLIT_ROOT_INSTALL: 1
41
+ steps:
42
+ - uses: actions/checkout@v4
43
+ - name: Build the Apps
44
+ run: |
45
+ pip install flit
46
+ flit install -s
47
+ pytest --cov esp_bool_parser --cov-report term-missing:skip-covered --junit-xml pytest.xml | tee pytest-coverage.txt
48
+ - name: Pytest coverage comment
49
+ uses: MishaKav/pytest-coverage-comment@main
50
+ with:
51
+ pytest-coverage-path: pytest-coverage.txt
52
+ junitxml-path: pytest.xml
@@ -0,0 +1,161 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/*/_build/
73
+ docs/en/references/api/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # poetry
99
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103
+ poetry.lock
104
+
105
+ # pdm
106
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107
+ #pdm.lock
108
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109
+ # in version control.
110
+ # https://pdm.fming.dev/#use-with-ide
111
+ .pdm.toml
112
+
113
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
114
+ __pypackages__/
115
+
116
+ # Celery stuff
117
+ celerybeat-schedule
118
+ celerybeat.pid
119
+
120
+ # SageMath parsed files
121
+ *.sage.py
122
+
123
+ # Environments
124
+ .env
125
+ .venv
126
+ env/
127
+ venv/
128
+ ENV/
129
+ env.bak/
130
+ venv.bak/
131
+
132
+ # Spyder project settings
133
+ .spyderproject
134
+ .spyproject
135
+
136
+ # Rope project settings
137
+ .ropeproject
138
+
139
+ # mkdocs documentation
140
+ /site
141
+
142
+ # mypy
143
+ .mypy_cache/
144
+ .dmypy.json
145
+ dmypy.json
146
+
147
+ # Pyre type checker
148
+ .pyre/
149
+
150
+ # pytype static type analyzer
151
+ .pytype/
152
+
153
+ # Cython debug symbols
154
+ cython_debug/
155
+
156
+ # PyCharm
157
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
158
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
159
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
160
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
161
+ .idea/
@@ -0,0 +1,49 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v5.0.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: mixed-line-ending
8
+ args: [ '-f=lf' ]
9
+ - repo: https://github.com/Lucas-C/pre-commit-hooks
10
+ rev: v1.5.5
11
+ hooks:
12
+ - id: insert-license
13
+ files: \.py$
14
+ args:
15
+ - --license-filepath
16
+ - license_header.txt # defaults to: LICENSE.txt
17
+ - --use-current-year
18
+ exclude: 'idf_build_apps/vendors/'
19
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
20
+ rev: 'v0.8.0'
21
+ hooks:
22
+ - id: ruff
23
+ args: ['--fix']
24
+ - id: ruff-format
25
+ - repo: https://github.com/pre-commit/mirrors-mypy
26
+ rev: 'v1.13.0'
27
+ hooks:
28
+ - id: mypy
29
+ args: ['--warn-unused-ignores']
30
+ additional_dependencies:
31
+ - pydantic<2.6
32
+ - pydantic-settings
33
+ - packaging
34
+ - toml
35
+ - pyparsing
36
+ - types-PyYAML
37
+ - types-toml
38
+ - pytest
39
+ - argcomplete>=3
40
+ - repo: https://github.com/hfudev/rstfmt
41
+ rev: v0.1.4
42
+ hooks:
43
+ - id: rstfmt
44
+ args: ['-w', '-1']
45
+ files: "docs\/.+rst$"
46
+ additional_dependencies:
47
+ - sphinx-argparse
48
+ - sphinx-tabs
49
+ - sphinxcontrib-mermaid
@@ -0,0 +1,17 @@
1
+ # .readthedocs.yaml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ version: 2
6
+
7
+ build:
8
+ os: ubuntu-22.04
9
+ tools:
10
+ python: "3.7"
11
+
12
+ python:
13
+ install:
14
+ - method: pip
15
+ path: .
16
+ extra_requirements:
17
+ - doc
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## v0.1.0 (2025-01-02)
6
+
7
+ ### Added
8
+
9
+ - **`parse_bool_expr`**: A method for handling complex boolean expressions, supporting logical operators like `and` and `or`.
10
+ - **`register_addition_attribute`**: A method for dynamically registering additional attributes with the `ChipAttr` class, enabling custom attribute handling for targets and configurations.
@@ -0,0 +1,73 @@
1
+ # Contributions Guide
2
+
3
+ Hi! We're glad that you're interested in contributing to `esp-bool-parser`. This document would guide you through the process of setting up the development environment, running tests, and building documentation.
4
+
5
+ ## Supported ESP-IDF Versions
6
+
7
+ Here's a table shows the supported ESP-IDF versions and the corresponding Python versions.
8
+
9
+ | ESP-IDF Version | ESP-IDF Supported Python Versions | esp-bool-parser Releases |
10
+ |-----------------|-----------------------------------|--------------------------|
11
+ | 5.0 | 3.7+ | main (0.x) |
12
+ | 5.1 | 3.7+ | main (0.x) |
13
+ | 5.2 | 3.7+ | main (0.x) |
14
+ | 5.3 | 3.8+ | main (0.x) |
15
+ | 5.4 | 3.8+ | main (0.x) |
16
+ | master (5.5) | 3.9+ | main (0.x) |
17
+
18
+ ## Setup the Dev Environment
19
+
20
+ 1. Create virtual environment
21
+
22
+ ```shell
23
+ python -m venv venv
24
+ ```
25
+
26
+ 2. Activate the virtual environment
27
+
28
+ ```shell
29
+ . ./venv/bin/activate
30
+ ```
31
+
32
+ 3. Install [flit][flit]
33
+
34
+ We use [flit][flit] to build the package and install the dependencies.
35
+
36
+ ```shell
37
+ pip install flit
38
+ ```
39
+
40
+ 4. Install all dependencies
41
+
42
+ All dependencies would be installed, and our package `esp-bool-parser` would be installed with editable mode.
43
+
44
+ ```shell
45
+ flit install -s
46
+ ```
47
+
48
+ ## Run Testing
49
+
50
+ We use [pytest][pytest] for testing.
51
+
52
+ ```shell
53
+ pytest
54
+ ```
55
+
56
+ ## Build Documentation
57
+
58
+ We use [sphinx][sphinx] and [autodoc][autodoc] for generating documentation and API references. Besides, we treat warnings as errors while building the documentation. Please fix them before your commits got merged.
59
+
60
+ ```shell
61
+ cd docs/en && make html
62
+ ```
63
+
64
+ For documentation preview, you may use any browser you prefer. The executable has to be searchable in `PATH`. For example we're using firefox here.
65
+
66
+ ```shell
67
+ firefox _build/html/index.html
68
+ ```
69
+
70
+ [flit]: https://flit.pypa.io/en/stable/index.html
71
+ [pytest]: https://docs.pytest.org/en/stable/contents.html
72
+ [sphinx]: https://www.sphinx-doc.org/en/master/
73
+ [autodoc]: https://www.sphinx-doc.org/en/master/usage/quickstart.html#autodoc