|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Contributions are welcome, and they are greatly appreciated! Every |
| 4 | +little bit helps, and credit will always be given. |
| 5 | + |
| 6 | +You can contribute in many ways: |
| 7 | + |
| 8 | +## Types of Contributions |
| 9 | + |
| 10 | +### Report Bugs |
| 11 | + |
| 12 | +Report bugs at |
| 13 | +<https://github.com/nmdp-bioinformatics/my_project_template/issues>. |
| 14 | + |
| 15 | +If you are reporting a bug, please include: |
| 16 | + |
| 17 | +- Your operating system name and version. |
| 18 | +- Any details about your local setup that might be helpful in |
| 19 | + troubleshooting. |
| 20 | +- Detailed steps to reproduce the bug. |
| 21 | + |
| 22 | +### Fix Bugs |
| 23 | + |
| 24 | +Look through the GitHub issues for bugs. Anything tagged with "bug" |
| 25 | +and "help wanted" is open to whoever wants to implement it. |
| 26 | + |
| 27 | +### Implement Features |
| 28 | + |
| 29 | +Look through the GitHub issues for features. Anything tagged with |
| 30 | +"enhancement" and "help wanted" is open to whoever wants to |
| 31 | +implement it. |
| 32 | + |
| 33 | +### Write Documentation |
| 34 | + |
| 35 | +My Project Template could always use more documentation, whether as part |
| 36 | +of the official My Project Template docs, in docstrings, or even on the |
| 37 | +web in blog posts, articles, and such. |
| 38 | + |
| 39 | +### Submit Feedback |
| 40 | + |
| 41 | +The best way to send feedback is to file an issue at |
| 42 | +<https://github.com/nmdp-bioinformatics/my_project_template/issues>. |
| 43 | + |
| 44 | +If you are proposing a feature: |
| 45 | + |
| 46 | +- Explain in detail how it would work. |
| 47 | +- Keep the scope as narrow as possible, to make it easier to implement. |
| 48 | +- Remember that this is a volunteer-driven project, and that |
| 49 | + contributions are welcome :) |
| 50 | + |
| 51 | +## Get Started! |
| 52 | + |
| 53 | +Ready to contribute? Here's how to set up for local development. |
| 54 | + |
| 55 | +1. Fork the repo on GitHub. |
| 56 | + |
| 57 | +2. Clone your fork locally: |
| 58 | + |
| 59 | + ``` shell |
| 60 | + $ git clone [email protected]:your_name_here/my_project_template.git |
| 61 | + ``` |
| 62 | + |
| 63 | +3. Install your local copy into a virtual environment. This is how you |
| 64 | + set up your fork for local development: |
| 65 | + |
| 66 | + ``` shell |
| 67 | + $ cd my_project_template/ |
| 68 | + $ make venv |
| 69 | + $ source .venv/bin/activate |
| 70 | + $ make install |
| 71 | + $ make sync |
| 72 | + ``` |
| 73 | + |
| 74 | +4. Create a branch for local development: |
| 75 | + |
| 76 | + ``` shell |
| 77 | + $ git checkout -b name-of-your-bugfix-or-feature |
| 78 | + ``` |
| 79 | + |
| 80 | + Now you can make your changes locally. |
| 81 | + |
| 82 | + 5. When done making changes, check that your changes pass |
| 83 | + flake8 and the tests, including testing other Python versions with |
| 84 | + tox: |
| 85 | + |
| 86 | + ``` shell |
| 87 | + $ pre-commit |
| 88 | + $ make test |
| 89 | + ``` |
| 90 | + |
| 91 | +6. Commit your changes and push your branch to GitHub: |
| 92 | + |
| 93 | + ``` shell |
| 94 | + $ git add . |
| 95 | + $ git commit -m "Your detailed description of your changes." |
| 96 | + $ git push origin name-of-your-bugfix-or-feature |
| 97 | + ``` |
| 98 | + |
| 99 | +7. Submit a pull request through the GitHub website. |
| 100 | + |
| 101 | +## Pull Request Guidelines |
| 102 | + |
| 103 | +Before you submit a pull request, check that it meets these guidelines: |
| 104 | + |
| 105 | +1. The pull request should include tests. |
| 106 | +2. If the pull request adds functionality, the docs should be updated. |
| 107 | + Put your new functionality into a function with a docstring, and add |
| 108 | + the feature to the list in README.rst. |
| 109 | +3. The pull request should work for Python 3.6 and higher. |
| 110 | + |
| 111 | +## Tips |
| 112 | + |
| 113 | +To run a subset of tests: |
| 114 | + |
| 115 | +``` shell |
| 116 | +$ pytest tests.test_my_project_template |
| 117 | +``` |
| 118 | + |
| 119 | +## Release a new version |
| 120 | + |
| 121 | +Make sure all your changes are committed. Then run: |
| 122 | + |
| 123 | +``` shell |
| 124 | +$ bump-my-version bump patch -vv # possible: major / minor / patch |
| 125 | +$ git push |
| 126 | +``` |
| 127 | +Maintainer can publish a release, which will submit to PyPi. |
0 commit comments