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

How to deal with readonly_files #211

Open
casparvl opened this issue Nov 28, 2024 · 2 comments · May be fixed by #220
Open

How to deal with readonly_files #211

casparvl opened this issue Nov 28, 2024 · 2 comments · May be fixed by #220

Comments

@casparvl
Copy link
Collaborator

  • We'll encourage the use of readonly_files in tests (e.g. in reviews), because most tests actually don't write to the files in their sourcedir
  • We can implement an option to quickly mark all files in the sourcesdir as readonly. E.g. test developer would set readonly_files = 'all', then the EESSI_Mixin class, in it's class body, would list all files in the sourcesdir and overwrite readonly_files with that list.
  • We'll initialize readonly_files = None in the EESSI_Mixin class body. Then, check after init if it's been set to anything else. If not, we print an error from EESSI_Mixin telling users that they have to set it explicitely (e.g. to [] if they don't want any readonly files).
@smoors
Copy link
Collaborator

smoors commented Dec 22, 2024

unfortunately, it's not possible to set readonly_files = None in the EESSI_Mixin class body, because it is a built-in attribute.
as an alternative, we can tell users to set it to [''] if they really don't want any read-only files.

@smoors smoors linked a pull request Dec 24, 2024 that will close this issue
@smoors
Copy link
Collaborator

smoors commented Dec 24, 2024

i wasn't able to implement readonly_files = 'all' or similar in the EESSI_Mixin class. It seems impossible to change the value of readonly_files there (or i may be doing it wrong).

the best i can up with is setting the following in the test class itself

sourcesdir='src'
readonly_files = os.listdir(sourcesdir)

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 a pull request may close this issue.

2 participants