Skip to content

Improve example files handling in examples scripts #182

Closed
@a-bouth

Description

@a-bouth

📝 Description of the feature

Currently we're using:

        # In case of CI/CD pipelines
        port_in_env = os.environ.get("ANSRV_DPF_SOUND_PORT")
        if port_in_env is not None:
            return "C:\\data\\" + filename
        else:
            return local_path

In the file download.py in _download_file

This is not optimal as we're using an hardcoded path (which only makes sense for the specific case of build pipelines), and an environment variable This download function should not use/depend of the environment variable (which should be used only for build pipelines).

💡 Steps for implementing the feature

  1. Modify the signature of _download_file (and functions that call it) to add an argument which is the server : _download_file(filename, directory=None, _test=False, server)`
  2. Use the function dpf.upload_file inside _download_file to upload the file to the server
  3. Return the path returned by dpf.upload_file
  4. Make sure all examples are working in setups with and without docker container

🔗 Useful links and references

dpf.upload_file

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features or code improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions