munki / munki-pkg

Repo for the munkipkg tool and example projects
Other
343 stars 75 forks source link

pip install compatibility #66

Open tcoliver opened 10 months ago

tcoliver commented 10 months ago

First off, thank you for such a great tool. I use it almost every day at work.

I am opening this issue as a feature request to add Python pip install compatibility. As I am sure you're aware, pip is the standard Python package manager and provides a reliable and repeatable means to install python modules. Additionally, and perhaps more importantly, other tools such as pipx rely on pip to function. This is my motivation for opening a feature request.

pipx is installs python cli tools into isolated environments and makes any console scripts available on the user's path. It has become an invaluable tool for users who have a significant number of python tools installed, since many tools have incompatible dependencies. I think munkipkg would benefit from enabling support for pip (and thereby pipx) since it would provide users a simple, standard means of installation.

Fortunately, enabling basic pip compatibility can be done without making any changes to munkipkg. All that is required is adding a pyproject.toml file with relevant configuration to your projects root directory. I have taken the liberty of creating a fork with the pyproject.toml file added. The munkipkg utility can then be installed from the zip archive url with the following command.

pip install https://github.com/tcoliver/munki-pkg/archive/refs/heads/main.zip

I will also be making a pull request in case you find this implementation acceptable and wish to include it.

If users do not wish to use pip or adjacent tools to install munkipkg, the current workflow of copying the script into your path would continue to work without any change.

Side Note: I tied the package version to the VERSION variable in your script. As such, if you were to decide in the future to start publishing versioned releases of munkipkg, all you would need to do is change the value of VERSION and pip would manage updates.

gregneagle commented 9 months ago

I have no interest in maintaining this functionality as I'd never use it myself and would not want to have debug it/fix it if it broke. I'd be OK with adding the pyproject.toml file to the project, with the proviso that I won't guarantee it would be maintained, and if it broke, it would be likely my fix would be to remove it.

tcoliver commented 9 months ago

Thank you for the consideration and the candor of your response. Not wanting to maintain features you do not use makes complete sense. Feel free to discard this issue. I am happy to maintain my own fork with the file added, which is sufficient for my purposes. munkipkg has been incredibly useful to me, so thank you for sharing it and all your work.