Install own fork of package instead of "official" version

I have a fork of a package. That package is a dependency of many other packages, some of which I use heavily. How can I install my fork so that the dependent packages use my fork instead of the “official” dependency? is it just as simple as remove the “official” pkg and install my fork instead?

If you’re developing your fork, I would ] dev Pkg. Then it’ll use your local version.
Otherwise, you could ] add path_(optionally_URL)_to_your_fork.

4 Likes

That’s what I was thinking, first ]rm the official package, then ]add my fork on GitHub. Not at home at the moment, so can’t test it. I’m afraid it may produce some conflict.

why?

(untested)

I believe if you keep the original uuid/pkg name, then the other packages of your local installation don’t care if your git remote is the original package address or your fork one…

Of course, if you are then developing your fork further and adding versions, then you may have problems…

Why not ]dev? This is exactly what that is for.

2 Likes

Probably a good idea is to add your fork to a specific environment, activated by, for example,

] activate "MyFork"

] dev MyFork # or add your fork

Then you can use your fork without creating conflicts with the installation in the main or other environments.

1 Like

To “use” a package different from its official version, but not to develop it, one can also use add SomePackage.

]dev is the right answer if you’re just doing this for yourself on your own machine, but I think it won’t be reproducible (that is, one won’t be able to use the Manifest to instantiate it), right?

I don’t know, but I’m only doing it for myself before a new release of the package with the fixed gets released. There is already a PR for that.

1 Like

In that case, ] dev souds like the right call (or ] add ThePackage#fork-name). Just remember to do ] free ThePackage once the PR is merged and tagged.