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

Renaming global directory #2604

Open
reicda opened this issue Sep 10, 2024 · 5 comments · May be fixed by #2769
Open

Renaming global directory #2604

reicda opened this issue Sep 10, 2024 · 5 comments · May be fixed by #2769
Assignees
Labels
clean up needs info python Pull requests that update Python code
Milestone

Comments

@reicda
Copy link

reicda commented Sep 10, 2024

At the moment we use global as the name for the directory containing the meta repository and data intended for further use in other modules.

'global' is one of the reserved keywords in python and thus must not be used in this case as it will lead to a syntax error. There are work-arounds but they will lead to errors by the linting tools we use (e.g. mypy) that need to be suppressed.

example:
>>> import global.example_module

work-around:
>>> sys.path.append("global")
>>> import example_module

work-around (suppressed linting):
>>> sys.path.append("global")
>>> import example_module # type: ignore # noqa

To tackle the problem at the root I suggest we rename the directory to something similar (e.g. universal, general, unbounded, planetary, comprehensive) and adjust all references.

@reicda reicda added clean up needs discussion python Pull requests that update Python code labels Sep 10, 2024
@reicda reicda added this to the 4.2 milestone Sep 10, 2024
@rrenkert rrenkert added the low label Oct 22, 2024
@Elblinator
Copy link
Member

Is it possible for the backend to moce the folders (plus files in these folders) one level up and delete the "global" folder alltogether?

@hjanott
Copy link
Member

hjanott commented Dec 16, 2024

Is it possible for the backend to moce the folders (plus files in these folders) one level up and delete the "global" folder alltogether?

Yes it's possible. But it will also require some changes to the main repository as well as to the client and auth-service.

@peb-adr
Copy link
Member

peb-adr commented Dec 16, 2024

We will also need to check where the manage service might depend on the global/data path.

And possibly more services..

@peb-adr
Copy link
Member

peb-adr commented Dec 16, 2024

Is it possible for the backend to moce the folders (plus files in these folders) one level up and delete the "global" folder alltogether?

This proposal I like.
It would also make the meta path more unified. Comparing to autoupdate and search service, which also include meta at the root of their file tree, the backend is one exception using global/meta.
The client ofc still falls out of this, but there moving the directory has other implications and is not as easy.

@peb-adr
Copy link
Member

peb-adr commented Dec 16, 2024

We will also need to check where the manage service might depend on the global/data path.

And possibly more services..

Checked the manage service.
It does not directly depend on the paths. It just calls organization.initial_import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean up needs info python Pull requests that update Python code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants