Temporarily disable Project.toml "sources" so I can `dev` the local dependency version instead

I have a personal package MyPackage that depends on another personal package MyPackageDependency. I am using the sources section of the MyPackage Project.toml file to point to the MyPackageDependency GitHub repository.

However, if I want to test some changes to MyPackageDependency with MyPackage before committing and pushing them, then I need to rm MyPackageDependency from the MyPackage environment, dev it back in via a local path, and then change its “sources” line from a URL to a path in the Project.toml file.

Then when I’m happy with the MyPackageDependency changes, I need to remember to revert all the MyPackage environment and .toml changes before I commit and push MyPackage again.

Is there a better process or flag I can use to streamline this process of testing local dependency package changes’ effect on a package without altering the code of the package itself?

You could add MyPackageDependency as a git submodule and always use it as a local dependency. This allows you to easily switch between different commits of MyPackageDependency, e.g. between the commit synced with GitHub and a local development commit. The exact commit used is tracked in the parent MyPackage repository, which ensures reproducibility: when you know some code in the parent repo works, git also knows exactly which commit of the submodule is used together to make the code work.

If I’m reading the question correctly, you can just make a separate environment which develops both of the packages by path, and do the testing with that environment active.