Contributing#

PyKP is an open-source initiative. Contributions are welcome and appreciated.

How to Contribute#

Contributions to the project can be made using the “Fork & Pull” model. The typical steps are:

  1. Create an account on GitHub.

  2. Fork PyKP.

  3. Make a local clone: git clone GITHUB_USERNAME/pykp.git.

  4. Make changes on the local copy.

  5. Test (see below) and commit changes git commit -a -m "my message".

  6. Push to your GitHub account: git push origin.

  7. Create a Pull Request (PR) from your GitHub fork (go to your fork’s webpage and click on “Pull Request.” You can then add a message to describe your proposal).

Otherwise, if you encounter any bugs or have an idea for a new feature but don’t have the time to implement it, please open an issue on the GitHub Issues.

Development Environment#

  1. Fork the Repository: Start by forking the PyKP repository on GitHub.

  2. Clone the Repository: Clone your forked repository to your local machine.

    git clone https://github.com/yourusername/pykp.git
    cd pykp
    
  3. Create a Virtual Environment: Set up a virtual environment to manage dependencies.

    python3 -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
    
  4. Install Dependencies: Install the package dependencies in “editable” mode, including development dependencies.

    pip install --editable .
    
  5. Run Tests: Run the test suite to ensure the setup is working correctly.

    python -m unittest discover -s tests
    

Writing Tests#

If you make a contribution to the code, please write a test for it. To add a test:

  1. Create a new test file: Place new test files in the tests/ directory, using the naming convention test_<feature>.py.

  2. Use `unittest`: PyKP uses the unittest framework. Use one of the existing tests as a guide.

  3. Run Tests: Run the tests using the command below to ensure everything works as expected.

    python -m unittest discover -s tests