|
1 | 1 | ============ |
2 | | -Contributing |
| 2 | +Contribution |
3 | 3 | ============ |
4 | 4 |
|
5 | | -Contributions are welcome, and they are greatly appreciated! Every |
6 | | -little bit helps, and credit will always be given. |
| 5 | +Contributions are highly welcomed and appreciated. |
7 | 6 |
|
8 | | -You can contribute in many ways: |
| 7 | +.. contents:: |
| 8 | + :depth: 2 |
| 9 | + :backlinks: none |
9 | 10 |
|
10 | | -Types of Contributions |
11 | | ----------------------- |
| 11 | +Feature requests |
| 12 | +---------------- |
12 | 13 |
|
13 | | -Report Bugs |
14 | | -~~~~~~~~~~~ |
| 14 | +We'd also like to hear about your thoughts and suggestions. Feel free to |
| 15 | +`submit them as issues <hhttps://github.com/reportportal/agent-python-pytest/issues>`_ and: |
15 | 16 |
|
16 | | -Report bugs at https://github.com/reportportal/agent-python-pytest/issues. |
| 17 | +* Explain in detail how they should work. |
| 18 | +* Keep the scope as narrow as possible. It will make it easier to implement. |
17 | 19 |
|
18 | | -If you are reporting a bug, please include: |
| 20 | +Bug reports |
| 21 | +----------- |
| 22 | + |
| 23 | +Report bugs for the agent in the `issue tracker <https://github.com/reportportal/agent-python-pytest/issues>`_. |
| 24 | + |
| 25 | +If you are reporting a new bug, please include: |
19 | 26 |
|
20 | 27 | * Your operating system name and version. |
21 | | -* Any details about your local setup that might be helpful in troubleshooting. |
| 28 | +* Python interpreter version, installed libraries, reportportal-client, and agent-python-pytest |
| 29 | + version. |
22 | 30 | * Detailed steps to reproduce the bug. |
23 | 31 |
|
24 | | -Fix Bugs |
25 | | -~~~~~~~~ |
| 32 | +Bug fixes |
| 33 | +--------- |
| 34 | + |
| 35 | +Look through the `GitHub issues for bugs <https://github.com/reportportal/agent-python-pytest/labels/bug>`_. |
| 36 | + |
| 37 | +If you are gonna fix any of existing bugs, assign that bug to yourself and specify preliminary milestones. |
| 38 | +Talk to `contributors <https://github.com/reportportal/agent-python-pytest/graphs/contributors>`_ in case you need a |
| 39 | +consultancy regarding implementation. |
| 40 | + |
| 41 | +Implement features |
| 42 | +------------------ |
| 43 | + |
| 44 | +Look through the `GitHub issues for enhancements <https://github.com/reportportal/agent-python-pytest/labels/enhancement>`_. |
| 45 | + |
| 46 | +Talk to `contributors <https://github.com/reportportal/agent-python-pytest/graphs/contributors>`_ in case you need a |
| 47 | +consultancy regarding implementation. |
| 48 | + |
| 49 | +Preparing Pull Requests |
| 50 | +----------------------- |
| 51 | + |
| 52 | +What is a "pull request"? It informs the project's core developers about the |
| 53 | +changes you want to review and merge. Pull requests are stored on |
| 54 | +`GitHub servers <https://github.com/reportportal/agent-python-pytest/pulls>`_. |
| 55 | +Once you send a pull request, we can discuss its potential modifications and |
| 56 | +even add more commits to it later on. There's an excellent tutorial on how Pull |
| 57 | +Requests work in the |
| 58 | +`GitHub Help Center <https://help.github.com/articles/using-pull-requests/>`_. |
| 59 | + |
| 60 | +Here is a simple overview below: |
| 61 | + |
| 62 | +#. Fork the |
| 63 | + `agent-python-pytest GitHub repository <https://github.com/reportportal/agent-python-pytest>`_. |
| 64 | + |
| 65 | +#. Clone your fork locally using `git <https://git-scm.com/>`_ and create a branch:: |
| 66 | + |
| 67 | + $ git clone [email protected]:YOUR_GITHUB_USERNAME/agent-python-pytest.git |
| 68 | + $ cd agent-python-pytest |
| 69 | + # now, create your own branch off the "master": |
| 70 | + |
| 71 | + $ git checkout -b your-bugfix-branch-name |
| 72 | + |
| 73 | + If you need some help with Git, follow this quick start |
| 74 | + guide: https://git.wiki.kernel.org/index.php/QuickStart |
| 75 | + |
| 76 | +#. Install `pre-commit <https://pre-commit.com>`_ and its hook on the agent-python-pytest repo: |
| 77 | + |
| 78 | + **Note: pre-commit must be installed as admin, as it will not function otherwise**:: |
| 79 | + |
| 80 | + |
| 81 | + $ pip install --user pre-commit |
| 82 | + $ pre-commit install |
| 83 | + |
| 84 | + Afterwards ``pre-commit`` will run whenever you commit. |
| 85 | + |
| 86 | + https://pre-commit.com/ is a framework for managing and maintaining multi-language pre-commit hooks |
| 87 | + to ensure code-style and code formatting is consistent. |
| 88 | + |
| 89 | +#. Install tox |
26 | 90 |
|
27 | | -Look through the GitHub issues for bugs. Anything tagged with "bug" |
28 | | -and "help wanted" is open to whoever wants to implement it. |
| 91 | + Tox is used to run all the tests and will automatically setup virtualenvs |
| 92 | + to run the tests in. |
| 93 | + (will implicitly use http://www.virtualenv.org/en/latest/):: |
29 | 94 |
|
30 | | -Implement Features |
31 | | -~~~~~~~~~~~~~~~~~~ |
| 95 | + $ pip install tox |
32 | 96 |
|
33 | | -Look through the GitHub issues for features. Anything tagged with "enhancement" |
34 | | -and "help wanted" is open to whoever wants to implement it. |
| 97 | +#. Run all the tests |
35 | 98 |
|
36 | | -Write Documentation |
37 | | -~~~~~~~~~~~~~~~~~~~ |
| 99 | + You need to have Python 3.6 available in your system. Now |
| 100 | + running tests is as simple as issuing this command:: |
38 | 101 |
|
39 | | -agent-python-pytest could always use more documentation, whether as part of the |
40 | | -official agent-python-pytest docs, in docstrings, or even on the web in blog posts, |
41 | | -articles, and such. |
| 102 | + $ tox -e pep,py36 |
42 | 103 |
|
43 | | -Submit Feedback |
44 | | -~~~~~~~~~~~~~~~ |
| 104 | + This command will run tests via the "tox" tool against Python 3.6 |
| 105 | + and also perform code style checks. |
45 | 106 |
|
46 | | -The best way to send feedback is to file an issue at https://github.com/reportportal/agent-python-pytest/issues. |
| 107 | +#. You can now edit your local working copy and run the tests again as necessary. Please follow PEP-8 recommendations. |
47 | 108 |
|
48 | | -If you are proposing a feature: |
| 109 | + You can pass different options to ``tox``. For example, to run tests on Python 3.6 and pass options to pytest |
| 110 | + (e.g. enter pdb on failure) to pytest you can do:: |
49 | 111 |
|
50 | | -* Explain in detail how it would work. |
51 | | -* Keep the scope as narrow as possible, to make it easier to implement. |
52 | | -* Remember that this is a volunteer-driven project, and that contributions |
53 | | - are welcome :) |
| 112 | + $ tox -e py36 -- --pdb |
54 | 113 |
|
55 | | -Get Started! |
56 | | ------------- |
| 114 | + Or to only run tests in a particular test module on Python 3.6:: |
57 | 115 |
|
58 | | -Ready to contribute? Here's how to set up `agent-python-pytest` for local development. |
| 116 | + $ tox -e py36 -- tests/test_service.py |
59 | 117 |
|
60 | | -1. Fork the `agent-python-pytest` repo on GitHub. |
61 | | -2. Clone your fork locally:: |
62 | 118 |
|
63 | | - $ git clone [email protected]:your_name_here/agent-python-pytest |
| 119 | + When committing, ``pre-commit`` will re-format the files if necessary. |
64 | 120 |
|
65 | | -3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:: |
| 121 | +#. If instead of using ``tox`` you prefer to run the tests directly, then we suggest to create a virtual environment and use |
| 122 | + an editable install with the ``testing`` extra:: |
66 | 123 |
|
67 | | - $ mkvirtualenv agent_python_pytest |
68 | | - $ cd agent_python_pytest/ |
69 | | - $ python setup.py develop |
| 124 | + $ python3 -m venv .venv |
| 125 | + $ source .venv/bin/activate # Linux |
| 126 | + $ .venv/Scripts/activate.bat # Windows |
| 127 | + $ pip install -e ".[testing]" |
70 | 128 |
|
71 | | -4. Create a branch for local development:: |
| 129 | + Afterwards, you can edit the files and run pytest normally:: |
72 | 130 |
|
73 | | - $ git checkout -b name-of-your-bugfix-or-feature |
| 131 | + $ pytest tests/test_service.py |
74 | 132 |
|
75 | | - Now you can make your changes locally. |
76 | 133 |
|
77 | | -5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:: |
| 134 | +#. Commit and push once your tests pass and you are happy with your change(s):: |
78 | 135 |
|
79 | | - $ flake8 agent_python_pytest tests |
80 | | - $ tox |
| 136 | + $ git commit -m "<commit message>" |
| 137 | + $ git push -u |
81 | 138 |
|
82 | | - To get flake8 and tox, just pip install them into your virtualenv. |
83 | 139 |
|
84 | | -6. Commit your changes and push your branch to GitHub:: |
| 140 | +#. Finally, submit a pull request through the GitHub website using this data:: |
85 | 141 |
|
86 | | - $ git add . |
87 | | - $ git commit -m "Your detailed description of your changes." |
88 | | - $ git push origin name-of-your-bugfix-or-feature |
| 142 | + head-fork: YOUR_GITHUB_USERNAME/agent-python-pytest |
| 143 | + compare: your-branch-name |
89 | 144 |
|
90 | | -7. Submit a pull request through the GitHub website. |
| 145 | + base-fork: reportportal/agent-python-pytest |
| 146 | + base: master |
0 commit comments