1
1
Contributing to semver
2
2
======================
3
3
4
- When you make changes to the code please run the tests before pushing your
5
- code to your fork and opening a `pull request `_:
4
+ Do you want to contribute? Great! We would like to give you some
5
+ helpful tips and tricks.
6
+ When you make changes to the code, we would greatly appreciate if you
7
+ consider the following requirements:
6
8
7
- .. code-block :: bash
9
+ * Make sure your code adheres to the `Semantic Versioning `_ specification.
10
+
11
+ * Check if your feature is covered by the Semantic Versioning specification.
12
+ If not, ask on its GitHub project https://github.com/semver/semver.
13
+
14
+ * Write test cases if you implement a new feature.
8
15
9
- python setup.py test
16
+ * Test also for side effects of your new feature and run the complete
17
+ test suite.
18
+ * Document the new feature.
10
19
11
20
We use `pytest `_ and `tox `_ to run tests against all supported Python
12
21
versions. All test dependencies are resolved automatically, apart from
@@ -16,13 +25,60 @@ virtualenv, which for the moment you still may have to install manually:
16
25
17
26
pip install " virtualenv<14.0.0" # <14.0.0 needed for Python 3.2 only
18
27
19
- You can use the `` clean `` command to remove build and test files and folders :
28
+ We recommend to use the following workflow if you would like to contribute :
20
29
21
- .. code-block :: bash
30
+ 1. Fork our project on GitHub using this link:
31
+ https://github.com/k-bx/python-semver/fork
32
+
33
+ 2. Clone your forked Git repository (replace ``GITHUB_USER `` with your
34
+ account name on GitHub)::
35
+
36
+ $ git clone git@github.com:GITHUB_USER/python-semver.git
37
+
38
+ 3. Create a new branch. You can name your branch whatever you like, but we
39
+ recommend to use some meaningful name. If your fix is based on a
40
+ existing GitHub issue, add also the number. Good examples would be:
41
+
42
+ * ``feature/123-improve-foo `` when implementing a new feature
43
+ * ``bugfix/123-fix-security-bar `` when dealing with bugfixes
44
+
45
+ Use this :command: `git ` command::
46
+
47
+ $ git checkout -b feature/NAME_OF_YOUR_FEATURE
48
+
49
+ 4. Work on your branch. Commit your work. Don't forget to write test cases
50
+ for your new feature.
51
+
52
+ 5. Run the test suite. You have the following options:
53
+
54
+ * To run a complete test use the ``setup.py `` script (shown for Python 3)::
55
+
56
+ $ python3 setup.py test
57
+
58
+ This may create some errors as you probably do not have all Python
59
+ versions installed on your system. To restrict it to only installed
60
+ version (probably 2.7 and 3.x), pass this options::
61
+
62
+ $ python3 setup.py test -a --skip-missing-interpreters
63
+
64
+ * To run a test for a specific Python version, use the
65
+ :command: `tox ` command, for example, for Python 3.6::
66
+
67
+ $ tox -e py36
68
+
69
+ 6. Create a `pull request `_. Describe in the pull request what you did
70
+ and why. If you have open questions, ask.
71
+
72
+ 7. Wait for feedback. If you receive any comments, address these.
73
+
74
+ 8. After your pull request got accepted, delete your branch.
75
+
76
+ 9. Use the ``clean `` command to remove build and test files and folders::
22
77
23
- python setup.py clean
78
+ $ python setup.py clean
24
79
25
80
26
81
.. _pull request : https://github.com/k-bx/python-semver/pulls
27
82
.. _pytest : http://pytest.org/
28
- .. _tox : http://tox.testrun.org/
83
+ .. _tox : https://tox.readthedocs.org/
84
+ .. _Semantic Versioning : https://semver.org
0 commit comments