1- .. highlight :: shell
21
3- ============
4- Contributing
5- ============
2+ # Contributing
63
74Contributions are welcome, and they are greatly appreciated! Every little bit
85helps, and credit will always be given.
96
107You can contribute in many ways:
118
12- Types of Contributions
13- ----------------------
9+ ## Types of Contributions
10+
11+ ### Report Bugs
1412
15- Report Bugs
16- ~~~~~~~~~~~
1713
1814Report bugs at https://github.com/chrishavlin/yt_xarray/issues .
1915
@@ -23,27 +19,23 @@ If you are reporting a bug, please include:
2319* Any details about your local setup that might be helpful in troubleshooting.
2420* Detailed steps to reproduce the bug.
2521
26- Fix Bugs
27- ~~~~~~~~
22+ ### Fix Bugs
2823
2924Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
3025wanted" is open to whoever wants to implement it.
3126
32- Implement Features
33- ~~~~~~~~~~~~~~~~~~
27+ ### Implement Features
3428
3529Look through the GitHub issues for features. Anything tagged with "enhancement"
3630and "help wanted" is open to whoever wants to implement it.
3731
38- Write Documentation
39- ~~~~~~~~~~~~~~~~~~~
32+ ### Write Documentation
4033
4134yt_xarray could always use more documentation, whether as part of the
4235official yt_xarray docs, in docstrings, or even on the web in blog posts,
4336articles, and such.
4437
45- Submit Feedback
46- ~~~~~~~~~~~~~~~
38+ ### Submit Feedback
4739
4840The best way to send feedback is to file an issue at https://github.com/chrishavlin/yt_xarray/issues .
4941
@@ -54,75 +46,91 @@ If you are proposing a feature:
5446* Remember that this is a volunteer-driven project, and that contributions
5547 are welcome :)
5648
57- Get Started!
58- ------------
49+ ## Get Started!
5950
6051Ready to contribute? Here's how to set up ` yt_xarray ` for local development.
6152
62531 . Fork the ` yt_xarray ` repo on GitHub.
63- 2. Clone your fork locally::
64-
65- $ git clone [email protected] :your_name_here/yt_xarray.git 54+ 2 . Clone your fork locally:
55+ ```
56+ $ git clone [email protected] :your_name_here/yt_xarray.git 57+ ```
6658
67593 . Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
60+ ```
61+ $ mkvirtualenv yt_xarray
62+ $ cd yt_xarray/
63+ $ python -m pip install -e .
64+ $ python -m pip install -r requirements_dev.txt
65+ ```
66+ 4 . (optional) Setup pre-commit
67+ ```
68+ $ pre-commit install
69+ ```
6870
69- $ mkvirtualenv yt_xarray
70- $ cd yt_xarray/
71- $ python setup.py develop
71+ 5 . Create a branch for local development::
7272
73- 4. Create a branch for local development::
73+ ```
74+ $ git checkout -b name-of-your-bugfix-or-feature
75+ ```
76+ Now you can make your changes locally.
7477
75- $ git checkout -b name-of-your-bugfix-or-feature
78+ 6 . When you're done making changes, check that your changes pass the
79+ tests:
7680
77- Now you can make your changes locally.
81+ ```
82+ $ pytest
83+ ```
84+ To test multiple python versions, you can use ` tox ` :
7885
79- 5. When you're done making changes, check that your changes pass flake8 and the
80- tests, including testing other Python versions with tox::
86+ ```
87+ $ tox
88+ ```
8189
82- $ flake8 yt_xarray tests
83- $ python setup.py test or pytest
84- $ tox
8590
86- To get flake8 and tox, just pip install them into your virtualenv.
91+ 7 . Commit your changes and push your branch to GitHub:
8792
88- 6. Commit your changes and push your branch to GitHub::
93+ ```
94+ $ git add .
95+ $ git commit -m "Your detailed description of your changes."
96+ ```
97+ If you've installed pre-commit, then pre-commit will run your changes through
98+ some style checks. It will try to fix files if needed. If it finds errors, you
99+ will need to re-add those files (after fixing it if pre-commit could not do so
100+ automatically) and then commit again.
89101
90- $ git add .
91- $ git commit -m "Your detailed description of your changes."
92- $ git push origin name-of-your-bugfix-or-feature
102+ Now your branch is ready to push:
93103
94- 7. Submit a pull request through the GitHub website.
104+ ```
105+ $ git push origin name-of-your-bugfix-or-feature
106+ ```
95107
96- Pull Request Guidelines
97- -----------------------
108+ 8 . Submit a pull request through the GitHub website.
109+
110+ ## Pull Request Guidelines
98111
99112Before you submit a pull request, check that it meets these guidelines:
100113
1011141 . The pull request should include tests.
1021152 . If the pull request adds functionality, the docs should be updated. Put
103- your new functionality into a function with a docstring, and add the
104- feature to the list in README.rst.
105- 3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check
106- https://travis-ci.com/chrishavlin/yt_xarray/pull_requests
107- and make sure that the tests pass for all supported Python versions.
116+ your new functionality into a function with a docstring.
117+ 3 . The pull request should pass all automated tests.
108118
109- Tips
110- ----
119+ ## Tips
111120
112- To run a subset of tests::
121+ To run a subset of tests:
113122
114123$ pytest tests.test_yt_xarray
115124
116125
117- Deploying
118- ---------
126+ ## Deploying
119127
120128A reminder for the maintainers on how to deploy.
121- Make sure all your changes are committed (including an entry in HISTORY.rst).
122- Then run::
129+ Make sure all your changes are committed (including an entry in HISTORY.md).
123130
131+ ```
124132$ bump2version patch # possible: major / minor / patch
125133$ git push
126134$ git push --tags
127-
128- Travis will then deploy to PyPI if tests pass.
135+ ```
136+ github will then push to PyPI if tests pass.
0 commit comments