|
| 1 | +============ |
| 2 | +Contributing |
| 3 | +============ |
| 4 | + |
| 5 | +Contributions are welcome, and they are greatly appreciated! Every little bit |
| 6 | +helps, and credit will always be given. |
| 7 | + |
| 8 | +You can contribute in many ways: |
| 9 | + |
| 10 | +Report Bugs |
| 11 | +=========== |
| 12 | + |
| 13 | +Report bugs at https://github.com/matthiaskoenig/sbmlsim/issues. |
| 14 | + |
| 15 | +If you are reporting a bug, please follow the template guide lines. The more |
| 16 | +detailed your report, the easier and thus faster we can help you. |
| 17 | + |
| 18 | +Fix Bugs |
| 19 | +======== |
| 20 | + |
| 21 | +Look through the GitHub issues for bugs. Anything tagged with "bug" and "help |
| 22 | +wanted" is open to whoever wants to implement it. |
| 23 | + |
| 24 | +Implement Features |
| 25 | +================== |
| 26 | + |
| 27 | +Look through the GitHub issues for features. Anything tagged with "enhancement" |
| 28 | +and "help wanted" is open to whoever wants to implement it. |
| 29 | + |
| 30 | +Write Documentation |
| 31 | +=================== |
| 32 | + |
| 33 | +sbmlsim could always use more documentation, whether as part of the official |
| 34 | +documentation, in docstrings, or even on the web in blog posts, articles, and |
| 35 | +such. |
| 36 | + |
| 37 | +Submit Feedback |
| 38 | +=============== |
| 39 | + |
| 40 | +The best way to send feedback is to file an issue at |
| 41 | +https://github.com/matthiaskoenig/sbmlsim/issues. |
| 42 | + |
| 43 | +If you are proposing a feature: |
| 44 | + |
| 45 | +* Explain in detail how it would work. |
| 46 | +* Keep the scope as narrow as possible, to make it easier to implement. |
| 47 | +* Remember that this is a volunteer-driven project, and that contributions are |
| 48 | + welcome :) |
| 49 | + |
| 50 | +Get Started! |
| 51 | +============ |
| 52 | + |
| 53 | +Ready to contribute? Here's how to set up sbmlsim for local development. |
| 54 | + |
| 55 | +1. Fork the https://github.com/matthiaskoenig/sbmlsim repository on GitHub. If you |
| 56 | + have never done this before, `follow the official guide |
| 57 | + <https://guides.github.com/activities/forking/>`_ |
| 58 | +2. Clone your fork locally as described in the same guide. |
| 59 | +3. Install your local copy into a a Python virtual environment. You can `read |
| 60 | + this guide to learn more |
| 61 | + <https://realpython.com/python-virtual-environments-a-primer/>`_ about them |
| 62 | + and how to create one. Alternatively, particularly if you are a Windows or |
| 63 | + Mac user, you can also use `Anaconda <https://docs.anaconda.com/anaconda/>`_. |
| 64 | + Assuming you have virtualenvwrapper installed, this is how you set up your |
| 65 | + fork for local development |
| 66 | + |
| 67 | + .. code-block:: console |
| 68 | +
|
| 69 | + mkvirtualenv sbmlsim |
| 70 | + cd sbmlsim/ |
| 71 | + pip install -e ".[development]" |
| 72 | +
|
| 73 | +4. Create a branch for local development using the ``develop`` branch as a |
| 74 | + starting point. Use ``fix``, ``refactor``, or ``feat`` as a prefix |
| 75 | + |
| 76 | + .. code-block:: console |
| 77 | +
|
| 78 | + git checkout devel |
| 79 | + git checkout -b fix-name-of-your-bugfix |
| 80 | +
|
| 81 | + Now you can make your changes locally. |
| 82 | + |
| 83 | +5. When making changes locally, it is helpful to ``git commit`` your work |
| 84 | + regularly. On one hand to save your work and on the other hand, the smaller |
| 85 | + the steps, the easier it is to review your work later. Please use `semantic |
| 86 | + commit messages |
| 87 | + <http://karma-runner.github.io/2.0/dev/git-commit-msg.html>`_. |
| 88 | + |
| 89 | + .. code-block:: console |
| 90 | +
|
| 91 | + git add . |
| 92 | + git commit -m "fix: Your summary of changes" |
| 93 | +
|
| 94 | +6. When you're done making changes, check that your changes pass our test suite (with |
| 95 | + exception of flake8). |
| 96 | + This is all included with tox |
| 97 | + |
| 98 | + .. code-block:: console |
| 99 | +
|
| 100 | + tox |
| 101 | +
|
| 102 | + You can run all tests in parallel using detox. To get detox, just pip install |
| 103 | + it into your virtualenv. |
| 104 | + |
| 105 | + To fix the isort and black tests use |
| 106 | + |
| 107 | + .. code-block:: console |
| 108 | +
|
| 109 | + isort src/sbmlsim |
| 110 | + black src/sbmlsim --exclude resources |
| 111 | +
|
| 112 | +7. Push your branch to GitHub. |
| 113 | + |
| 114 | + .. code-block:: console |
| 115 | +
|
| 116 | + git push origin fix-name-of-your-bugfix |
| 117 | +
|
| 118 | +8. Open the link displayed in the message when pushing your new branch in order |
| 119 | + to submit a pull request. Please follow the template presented to you in the |
| 120 | + web interface to complete your pull request. |
| 121 | + |
| 122 | +For larger features that you want to work on collaboratively with other sbmlsim |
| 123 | +team members, you may consider to first request to join the sbmlsim developers |
| 124 | +team to get write access to the repository so that you can create a branch in |
| 125 | +the main repository (or simply ask the maintainer to create a branch for you). |
| 126 | +Once you have a new branch you can push your changes directly to the main |
| 127 | +repository and when finished, submit a pull request from that branch to |
| 128 | +``develop``. |
| 129 | + |
| 130 | +Pull Request Guidelines |
| 131 | +----------------------- |
| 132 | + |
| 133 | +Before you submit a pull request, check that it meets these guidelines: |
| 134 | + |
| 135 | +1. The pull request should include tests in the ``sbmlsim/test`` |
| 136 | + directory. Except in rare circumstances, code coverage must |
| 137 | + not decrease (as reported by codecov which runs automatically when |
| 138 | + you submit your pull request) |
| 139 | +2. If the pull request adds functionality, the docs should be |
| 140 | + updated. Put your new functionality into a function with a |
| 141 | + docstring. |
| 142 | +3. The pull request will be tested for several different Python versions. |
| 143 | +4. Someone from the @matthiaskoenig/sbmlsim-core team will review your work and guide |
| 144 | + you to a successful contribution. |
| 145 | + |
| 146 | +Unit tests and benchmarks |
| 147 | +------------------------- |
| 148 | + |
| 149 | +sbmlsim uses `pytest <http://docs.pytest.org/en/latest/>`_ for its |
| 150 | +unit-tests and new features should in general always come with new |
| 151 | +tests that make sure that the code runs as intended. |
| 152 | + |
| 153 | +To run all tests do:: |
| 154 | + |
| 155 | + (sbmlsim)$ pytest |
| 156 | + |
| 157 | +Branching model |
| 158 | +--------------- |
| 159 | + |
| 160 | +``develop`` |
| 161 | + Is the branch all pull-requests should be based on. |
| 162 | +``master`` |
| 163 | + Is only touched by maintainers and is the branch with only tested, reviewed |
| 164 | + code that is released or ready for the next release. |
| 165 | +``{fix, bugfix, doc, feature}/descriptive-name`` |
| 166 | + Is the recommended naming scheme for smaller improvements, bugfixes, |
| 167 | + documentation improvement and new features respectively. |
| 168 | + |
| 169 | +Please use concise descriptive commit messages and consider using |
| 170 | +``git pull --rebase`` when you update your own fork to avoid merge commits. |
| 171 | + |
| 172 | +Thank you very much for contributing to sbmlsim! |
0 commit comments