Skip to content

Latest commit

 

History

History
116 lines (77 loc) · 2.9 KB

CONTRIBUTING.md

File metadata and controls

116 lines (77 loc) · 2.9 KB

Contributing to readchar

👍🎉 First off, thanks for taking the time to contribute! 🎉👍

The following is a set of guidelines for contributing to this GitHub project. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.

Opening an issue

If you want to open an issue about a problem or bug you encountered, simply go to the GitHub page and click New issue in the issues section. You will be presented with templates to use, choose a relevant one. (If no template fits, you can open a blank issue. But make sure you input all the appropriate information!)

Fill out the template. You should at least provide the following information:

  • a short but exact description of your problem (screenshots often help)
  • steps on how to reproduce the problem
  • Information about your system:
    • your OS
    • your Python version and implementation
    • the version of readchar you use

Opening a pull request

Follow these steps if you want to contribute code to the project:

  1. Fork this Git repository and create your branch from master.

  2. Check out the code to your local machine by following the steps in Getting the code and make your changes.

  3. Make sure the tests pass!!

  4. If you added to the source code, add tests for your new code.

  5. Update the documentation, if necessary.

  6. Write a good commit message, if you have multiple changes, make sure your commits are atomic (single irreducible change that makes sense on its own)

  7. Done, you can open a pull request.

Getting the code

If you want to experiment with the code yourself, you can get started by following these steps.

  1. Clone the repository. (or yours if you created a fork)

    git clone https://github.com/magmax/python-readchar.git
    cd python-readchar
  2. Create a virtual environment:

    python -m venv .venv
  3. Enter the virtual environment

    on Linux systems:

    source .venv/bin/activate

    or for Windows systems:

    .venv\Scripts\activate
  4. Install dev-dependencies (this also automatically installs the library in editable mode)

    pip install -r requirements.txt

Run the tests!

Always make sure all tests pass before suggesting any changes! This will avoid invalid PR's.

The simplest way is to just run make. The provided Makefile calls all tests for you.

make

If you don't have make, you could run all tests manually like this:

  • run pytest (source-code testing)

    pytest
  • run pre-commit (linting and styling)

    pre-commit run -a
  • run setup.py (to test build process)

    python setup.py sdist bdist_wheel