Skip to content

Conversation

@claude-marie
Copy link

I added a small addition directly in the pull_scripts_from_repository. Tested in openhexa, it works well.

Copy link
Collaborator

@EstebanMontandon EstebanMontandon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a library, the version number must be incremented with each change. Otherwise, when running pip install --upgrade (or updating the pipeline), pip will not detect a new release and will keep using the previously installed version instead of pulling the latest code.

To do this , you have to edit the file setup.py like:

setup(
    name="snt_lib",
    version="0.39.0", -------------------> "0.40.0"
    packages=find_packages(),  # Automatically finds snt_lib
    install_requires=[...]
    )

# Pull snt_utils.r from the snt_development repository
# The file is located at code/snt_utils.r in the snt_development repo
# and will be saved to code/snt_utils.r in the workspace
try:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repository is actually downloaded already by the function load_scripts_for_pipeline() , therefore this step is not necessary.

f"Failed to update snt_utils.r from repository: {e}. "
"Using existing version if available."
)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after:

# Create the mapping of script paths
    reporting_paths = {
        (repository_source / "reporting" / r): (pipeline_target / "reporting" / r)
        for r in report_scripts
    }
    code_paths = {
        (repository_source / "code" / c): (pipeline_target / "code" / c)
        for c in code_scripts
    }

you could include an additional path to the file you want to download and replace, something like you did:

**snt_utils_path**= {(repo_path / repo_name / "code" / "snt_utils.r"): (pipeline_target / "code" / "snt_utils.r")}

And then just include it in the parameters:

load_scripts_for_pipeline(
            snt_script_paths=reporting_paths | code_paths | snt_utils_path,
            ...
)

if this load_scripts_for_pipeline() works correctly , it should handle it correctly for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants