Development
You can install mongorun in development mode, which does not move it into the
Python site-packages directory but keeps it in your local development
directory instead. It still installs the necessary hooks so you can use it like
normal, both from Python and the command line. In addition, you can modify the
files directly in your local directory and test the changes right away.
Using a development branch
Remove any existing mongorun installation:
sudo pip3 uninstall mongorun
Fork the mongorun repository to your own GitHub account.
Clone your mongorun fork to your development environment. This step creates an mongorun directory in the current directory, so you may want to switch to an appropriate directory first (for example
~/code/):cd ~/code git clone https://github.com/<username>/mongorun.git
Change into the mongorun directory and check out the desired branch. All development should be based off the
developbranch:cd mongorun git checkout develop
Install the mongorun scripts in development mode using either:
pip3(recommended as a convenience for installing additional dependencies):sudo pip3 install -e '/path/to/cloned/repo[all]'
setup.pysudo python3 setup.py develop
Test the installation by confirming that the scripts tab-complete from any directory:
mru<tab>
This should auto-complete to
mrun. Also confirm the current version, which should end in-dev0for thedevelopbranch:mrun --version
Using the stable branch
To use the latest stable release of mongorun, check out the main branch:
git checkout main
Confirm your current version with the
--versionparameter:mrun --version
Making pull requests
mongorun uses a simplified version of the git branching model by @nvie.
Important
The main branch should only ever contain versioned releases. Do not send pull requests against the main branch.
Development happens on the develop branch.
Fork the main repository into your own GitHub account.
Clone a copy to your local machine:
git clone https://github.com/<username>/mongorun
Add the upstream repository to pull in the latest changes:
cd mongorun git remote add upstream https://github.com/mongodb/mongorun git fetch upstream
Check out and track your remote
developbranch with a local branch:git checkout -b develop origin/develop
If you want to work on a bug or feature implementation, pull in the latest changes from upstream:
git checkout develop git pull upstream develop
Create a feature or bug fix branch that forks off the local
developbranch. The branch should named after the GitHub issue number you are working on. If there isn’t a GitHub issue yet, please create one.git checkout -b issue-12345 develop
Make your changes to the code. Commit as often as you like. Please use meaningful, descriptive commit messages and avoid
asdforchanged stuffdescriptions.Add or update tests to confirm your changes are working as expected. See Testing for more information.
When you’re happy with your changes, push your feature branch to GitHub:
git push origin issue-12345
Raise a pull request against the upstream
developbranch using the GitHub interface.After the code is merged into the
developbranch, you can pull the change from the upstreamdevelopbranch and delete your local feature or bug fix branch:git checkout develop git pull upstream develop git push origin --delete issue-12345 git branch -d issue-12345