2016-01-02 18:07:00 +01:00
|
|
|
######################
|
2014-04-24 18:20:23 +02:00
|
|
|
Contributing to HTTPie
|
|
|
|
######################
|
|
|
|
|
2016-01-02 18:07:00 +01:00
|
|
|
Bug reports and code and documentation patches are welcome. You can
|
|
|
|
help this project also by using the development version of HTTPie
|
|
|
|
and by reporting any bugs you might encounter.
|
2014-04-24 18:20:23 +02:00
|
|
|
|
2016-01-02 18:07:00 +01:00
|
|
|
1. Reporting bugs
|
|
|
|
=================
|
2014-04-24 18:20:23 +02:00
|
|
|
|
2014-05-09 13:48:34 +02:00
|
|
|
**It's important that you provide the full command argument list
|
|
|
|
as well as the output of the failing command.**
|
2014-05-09 13:46:33 +02:00
|
|
|
Use the ``--debug`` flag and copy&paste both the command and its output
|
|
|
|
to your bug report, e.g.:
|
2014-04-24 18:20:23 +02:00
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
2016-01-02 18:07:00 +01:00
|
|
|
$ http --debug [COMPLETE ARGUMENT LIST THAT TRIGGERS THE ERROR]
|
|
|
|
[COMPLETE OUTPUT]
|
2014-04-24 18:20:23 +02:00
|
|
|
|
|
|
|
|
2016-01-02 18:07:00 +01:00
|
|
|
2. Contributing Code and Docs
|
|
|
|
=============================
|
2014-04-24 18:20:23 +02:00
|
|
|
|
|
|
|
Before working on a new feature or a bug, please browse `existing issues`_
|
|
|
|
to see whether it has been previously discussed. If the change in question
|
2018-10-31 19:17:44 +01:00
|
|
|
is a bigger one, it's always good to discuss before you start working on
|
2014-04-24 18:20:23 +02:00
|
|
|
it.
|
|
|
|
|
|
|
|
|
2016-01-02 18:07:00 +01:00
|
|
|
Creating Development Environment
|
|
|
|
--------------------------------
|
|
|
|
|
2017-03-10 11:27:38 +01:00
|
|
|
Go to https://github.com/jakubroztocil/httpie and fork the project repository.
|
2016-01-02 18:07:00 +01:00
|
|
|
|
2014-04-24 18:20:23 +02:00
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
git clone https://github.com/<YOU>/httpie
|
|
|
|
|
|
|
|
cd httpie
|
|
|
|
|
|
|
|
git checkout -b my_topical_branch
|
|
|
|
|
|
|
|
# (Recommended: create a new virtualenv)
|
|
|
|
|
2014-04-28 13:25:45 +02:00
|
|
|
# Install dev. requirements and also HTTPie (in editable mode
|
|
|
|
# so that the `http' command will point to your working copy):
|
2017-12-07 05:39:32 +01:00
|
|
|
make init
|
2014-04-24 18:20:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
Making Changes
|
|
|
|
--------------
|
|
|
|
|
2018-07-12 21:16:16 +02:00
|
|
|
Please make sure your changes conform to `Style Guide for Python Code`_ (PEP8)
|
|
|
|
and that ``make pycodestyle`` passes.
|
2014-04-24 18:20:23 +02:00
|
|
|
|
|
|
|
|
2016-01-02 18:07:00 +01:00
|
|
|
Testing
|
|
|
|
-------
|
2014-04-24 18:20:23 +02:00
|
|
|
|
|
|
|
Before opening a pull requests, please make sure the `test suite`_ passes
|
2016-01-02 18:07:00 +01:00
|
|
|
in all of the `supported Python environments`_. You should also add tests
|
|
|
|
for any new features and bug fixes.
|
2014-04-24 18:20:23 +02:00
|
|
|
|
2016-01-02 18:07:00 +01:00
|
|
|
HTTPie uses `pytest`_ and `Tox`_ for testing.
|
2014-04-24 18:20:23 +02:00
|
|
|
|
|
|
|
|
2016-01-02 18:07:00 +01:00
|
|
|
Running all tests:
|
|
|
|
******************
|
|
|
|
|
|
|
|
.. code-block:: bash
|
2014-04-24 21:36:03 +02:00
|
|
|
|
2017-12-07 05:39:32 +01:00
|
|
|
# Run all tests on the current Python interpreter with coverage
|
2014-04-28 13:25:45 +02:00
|
|
|
make test
|
|
|
|
|
2016-01-02 18:07:00 +01:00
|
|
|
# Run all tests in all of the supported and available Pythons via Tox
|
2014-04-28 13:25:45 +02:00
|
|
|
make test-tox
|
2014-04-24 18:20:23 +02:00
|
|
|
|
2016-01-02 18:28:46 +01:00
|
|
|
# Run all tests for code as well as packaging, etc.
|
|
|
|
make test-all
|
|
|
|
|
2018-07-12 21:16:16 +02:00
|
|
|
# Test PEP8 compliance
|
|
|
|
make pycodestyle
|
|
|
|
|
2014-04-24 21:36:03 +02:00
|
|
|
|
2016-01-02 18:07:00 +01:00
|
|
|
Running specific tests:
|
|
|
|
***********************
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
# Run specific tests on the current Python
|
|
|
|
py.test tests/test_uploads.py
|
|
|
|
py.test tests/test_uploads.py::TestMultipartFormDataFileUpload
|
|
|
|
py.test tests/test_uploads.py::TestMultipartFormDataFileUpload::test_upload_ok
|
2014-04-24 18:20:23 +02:00
|
|
|
|
2016-01-02 18:07:00 +01:00
|
|
|
# Run specific tests on the on all Pythons via Tox
|
2018-07-12 21:16:16 +02:00
|
|
|
# (change to `tox -e py37' to limit Python version)
|
2014-04-24 21:36:03 +02:00
|
|
|
tox -- tests/test_uploads.py --verbose
|
2016-01-02 18:07:00 +01:00
|
|
|
tox -- tests/test_uploads.py::TestMultipartFormDataFileUpload --verbose
|
|
|
|
tox -- tests/test_uploads.py::TestMultipartFormDataFileUpload::test_upload_ok --verbose
|
|
|
|
|
|
|
|
-----
|
2014-04-24 18:20:23 +02:00
|
|
|
|
2016-01-02 18:28:46 +01:00
|
|
|
See `Makefile`_ for additional development utilities.
|
2016-01-02 18:07:00 +01:00
|
|
|
Don't forget to add yourself to `AUTHORS`_!
|
2014-04-24 18:20:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
.. _Tox: http://tox.testrun.org
|
2017-03-10 11:27:38 +01:00
|
|
|
.. _supported Python environments: https://github.com/jakubroztocil/httpie/blob/master/tox.ini
|
|
|
|
.. _existing issues: https://github.com/jakubroztocil/httpie/issues?state=open
|
|
|
|
.. _AUTHORS: https://github.com/jakubroztocil/httpie/blob/master/AUTHORS.rst
|
|
|
|
.. _Makefile: https://github.com/jakubroztocil/httpie/blob/master/Makefile
|
2014-04-24 18:20:23 +02:00
|
|
|
.. _pytest: http://pytest.org/
|
|
|
|
.. _Style Guide for Python Code: http://python.org/dev/peps/pep-0008/
|
2017-03-10 11:27:38 +01:00
|
|
|
.. _test suite: https://github.com/jakubroztocil/httpie/tree/master/tests
|