pytest-fusesoc 0.0.1__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.
@@ -0,0 +1,28 @@
1
+ # SPDX-FileCopyrightText: 2026 Tymoteusz Blazejczyk <tymoteusz.blazejczyk@tymonx.com>
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Ignore all
5
+ *
6
+
7
+ # Except the following
8
+ !*/
9
+ !.gitignore
10
+ !*.conf
11
+ !*.core
12
+ !*.toml
13
+ !*.yaml
14
+ !*.vhdl
15
+ !*.vhd
16
+ !*.yml
17
+ !*.txt
18
+ !*.svh
19
+ !*.sv
20
+ !*.py
21
+ !*.md
22
+ !*.vh
23
+ !*.v
24
+
25
+ # Ignore these directories
26
+ .*venv*/
27
+ .*cache*/
28
+ *build*/
@@ -0,0 +1,69 @@
1
+ ---
2
+ # SPDX-FileCopyrightText: 2026 Tymoteusz Blazejczyk <tymoteusz.blazejczyk@tymonx.com>
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ workflow:
5
+ rules:
6
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
7
+ - if: $CI_PIPELINE_SOURCE == "schedule"
8
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
9
+ - if: $CI_COMMIT_TAG
10
+
11
+ .python:
12
+ variables:
13
+ PYTHON_VERSION: '3.12'
14
+ PYTHON_IMAGE: ghcr.io/astral-sh/uv:python${PYTHON_VERSION}-trixie
15
+ image: ${PYTHON_IMAGE}
16
+ needs: []
17
+
18
+ .python-venv:
19
+ extends: .python
20
+ variables:
21
+ PIP_DEPENDENCY: dev
22
+ before_script:
23
+ - test -d .venv || uv venv
24
+ - . .venv/bin/activate
25
+ - uv pip install --editable .[${PIP_DEPENDENCY:-dev}]
26
+
27
+ .cache:
28
+ variables:
29
+ XDG_CACHE_HOME: ${CI_PROJECT_DIR}/.cache
30
+ cache:
31
+ - key: ${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}
32
+ fallback_keys:
33
+ - ${CI_JOB_NAME}-${CI_DEFAULT_BRANCH}
34
+ - ${CI_JOB_NAME}-default
35
+ paths: [.*cache/, .venv/]
36
+
37
+ .pre-commit:
38
+ extends: [.python-venv, .cache]
39
+ variables:
40
+ PIP_DEPENDENCY: lint
41
+ script: [pre-commit run --color always --all-files]
42
+
43
+ .test:
44
+ extends: [.python-venv, .cache]
45
+ variables:
46
+ PIP_DEPENDENCY: test
47
+
48
+ .deploy:
49
+ extends: .python
50
+ stage: deploy
51
+ rules:
52
+ - if: $CI_COMMIT_TAG || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
53
+ when: always
54
+ - when: never
55
+ script: [uv build, uv publish]
56
+
57
+ pre-commit:
58
+ extends: .pre-commit
59
+
60
+ # deploy-pypi-public:
61
+ # extends: .deploy
62
+ # variables:
63
+ # UV_PUBLISH_TOKEN: $PYPI_API_TOKEN
64
+ deploy-pypi-gitlab:
65
+ extends: .deploy
66
+ variables:
67
+ UV_PUBLISH_USERNAME: gitlab-ci-token
68
+ UV_PUBLISH_PASSWORD: $CI_JOB_TOKEN
69
+ UV_PUBLISH_URL: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
@@ -0,0 +1,72 @@
1
+ ---
2
+ # SPDX-FileCopyrightText: 2026 Tymoteusz Blazejczyk <tymoteusz.blazejczyk@tymonx.com>
3
+ # SPDX-License-Identifier: Apache-2.0
4
+
5
+ repos:
6
+ - repo: https://github.com/pre-commit/pre-commit-hooks
7
+ rev: v6.0.0
8
+ hooks:
9
+ - id: trailing-whitespace
10
+ - id: end-of-file-fixer
11
+
12
+ - repo: local
13
+ hooks:
14
+ - id: mdformat
15
+ name: mdformat
16
+ entry: mdformat
17
+ language: system
18
+ types: [markdown]
19
+
20
+ - id: ruff-format
21
+ name: ruff-format
22
+ entry: ruff
23
+ args: [format]
24
+ language: system
25
+ types: [python]
26
+
27
+ - id: ruff-check
28
+ name: ruff-check
29
+ entry: ruff
30
+ args: [check, --fix]
31
+ language: system
32
+ types: [python]
33
+
34
+ - id: yamlfix
35
+ name: yamlfix
36
+ entry: yamlfix
37
+ language: system
38
+ types: [yaml]
39
+
40
+ - id: core-format
41
+ name: core-format
42
+ entry: yamlfix
43
+ args: [--config-file, .yamlfix-core.toml]
44
+ language: system
45
+ files: \.(core)$
46
+
47
+ - id: codespell
48
+ name: codespell
49
+ entry: codespell
50
+ language: system
51
+ types: [file]
52
+
53
+ - id: reuse
54
+ name: reuse
55
+ entry: reuse
56
+ args: [lint-file]
57
+ language: system
58
+ types: [file]
59
+
60
+ - id: mypy
61
+ name: mypy
62
+ entry: mypy
63
+ language: system
64
+ types: [python]
65
+ require_serial: true
66
+
67
+ - id: pyright
68
+ name: pyright
69
+ entry: pyright
70
+ language: system
71
+ types: [python]
72
+ require_serial: true
@@ -0,0 +1,6 @@
1
+ # SPDX-FileCopyrightText: 2026 Tymoteusz Blazejczyk <tymoteusz.blazejczyk@tymonx.com>
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ explicit_start = false
5
+ whitelines = 1
6
+ section_whitelines = 1
@@ -0,0 +1,73 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
56
+
57
+ APPENDIX: How to apply the Apache License to your work.
58
+
59
+ To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
60
+
61
+ Copyright 2026 Tymoteusz Blazejczyk <tymoteusz.blazejczyk@tymonx.com>
62
+
63
+ Licensed under the Apache License, Version 2.0 (the "License");
64
+ you may not use this file except in compliance with the License.
65
+ You may obtain a copy of the License at
66
+
67
+ http://www.apache.org/licenses/LICENSE-2.0
68
+
69
+ Unless required by applicable law or agreed to in writing, software
70
+ distributed under the License is distributed on an "AS IS" BASIS,
71
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
72
+ See the License for the specific language governing permissions and
73
+ limitations under the License.
@@ -0,0 +1,102 @@
1
+ Metadata-Version: 2.4
2
+ Name: pytest-fusesoc
3
+ Version: 0.0.1
4
+ Summary: Pytest plugin to run FuseSoC simulation targets.
5
+ Project-URL: Homepage, https://gitlab.com/tymonx/pytest-fusesoc
6
+ Project-URL: Source, https://gitlab.com/tymonx/pytest-fusesoc.git
7
+ Project-URL: Issues, https://gitlab.com/tymonx/pytest-fusesoc/-/issues
8
+ Project-URL: Documentation, https://gitlab.com/tymonx/pytest-fusesoc/-/blob/HEAD/README.md
9
+ Author-email: Tymoteusz Blazejczyk <tymoteusz.blazejczyk@tymonx.com>
10
+ License-Expression: Apache-2.0
11
+ Keywords: asic,build,cadence,cocotb,eda,flow,fpga,fusesoc,hdl,modelsim,plugin,pytest,python,questa,rtl,siemens,simulator,synopsys,systemverilog,test,testing,vcs,verilog,vhdl,xcelium
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Framework :: Pytest
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Natural Language :: English
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Programming Language :: Python :: Implementation :: CPython
24
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
25
+ Classifier: Topic :: Software Development
26
+ Classifier: Topic :: Software Development :: Build Tools
27
+ Classifier: Topic :: Software Development :: Testing
28
+ Classifier: Topic :: Software Development :: Testing :: Unit
29
+ Requires-Python: >=3.10
30
+ Requires-Dist: fusesoc
31
+ Requires-Dist: pytest
32
+ Requires-Dist: pyyaml
33
+ Provides-Extra: cocotb
34
+ Requires-Dist: cocotb==2.0.1; extra == 'cocotb'
35
+ Provides-Extra: dev
36
+ Requires-Dist: cocotb==2.0.1; extra == 'dev'
37
+ Requires-Dist: codespell==2.4.2; extra == 'dev'
38
+ Requires-Dist: mdformat==1.0.0; extra == 'dev'
39
+ Requires-Dist: mypy==2.1.0; extra == 'dev'
40
+ Requires-Dist: nodejs-wheel-binaries==24.15.0; extra == 'dev'
41
+ Requires-Dist: pre-commit==4.6.0; extra == 'dev'
42
+ Requires-Dist: pyright==1.1.409; extra == 'dev'
43
+ Requires-Dist: pytest-cov==7.1.0; extra == 'dev'
44
+ Requires-Dist: pytest-html==4.2.0; extra == 'dev'
45
+ Requires-Dist: reuse==6.2.0; extra == 'dev'
46
+ Requires-Dist: ruff==0.15.14; extra == 'dev'
47
+ Requires-Dist: types-pyyaml==6.0.12.20260518; extra == 'dev'
48
+ Requires-Dist: yamlfix==1.19.1; extra == 'dev'
49
+ Provides-Extra: lint
50
+ Requires-Dist: cocotb==2.0.1; extra == 'lint'
51
+ Requires-Dist: codespell==2.4.2; extra == 'lint'
52
+ Requires-Dist: mdformat==1.0.0; extra == 'lint'
53
+ Requires-Dist: mypy==2.1.0; extra == 'lint'
54
+ Requires-Dist: nodejs-wheel-binaries==24.15.0; extra == 'lint'
55
+ Requires-Dist: pre-commit==4.6.0; extra == 'lint'
56
+ Requires-Dist: pyright==1.1.409; extra == 'lint'
57
+ Requires-Dist: reuse==6.2.0; extra == 'lint'
58
+ Requires-Dist: ruff==0.15.14; extra == 'lint'
59
+ Requires-Dist: types-pyyaml==6.0.12.20260518; extra == 'lint'
60
+ Requires-Dist: yamlfix==1.19.1; extra == 'lint'
61
+ Provides-Extra: test
62
+ Requires-Dist: cocotb==2.0.1; extra == 'test'
63
+ Requires-Dist: pytest-cov==7.1.0; extra == 'test'
64
+ Requires-Dist: pytest-html==4.2.0; extra == 'test'
65
+ Description-Content-Type: text/markdown
66
+
67
+ <!-- SPDX-FileCopyrightText: 2026 Tymoteusz Blazejczyk <tymoteusz.blazejczyk@tymonx.com> -->
68
+
69
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
70
+
71
+ # pytest-fusesoc
72
+
73
+ [Pytest] plugin to run simulation targets of [FuseSoc] core.
74
+
75
+ ## Testing
76
+
77
+ Create Python virtual environment:
78
+
79
+ ```plaintext
80
+ uv venv
81
+ ```
82
+
83
+ Activate created Python virtual environment:
84
+
85
+ ```plaintext
86
+ . .venv/bin/activate
87
+ ```
88
+
89
+ Install project in editable mode with `dev` dependencies:
90
+
91
+ ```plaintext
92
+ uv pip install --editable .[dev]
93
+ ```
94
+
95
+ Run tests:
96
+
97
+ ```plaintext
98
+ pytest -s -v
99
+ ```
100
+
101
+ [fusesoc]: https://fusesoc.readthedocs.io
102
+ [pytest]: https://docs.pytest.org
@@ -0,0 +1,36 @@
1
+ <!-- SPDX-FileCopyrightText: 2026 Tymoteusz Blazejczyk <tymoteusz.blazejczyk@tymonx.com> -->
2
+
3
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
4
+
5
+ # pytest-fusesoc
6
+
7
+ [Pytest] plugin to run simulation targets of [FuseSoc] core.
8
+
9
+ ## Testing
10
+
11
+ Create Python virtual environment:
12
+
13
+ ```plaintext
14
+ uv venv
15
+ ```
16
+
17
+ Activate created Python virtual environment:
18
+
19
+ ```plaintext
20
+ . .venv/bin/activate
21
+ ```
22
+
23
+ Install project in editable mode with `dev` dependencies:
24
+
25
+ ```plaintext
26
+ uv pip install --editable .[dev]
27
+ ```
28
+
29
+ Run tests:
30
+
31
+ ```plaintext
32
+ pytest -s -v
33
+ ```
34
+
35
+ [fusesoc]: https://fusesoc.readthedocs.io
36
+ [pytest]: https://docs.pytest.org
@@ -0,0 +1,5 @@
1
+ # SPDX-FileCopyrightText: 2026 Tymoteusz Blazejczyk <tymoteusz.blazejczyk@tymonx.com>
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ [library.tests]
5
+ location = tests
@@ -0,0 +1,128 @@
1
+ # SPDX-FileCopyrightText: 2026 Tymoteusz Blazejczyk <tymoteusz.blazejczyk@tymonx.com>
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-your-pyproject-toml
5
+
6
+ [project]
7
+ name = "pytest-fusesoc"
8
+ readme = "README.md"
9
+ dynamic = ["version"]
10
+ license = "Apache-2.0"
11
+ description = "Pytest plugin to run FuseSoC simulation targets."
12
+ requires-python = ">=3.10"
13
+ authors = [{ name = "Tymoteusz Blazejczyk", email = "tymoteusz.blazejczyk@tymonx.com" }]
14
+
15
+ dependencies = [
16
+ "pytest",
17
+ "fusesoc",
18
+ "pyyaml",
19
+ ]
20
+
21
+ # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#keywords
22
+ keywords = [
23
+ "python",
24
+ "pytest",
25
+ "cocotb",
26
+ "plugin",
27
+ "test",
28
+ "testing",
29
+ "simulator",
30
+ "fusesoc",
31
+ "build",
32
+ "hdl",
33
+ "rtl",
34
+ "eda",
35
+ "flow",
36
+ "vhdl",
37
+ "verilog",
38
+ "systemverilog",
39
+ "fpga",
40
+ "asic",
41
+ "cadence",
42
+ "xcelium",
43
+ "siemens",
44
+ "modelsim",
45
+ "questa",
46
+ "synopsys", # codespell:ignore
47
+ "vcs",
48
+ ]
49
+
50
+ # https://pypi.org/classifiers/
51
+ # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#classifiers
52
+ classifiers = [
53
+ "Development Status :: 5 - Production/Stable",
54
+ "Intended Audience :: Developers",
55
+ "Natural Language :: English",
56
+ "Operating System :: OS Independent",
57
+
58
+ "Topic :: Software Development",
59
+ "Topic :: Software Development :: Testing",
60
+ "Topic :: Software Development :: Testing :: Unit",
61
+ "Topic :: Software Development :: Build Tools",
62
+ "Framework :: Pytest",
63
+
64
+ "Programming Language :: Python :: 3",
65
+ "Programming Language :: Python :: 3.10",
66
+ "Programming Language :: Python :: 3.11",
67
+ "Programming Language :: Python :: 3.12",
68
+ "Programming Language :: Python :: 3.13",
69
+ "Programming Language :: Python :: 3.14",
70
+ "Programming Language :: Python :: Implementation :: CPython",
71
+ "Programming Language :: Python :: Implementation :: PyPy",
72
+ ]
73
+
74
+ # https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#urls
75
+ # https://packaging.python.org/en/latest/specifications/well-known-project-urls/#well-known-labels
76
+ [project.urls]
77
+ Homepage = "https://gitlab.com/tymonx/pytest-fusesoc"
78
+ Source = "https://gitlab.com/tymonx/pytest-fusesoc.git"
79
+ Issues = "https://gitlab.com/tymonx/pytest-fusesoc/-/issues"
80
+ Documentation = "https://gitlab.com/tymonx/pytest-fusesoc/-/blob/HEAD/README.md"
81
+
82
+ [project.entry-points.pytest11]
83
+ fusesoc = "pytest_fusesoc.plugin"
84
+
85
+ [project.optional-dependencies]
86
+ cocotb = [
87
+ "cocotb==2.0.1",
88
+ ]
89
+ lint = [
90
+ "pytest-fusesoc[cocotb]",
91
+ "pre-commit==4.6.0",
92
+ "ruff==0.15.14",
93
+ "mypy==2.1.0",
94
+ "reuse==6.2.0",
95
+ "mdformat==1.0.0",
96
+ "yamlfix==1.19.1",
97
+ "pyright==1.1.409",
98
+ "nodejs-wheel-binaries==24.15.0",
99
+ "codespell==2.4.2",
100
+ "types-pyyaml==6.0.12.20260518",
101
+ ]
102
+ test = [
103
+ "pytest-fusesoc[cocotb]",
104
+ "pytest-cov==7.1.0",
105
+ "pytest-html==4.2.0",
106
+ ]
107
+ dev = [
108
+ "pytest-fusesoc[lint]",
109
+ "pytest-fusesoc[test]",
110
+ ]
111
+
112
+ [build-system]
113
+ requires = ["hatchling", "hatch-vcs"]
114
+ build-backend = "hatchling.build"
115
+
116
+ [tool.hatch.build.targets.wheel]
117
+ packages = ["src/pytest_fusesoc"]
118
+
119
+ [tool.hatch.version]
120
+ source = "vcs"
121
+
122
+ [tool.pytest]
123
+ pythonpath = ["src", "."]
124
+ testpaths = ["tests"]
125
+
126
+ [tool.yamlfix]
127
+ whitelines = 1
128
+ section_whitelines = 1
@@ -0,0 +1,8 @@
1
+ # SPDX-FileCopyrightText: 2026 Tymoteusz Blazejczyk <tymoteusz.blazejczyk@tymonx.com>
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """Pytest plugin to run simulation targets."""
5
+
6
+ from .fusesoc import FuseSoC
7
+
8
+ __all__ = ["FuseSoC"]
@@ -0,0 +1,71 @@
1
+ # SPDX-FileCopyrightText: 2026 Tymoteusz Blazejczyk <tymoteusz.blazejczyk@tymonx.com>
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """Representation of FuseSoC core file."""
5
+
6
+ from typing import Any
7
+ from collections.abc import Iterable
8
+
9
+ from pytest import Item, Collector, File as PytestFile
10
+ from yaml import load
11
+
12
+ try:
13
+ from yaml import CLoader as Loader
14
+ except ImportError:
15
+ from yaml import Loader # type: ignore
16
+
17
+ from .target import Target
18
+ from .tools import TOOLS
19
+
20
+
21
+ class File(PytestFile):
22
+ """Collector to collect all simulation targets defined in FuseSoC ``*.core`` file."""
23
+
24
+ def collect(self) -> Iterable[Item | Collector]:
25
+ """Collect all simulation targets from FuseSoC ``*.core`` file."""
26
+ self.obj = lambda: None
27
+
28
+ with self.path.open("r") as file:
29
+ core: dict[str, Any] = load(file, Loader=Loader)
30
+
31
+ description: str | None = core.get("description")
32
+
33
+ if description:
34
+ self.obj.__doc__ = description
35
+
36
+ system: str | None = core.get("name")
37
+
38
+ if not system:
39
+ return []
40
+
41
+ targets: list[Target] = []
42
+
43
+ for name, item in core.get("targets", {}).items():
44
+ if not name or name[0] == ".":
45
+ continue
46
+
47
+ description = item.get("description")
48
+ flow: str | None = item.get("flow")
49
+ tool: str | None
50
+
51
+ if flow:
52
+ flow_options: dict[str, Any] | None = item.get("flow_options")
53
+ tool = flow_options.get("tool") if flow_options else None
54
+ else:
55
+ tool = item.get("default_tool")
56
+
57
+ if flow == "sim" or tool in TOOLS:
58
+ flags: dict[str, object] | None = item.get("flags")
59
+
60
+ target: Target = Target.from_parent(
61
+ self,
62
+ name=name,
63
+ system=system,
64
+ tool=tool,
65
+ flags=flags,
66
+ description=description,
67
+ )
68
+
69
+ targets.append(target)
70
+
71
+ return targets
@@ -0,0 +1,35 @@
1
+ # SPDX-FileCopyrightText: 2026 Tymoteusz Blazejczyk <tymoteusz.blazejczyk@tymonx.com>
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """Handling FuseSoC flag arguments."""
5
+
6
+ from typing import Any
7
+ from collections.abc import MutableMapping, Sequence
8
+
9
+ from argparse import ArgumentParser, Namespace, Action
10
+
11
+
12
+ class Flags(Action):
13
+ """Handling FuseSoC flag argument."""
14
+
15
+ def __call__(
16
+ self,
17
+ parser: ArgumentParser,
18
+ namespace: Namespace,
19
+ values: str | Sequence[Any] | None,
20
+ option_string: str | None = None,
21
+ ) -> None:
22
+ if getattr(namespace, self.dest, None) is None:
23
+ setattr(namespace, self.dest, {})
24
+
25
+ flags: MutableMapping[str, object] = getattr(namespace, self.dest)
26
+
27
+ if isinstance(values, str):
28
+ if values.startswith("+"):
29
+ flags[values[1:]] = True
30
+
31
+ elif values.startswith("-"):
32
+ flags[values[1:]] = False
33
+
34
+ else:
35
+ flags[values] = True