Background
I have created one inheritable project, let’s call it company
, and a project that inherits from company
, let’s call it site
.
So the projects look like this:
Name | Inheritable | Inheritance Hierarchy |
---|---|---|
site | false | site > company |
company | true |
The company
project has a package called company
under Scripting > Project Library, and a script or module called module
that has some functions that are common across sites within the company.
The intention here is that every site could extend company.module
if/when needed.
The scenario
When I was refactoring company
so it would only include functions shared across sites I was already using company
on multiple sites, and each had some specific functions.
So the easiest way was to create a subpackage called company
under each site’s Script Library, like this:
Scripting
└─ Project Library
└ site
└ company
| module
└ company
| module
This way I could replace all import
statements from:
from company import module
To:
from site import module
And in site.company.module
I would import company.module
.
Motivation
I have created a Project meant to be used across multiple sites within the company, and every site should be able to extend modules from the parent project.
The issue
Creating a package within a child project with the same name as a package from a parent project was possible in version 8. But since 8.0.14 this is broken.
Versions <= 8.0.13 do allow the creation of a package called company
under Scripting > Project Library > site
, but since 8.0.14 the New Package dialog prevents this; the Create Package button is disabled, and there is a red icon next to the text box that displays Invalid name when one hovers over it.
The quick fix
The workaround would be to go to $IGNITION_DIR/data/projects/site/ignition/scripting-python/site
and create a folder called company
. And when the Designer is opened, there is a subpackage called company
under site
. Only then one would be able to create the script called module
under site.company
.
The permanent solution
Please work on Request 3974 opened since July 24, 2020.
Thanks.