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

Custom global macro packages #217

Open
mstmob opened this issue Dec 31, 2021 · 2 comments
Open

Custom global macro packages #217

mstmob opened this issue Dec 31, 2021 · 2 comments
Labels
enhancement New feature or request type: filter Issues directly related to the filter

Comments

@mstmob
Copy link
Contributor

mstmob commented Dec 31, 2021

It would be nice to include custom packages via --packages which are located in a global directory (i.e. ~/yalafi/macros).
This could be done by accepting packages

  • without prefix for builtin packages (already implemented)
  • with . prefix for relative project packages (already implemented)
  • with / prefix for absolute paths to global packages (missing feature)
@torik42 torik42 added enhancement New feature or request type: filter Issues directly related to the filter labels Aug 21, 2022
@torik42
Copy link
Owner

torik42 commented Feb 1, 2023

If you add a package via --packages .something, YaLafi will just try to import something. Hence, a module something needs to be present at the python path. Either in the directory, from where you call YaLafi, or in any other. Hence, you can just add any folder, e.g. ~/yalafi/macros, to the python path. If you have a separate environment for YaLafi, it will not even change anything else.

If I find time for a configuration overhaul, I might add an option --packages-path which dynamically adds the argument to the python path. I would prefer to not add any folder by default.

@mstmob
Copy link
Contributor Author

mstmob commented Feb 1, 2023

If you add a package via --packages .something, YaLafi will just try to import something. Hence, a module something needs to be present at the python path. Either in the directory, from where you call YaLafi, or in any other. Hence, you can just add any folder, e.g. ~/yalafi/macros, to the python path. If you have a separate environment for YaLafi, it will not even change anything else.

Thank you, good to know how this is handled internally! This is at least a temporary solution for my problem.

If I find time for a configuration overhaul, I might add an option --packages-path which dynamically adds the argument to the python path. I would prefer to not add any folder by default.

I agree with you: There shouldn't be a default folder for custom packages. But a --packages-path would be appreciated ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request type: filter Issues directly related to the filter
Projects
None yet
Development

No branches or pull requests

2 participants