aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
436 stars 191 forks source link

Use only one global var for marking config folder tree #6610

Open unkcpz opened 1 week ago

unkcpz commented 1 week ago

The problem is found when I worked on #6609. If the import of DAEMON_DIR moved to outside the function, the global var set in module scope and in test contest will not be reset when function is loading.

The goal for a better design is to reduce the use of global variable. Now it is only the glb_aiida_config_folder (the original AIIDA_CONFIG_FOLDER). Other three are derived from this one. This lower the possibility of directly access the global variable without noticing its change.

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 89.90826% with 11 lines in your changes missing coverage. Please review.

Project coverage is 77.91%. Comparing base (ef60b66) to head (0d87b9b). Report is 135 commits behind head on main.

Files with missing lines Patch % Lines
src/aiida/manage/configuration/profile.py 83.88% 5 Missing :warning:
src/aiida/cmdline/commands/cmd_profile.py 0.00% 2 Missing :warning:
src/aiida/engine/daemon/client.py 77.78% 2 Missing :warning:
src/aiida/manage/tests/pytest_fixtures.py 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6610 +/- ## ========================================== + Coverage 77.51% 77.91% +0.41% ========================================== Files 560 567 +7 Lines 41444 42177 +733 ========================================== + Hits 32120 32857 +737 + Misses 9324 9320 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

unkcpz commented 5 days ago

Hi @sphuber, it would be great if you can have a look at the changes. This touch the part that might break users' environment.