CONTRIBUTING.rst 3.93 KB
Newer Older
spmohanty's avatar
spmohanty committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.. highlight:: shell

============
Contributing
============

Contributions are welcome, and they are greatly appreciated! Every little bit
helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions
----------------------

Report Bugs
~~~~~~~~~~~

spmohanty's avatar
spmohanty committed
18
Report bugs at https://gitlab.aicrowd.com/flatland/flatland/issues.
spmohanty's avatar
spmohanty committed
19
20
21
22
23
24
25
26
27
28

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.

Fix Bugs
~~~~~~~~

spmohanty's avatar
spmohanty committed
29
Look through the Repository Issue Tracker for bugs. Anything tagged with "bug" and "help
spmohanty's avatar
spmohanty committed
30
31
32
33
34
wanted" is open to whoever wants to implement it.

Implement Features
~~~~~~~~~~~~~~~~~~

spmohanty's avatar
spmohanty committed
35
Look through the Repository Issue Tracker for features. Anything tagged with "enhancement"
spmohanty's avatar
spmohanty committed
36
37
38
39
40
41
42
and "help wanted" is open to whoever wants to implement it.

Write Documentation
~~~~~~~~~~~~~~~~~~~

flatland could always use more documentation, whether as part of the
official flatland docs, in docstrings, or even on the web in blog posts,
spmohanty's avatar
spmohanty committed
43
articles, and such. A quick reference for writing good docstrings is available at : https://docs.python-guide.org/writing/documentation/#writing-docstrings
spmohanty's avatar
spmohanty committed
44
45
46
47

Submit Feedback
~~~~~~~~~~~~~~~

spmohanty's avatar
spmohanty committed
48
The best way to send feedback is to file an issue at https://gitlab.aicrowd.com/flatland/flatland/issues.
spmohanty's avatar
spmohanty committed
49
50
51
52
53
54
55
56
57
58
59
60
61

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
  are welcome :)

Get Started!
------------

Ready to contribute? Here's how to set up `flatland` for local development.

spmohanty's avatar
spmohanty committed
62
1. Fork the `flatland` repo on https://gitlab.aicrowd.com/flatland/flatland .
spmohanty's avatar
spmohanty committed
63
64
2. Clone your fork locally::

spmohanty's avatar
spmohanty committed
65
    $ git clone git@gitlab.aicrowd.com:flatland/flatland.git
spmohanty's avatar
spmohanty committed
66

67
3. Install the software dependencies via Anaconda-3 or Miniconda-3. (This assumes you have Anaconda installed by following the instructions `here <https://www.anaconda.com/distribution>`_)
68

69
70
71
    $ conda install -c conda-forge tox-conda
    $ conda install tox
    $ tox -v --recreate
72

73
74
    This will create a virtual env you can then use.

75
76
77
78
    These steps are performed if you run

    $ getting_started/getting_started.bat/.sh

79
    from Anaconda prompt.
80

81

spmohanty's avatar
spmohanty committed
82
83
84
85
86
87
88
89
90
4. Create a branch for local development::

    $ git checkout -b name-of-your-bugfix-or-feature

   Now you can make your changes locally.

5. When you're done making changes, check that your changes pass flake8 and the
   tests, including testing other Python versions with tox::

u214892's avatar
u214892 committed
91
    $ flake8 flatland tests examples benchmarks
spmohanty's avatar
spmohanty committed
92
93
94
95
96
    $ python setup.py test or py.test
    $ tox

   To get flake8 and tox, just pip install them into your virtualenv.

spmohanty's avatar
spmohanty committed
97
6. Commit your changes and push your branch to Gitlab::
spmohanty's avatar
spmohanty committed
98
99

    $ git add .
spmohanty's avatar
spmohanty committed
100
    $ git commit -m "Addresses #<issue-number> Your detailed description of your changes."
spmohanty's avatar
spmohanty committed
101
102
    $ git push origin name-of-your-bugfix-or-feature

spmohanty's avatar
spmohanty committed
103
7. Submit a merge request through the Gitlab repository website.
spmohanty's avatar
spmohanty committed
104

spmohanty's avatar
spmohanty committed
105
Merge Request Guidelines
spmohanty's avatar
spmohanty committed
106
-------------------------
spmohanty's avatar
spmohanty committed
107

spmohanty's avatar
spmohanty committed
108
Before you submit a merge request, check that it meets these guidelines:
spmohanty's avatar
spmohanty committed
109

spmohanty's avatar
spmohanty committed
110
111
1. The merge request should include tests.
2. If the merge request adds functionality, the docs should be updated. Put
spmohanty's avatar
spmohanty committed
112
113
   your new functionality into a function with a docstring, and add the
   feature to the list in README.rst.
spmohanty's avatar
spmohanty committed
114
115
3. The merge request should work for Python 3.6, 3.7 and for PyPy. Check
   https://gitlab.aicrowd.com/flatland/flatland/pipelines
spmohanty's avatar
spmohanty committed
116
117
118
119
120
121
122
123
124
125
126
127
128
129
   and make sure that the tests pass for all supported Python versions.

Tips
----

To run a subset of tests::

$ py.test tests.test_flatland


Deploying
---------

A reminder for the maintainers on how to deploy.
130
Make sure all your changes are committed .
spmohanty's avatar
spmohanty committed
131
132
133
134
135
136
Then run::

$ bumpversion patch # possible: major / minor / patch
$ git push
$ git push --tags

137
TODO: Travis will then deploy to PyPI if tests pass. (To be configured properly by Mohanty)