-
-
Notifications
You must be signed in to change notification settings - Fork 417
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
Don't use the global data
directory
#901
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Filipe Laíns <[email protected]>
Signed-off-by: Filipe Laíns <[email protected]>
data
directory
Hi. I must ask, not recommended by whom? While I agree with this recommendation when it comes to data used by the package itself, this does not apply to the items in Moonraker's scripts path. They are external helpers, primarily used to help install Moonraker on a system. In my view the shared data directory is a viable location for these items. Moving the scripts path in the repo is not an option, as it would break existing workflows that install Moonraker from source.
The |
See https://setuptools.pypa.io/en/latest/userguide/datafiles.html#non-package-data-files. The shared data directory is leftover from old packaging tooling, and has a set of issues. It's difficult to support and is likely to be deprecated in sysconfig at some point in the future, and will likely be missing from newer APIs (source: I am the maintainer 😅). Installation tools should still be able to install the files, preserving backwards compatibility, but we'd recommend against its usage.
I included a symlink in the PR for this reason. |
Thanks for the information. I'll accept your recommendation, however I would prefer to copy the scripts into the distribution during the build rather than move the FWIW, if the intent is to deprecate the use of the data directory, I would recommend coordinating with PyPA. According to the Python Packaging User Guide the data folder is the correct location for scripts and such. The recommendation from setuptools seems to apply to files accessed at runtime by the package, which makes sense but does not apply here. The |
Commit 8df9890 copies selected items from the |
Putting data in the global
data
directory is not recommended, a better place for data generally is to install it as a subpackage. This PR makes that change.Additionally, it's unclear to me how the
moonraker
config in update manager isn't broken, sincerequirements
andsystem_dependencies
specify set the base path to the Python package (moonraker.utils.source_info.source_path
) but the files aren't installed there.moonraker/moonraker/components/update_manager/common.py
Lines 24 to 43 in f735c04