1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] build Nar for Python processor NIFI 2.0.0-M4

Discussão em 'Python' iniciado por Stack, Outubro 7, 2024.

  1. Stack

    Stack Membro Participativo

    i am trying to create python processor for NIFI 2.0.0-M4 using python 3.12, i want to build the nar for python processor with the help of hatch and hatch-datavolo-nar package with all dependencies bundled in nar. I have created python project with command

    hatch new trainer

    then added processor .py file into src/trainer and this my pyproject.toml file


    [build-system]
    requires = ["hatchling", "hatch-datavolo-nar"]
    build-backend = "hatchling.build"


    [project]
    name = "trainer"
    dynamic = ["version"]
    description = "Simple trainer processor"
    readme = "README.md"
    requires-python = ">=3.11"
    license = "MIT"
    keywords = ["trainer"]
    authors = [
    { name = "U.N. Owen", email = "void@some.where" },
    ]

    dependencies = ["neuralprophet", "numpy", "pandas",]

    [tool.hatch.version]
    path = "src/trainer/__about__.py"


    [tool.hatch.build.targets.nar]
    packages = ["src/trainer"]


    i am trying to build with

    hatch build --target nar

    but getting error at NAR-INF dependencies bundling

    Processing dependencies...
    Loading dependencies
    Traceback (most recent call last):
    File "<frozen runpy>", line 198, in _run_module_as_main
    File "<frozen runpy>", line 88, in _run_code
    File "C:\Users\ayush.raj\AppData\Local\hatch\env\virtual\neuralprophet\IXYHy4qS\neuralprophet-build\Lib\site-packages\hatchling\__main__.py", line 6, in <module>
    sys.exit(hatchling())
    ^^^^^^^^^^^
    File "C:\Users\ayush.raj\AppData\Local\hatch\env\virtual\neuralprophet\IXYHy4qS\neuralprophet-build\Lib\site-packages\hatchling\cli\__init__.py", line 26, in hatchling
    command(**kwargs)
    File "C:\Users\ayush.raj\AppData\Local\hatch\env\virtual\neuralprophet\IXYHy4qS\neuralprophet-build\Lib\site-packages\hatchling\cli\build\__init__.py", line 82, in build_impl
    for artifact in builder.build(
    File "C:\Users\ayush.raj\AppData\Local\hatch\env\virtual\neuralprophet\IXYHy4qS\neuralprophet-build\Lib\site-packages\hatchling\builders\plugin\interface.py", line 155, in build
    artifact = version_api[version](directory, **build_data)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\ayush.raj\AppData\Local\hatch\env\virtual\neuralprophet\IXYHy4qS\neuralprophet-build\Lib\site-packages\hatch_datavolo_nar\builder.py", line 115, in build_standard
    self.process_dependencies(build_directory, nar)
    File "C:\Users\ayush.raj\AppData\Local\hatch\env\virtual\neuralprophet\IXYHy4qS\neuralprophet-build\Lib\site-packages\hatch_datavolo_nar\builder.py", line 125, in process_dependencies
    self.install_dependencies(dependencies_dir, cache_dir)
    File "C:\Users\ayush.raj\AppData\Local\hatch\env\virtual\neuralprophet\IXYHy4qS\neuralprophet-build\Lib\site-packages\hatch_datavolo_nar\builder.py", line 163, in install_dependencies
    check_call(install_arguments, stdout=PIPE, stderr=PIPE, shell=False)
    File "C:\Users\ayush.raj\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['C:\\Users\\ayush.raj\\AppData\\Local\\hatch\\env\\virtual\\neuralprophet\\IXYHy4qS\\neuralprophet-build\\Scripts\\python.EXE', '-m', 'pip', 'install', 'neuralprophet', 'numpy', 'pandas', '--upgrade', '--no-python-version-warning', '--no-input', '--cache-dir', "'C:\\Users\\ayush.raj\\Desktop\\POCs\\new\\pyproject\\trainer\\dist/pip-cache'", '--quiet', '--target', "'C:\\Users\\ayush.raj\\Desktop\\POCs\\new\\pyproject\\trainer\\dist\\NAR-INF\\bundled-dependencies'"]' returned non-zero exit status 2.


    NOTE: if i am putting dependencies as empty in .toml file then it is successfully building nar

    I am expecting nar to be geberated with all bundled dependencies of processor

    Continue reading...

Compartilhe esta Página