Skip to content
Snippets Groups Projects
Commit afc40a4d authored by Lukasz Butkowski's avatar Lukasz Butkowski
Browse files

feat: python package wrapper added

Initial version wrapps Makefile. Works fine for HDL projects but not Yocto yet.
Yocto requires changes on yocto.mk which will brake current usage.
This change has to be done later.

Ref: #4
Ref: !72
parent f9fe2ac0
No related branches found
No related tags found
1 merge request!72Resolve "Make FWK as a python package"
*.pyc
/dist/
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "fwk"
dynamic = ["version"]
description = "FPGA Firmware Framework (FWK)"
# readme = {file = "README.md" , content-type = "text/markdown"}
requires-python = ">=3.8"
license = {text = "Apache-2.0"}
keywords = ["FPGA", "EDA"]
authors = [
{ name="MSK DESY", email="msk-firmware@desy.de" },
{ name="Lukasz Butkowski", email="lukasz.butkowski@desy.de" },
]
dependencies = [
"desyrdl>= 1.4.0",
"jinja2>=3.0",
]
[project.scripts]
fwk = "fwk.src.fwk:main"
# hatch tool settings
[tool.hatch.version]
path = "src/__init__.py"
[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]
[tool.hatch.build.targets.wheel]
packages = ["./"]
[tool.hatch.build.targets.wheel.sources]
"" = "fwk"
[project.optional-dependencies]
all = [
"cmake==3.31.*",
"cocotb==1.9.*",
"cocotbext-axi==0.1.*",
"cocotbext-spi==0.5.*",
"pyuvm==3.0.*",
"pytest==8.3.*",
"numpy==2.0.*",
"scipy==1.13.*",
"matplotlib==3.9.*"
]
\ No newline at end of file
__version__ = "0.99.0"
"""
Python wrapper for FWK make file
"""
import os
import sys
import subprocess
def main():
file_dir = os.path.dirname(__file__)
makefile_path = os.path.join(file_dir, "..", "Makefile")
process = subprocess.Popen(
["make -f " + makefile_path + " " + " ".join(sys.argv[1:])],
shell=True, stdout=subprocess.PIPE)
for c in iter(lambda: process.stdout.read(1), b""):
sys.stdout.buffer.write(c)
if __name__ == "__main__":
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment