A git powered package manager built on top of submodules.
Project description
gitpkg
A git powered package manager built on top of submodules.
Install
The recommended way to install git-pkg is via pipx:
$ pipx install gitpkg
Usage
The first thing you need to do to make your project work with git pkg is add a destination. A destination is a place where your packages will be installed into, you can have multiple of these.
Install a destination by using:
$ git pkg dest add addons
The directory does not have to exist, it will be automatically generated.
Next we need to install packages lets do so by:
$ git pkg add https://github.com/coppolaemilio/dialogic
But wait! While we now have an addons/dialogic directory, the thing we actually wanted there is now at addons/dialogic/addons/dialogic
Many projects, in this case Godot projects have the thing that is important to us in a subdirectory, to have this subdirectory in the desired location we have to define it as the package root by:
# You can just re-run this it will reconfigurate the package
$ git pkg add https://github.com/coppolaemilio/dialogic --package-root addons/dialogic
# OR: short hand
$ git pkg add https://github.com/coppolaemilio/dialogic -r addons/dialogic
Nice! But what do I do if the repository name and the directory I want is different?
Lets look at the next example:
$ git pkg add https://github.com/viniciusgerevini/godot-aseprite-wizard.git -r addons/AsepriteWizard
While this again will add addons/godot-aseprite-wizard we want the directory name to be AsepriteWizard we can do this by:
$ git pkg add https://github.com/viniciusgerevini/godot-aseprite-wizard.git -r addons/AsepriteWizard --name AsepriteWizard
# OR:
$ git pkg add https://github.com/viniciusgerevini/godot-aseprite-wizard.git --package-root-with-name addons/AsepriteWizard
# OR: actual shorthand
$ git pkg add https://github.com/viniciusgerevini/godot-aseprite-wizard.git -rn addons/AsepriteWizard
Oh no! Now we have addons/godot-aseprite-wizard and addons/AsepriteWizard... why? Names are essential for identifying projects so this can not be updated, we just have to remove the unwanted package now:
$ git pkg remove godot-aseprite-wizard
Nice! Now we can finally get back to work!
A few days later...
It looks like the packages received some updates! To update all installed packages simply run:
$ git pkg update
# You can also update singular packages by providing their names
$ git pkg update dialogic AsepriteWizard
Since this is powered by git submodules, you have to commit the update.
Motivation
Managing other git repositories as dependencies is essentially a very good idea but git submodules are a pain to work with so there came the idea of having a simpler approach that feels more like using something like npm, composer etc.
I mostly wrote this to use this in Godot projects to manage the addons I install but quickly realized this can be used for a lot of programming languages where package managers are not an option.
This is essentially just an opinionated wrapper around git and git submodules.
License
GNU General Public License v3
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gitpkg-0.3.1.tar.gz
.
File metadata
- Download URL: gitpkg-0.3.1.tar.gz
- Upload date:
- Size: 26.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74fa54cf76d37da451706d2fd50c5cd24eb7fa8237ed069defdb1b085a0f4f46 |
|
MD5 | 30110bdf08d0bc005d55287bc3b26d85 |
|
BLAKE2b-256 | 4597ce23274c263d97180ae7aac5cc22b7bfd38d388b2364a19fd33d0467b7b1 |
File details
Details for the file gitpkg-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: gitpkg-0.3.1-py3-none-any.whl
- Upload date:
- Size: 30.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f7394c1646a76a0912026e3cfd3afa2444dcd5a78ec9ffdfebb65ca63dcb7f0 |
|
MD5 | 2a9b865fbf1d2f419ce060bca72f5495 |
|
BLAKE2b-256 | 44cdd3a126ba8c3fad5a85761c99e117d8e1022d578b8014aa7fd736a07a9508 |