Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: test-specific source directory #190

Open
hagertnl opened this issue Dec 13, 2024 · 2 comments · May be fixed by #191
Open

Feature Request: test-specific source directory #190

hagertnl opened this issue Dec 13, 2024 · 2 comments · May be fixed by #191
Assignees
Labels
enhancement New feature or request

Comments

@hagertnl
Copy link
Contributor

It would be useful to have a test be able to supply additional files to be copied to the build_directory at the beginning of the build. For example, an alternative Makefile or a specific source file that is only needed for a specific test. For example:

app_1
|- Source
    |- Makefile
    |- hello_cpu.c
|- hello_gpu
    |- Source
        |- Makefile # a GPU-enabled Makefile
        |- hello_gpu.c
   |- Scripts
...
@hagertnl hagertnl added the enhancement New feature or request label Dec 13, 2024
@hagertnl hagertnl self-assigned this Dec 19, 2024
@hagertnl
Copy link
Contributor Author

So I want to do something like:

shutil.copytree(src='Source',
                dst='build',
                symlinks=True)

shutil.copytree(src='test/Source',
                dst='build',
                symlinks=True, dirs_exist_ok=True)

But unfortunately, the dirs_exist_ok keyword was not until Python 3.8, and Frontier's default Python is 3.6. Given we have numerous machines that don't yet have Python 3.8 as default, this doesn't feel like a viable solution. Prior to Python 3.8, shutil.copytree does not support overwriting a directory that already exists. The dst directory must not exist.

@hagertnl
Copy link
Contributor Author

After talking with Asa, I think the best solution is to have an if conditional -- if Python version > 3.8 is found, then use this dirs_exist_ok keyword. Otherwise, spawn a subprocess and use the Unix cp.

@hagertnl hagertnl linked a pull request Dec 19, 2024 that will close this issue
@hagertnl hagertnl linked a pull request Dec 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant