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] Support custom location of pypgx-bundle files #100
Comments
Thank you so much for this feature request and also for providing sample code! I really appreciate your contribution. I have been meaning to add an option to manually specify the file path to BTW, I'm curious to hear more about your motivation for changing the path for |
I agree an optional CLI argument would be quite explicit. It could be a top-level CLI option that applies to all subcommands. The main advantage I see of using the environment variable solution, is that you don't need to pass the value of the CLI argument around to all functions that need the location of You could, perhaps, combine both solutions and set the environment variable with the value of the CLI argument, this way a user can either define the environment variable or be explicit and pass the path to Regarding your question about the motivation. Mainly, I'm thinking about flexibility in different environments. Some situations that come to mind:
I'd say there are workarounds, like setting the |
Thank you so much for providing such a detailed explanation! It's exactly what I was hoping to hear. I hadn't really considered situations where a user doesn't have access to the home directory, but it's an important observation for sure. As for CLI option vs. environment variable, I am still leaning towards the former because 1) many PyPGx users are not necessarily proficient in programming and I think CLI option is more explicit and user-friendly, 2) I counted and there are only four PyPGx actions that will be affected if I introduced the CLI option ( I will publish the official release of |
Thank you for considering this feature! Let me know if you want any help reviewing/testing. |
* :issue:`100`: Add new method :meth:`sdk.utils.get_bundle_path` to enable customization of the ``pypgx-bundle`` directory's location instead of the user's home directory.
After careful consideration, I came to the conclusion that your approach is better because it's way simpler to implement and also because if a user is looking to customize the path to Therefore, as promised, I had released the official version of
You can also see the updated Read the Docs as well. Thank you so much! |
Hello @sbslee , I'll check and get back to you today. Thanks for your help. |
Hello @sbslee, A friendly coworker (@erichards52) with actual field knowledge helped me out with the testing:
I think that covers the expected behaviour. |
Thank you so much, @lexotero and @erichards52! I really appreciate it. Please don't hesitate to let me know if you have any other feature ideas or questions! |
Currently,
pypgx
defaults in multiple places to files present inpypgx-bundle
. To locate said filespypgx
assumes thatpypgx-bundle
has been cloned in the user's home directory. This is done with code similar to:from
pypgx/pypgx/api/utils.py
Line 822 in decb65a
It would be useful to support different locations for the
pypgx-bundle
clone so that users can organise their filesystems in any way they like.Although, in the future, the use of files from the
pypgx-bundle
could be handle differently, for now, an easy way of adding some flexibility would be to extract the fetching of files from the bundle to a utility function. This utility function then could have some logic to determine the path to thepypgx-bundle
clone using user-defined environment variables, and defaulting to the user's home directory. Something like:The
resolve_pypgx_bundle_path()
function could also add some validation to ensure, for example, that the returned path exists.Do you think this would be a useful addition to the library?
The text was updated successfully, but these errors were encountered: