Hi everyone,
I’m developing a VIKTOR app and want to use a private Python package hosted on GitHub (Rod-Pattern-Automation
). Here’s my situation and what I’ve tried so far:
What I want to do:
- Use my private package
Rod-Pattern-Automation
inside the VIKTOR app. - Access the class
RodPattern
from this package to populate an OptionField dynamically.
My provisional solution (local import):
I tried temporarily adding the package folder path manually:
import sys
import os
sys.path.append(os.path.abspath(r"Path_to_folder"))
from rod_pattern_class import RodPattern
from WriterDrawing import DXFwriter
And my VIKTOR parametrization code looks like:
class Parametrization(vkt.Parametrization):
product = vkt.OptionField("Choose product", options=[], visible=True)
class Controller(vkt.Controller):
parametrization = Parametrization
def get_parametrization(self, params, **kwargs):
RP = RodPattern()
options = RP.PRODUCT_CHOICE # Must be a list of strings
p = Parametrization()
p.product.options = options
return p
However, the options never show up in the UI.
Next, I tried to install the private package as a dependency
I followed the documentation to add the private repo to requirements.txt
using this line:
Rod-Pattern-Automation@git+https://${julesangebault-ff:${*MyPassword*}@https://github.com/julesangebault-ff/Rod-Pattern-Automation
But the installation keeps failing with access error
fatal: unable to access 'https://https//github.com/julesangebault-ff/Rod-Pattern-Automation/'
Questions:
- How can I correctly import and use a private GitHub package inside a VIKTOR app?
- What is the correct format to add a private GitHub repo to
requirements.txt
for VIKTOR apps, especially regarding tokens or passwords? - Is there a recommended way to dynamically update OptionField options based on an imported package?
Thanks in advance for any guidance or examples!