Welcome! We're excited that you're interested in contributing to this project. Below are guidelines to help you get started.
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. Please note we have a code of conduct, please follow it in all your interactions with the project.
- Getting Started
- Testing Locally
- Running Tests
- Code Coverage
- Continuous Integration
- Submitting Changes
- Fork the repository.
- Clone your fork:
git clone https://github.com/your-username/yourIP.git
To test the application locally:
- Install dependencies using Poetry:
poetry install --with dev
- Activate the virtual environment:
poetry shell
- Run the Flask app:
poetry run flask --app app/main.py --debug run --host 127.0.0.1 --port 8080
- Visit http://127.0.0.1:8080 in your browser.
To run the application in development mode with debugging:
To build the Docker image and tag it as yourip:
- Ensure you are in the root directory of the repository where the Dockerfile is located.
- Build the Docker image:
docker build -t yourip:latest .
This command builds the Docker image using the Dockerfile in the current directory and tags it as yourip:latest.
docker compose -f docker-compose.yml -f docker-compose.debug.yml up -d
This command uses both docker-compose.yml and docker-compose.debug.yml to start the container in detached mode with development settings.
We use pytest for testing. To run tests:
- Ensure you're in the virtual environment:
poetry shell
- Run the tests:
pytest
We use coverage.py to measure code coverage. To generate a coverage report:
- Run the tests with coverage:
coverage run -m pytest
- Generate a coverage report:
coverage report
- Generate an HTML coverage report:
coverage html
- Open htmlcov/index.html in your browser to view the detailed coverage report.
We've set up GitHub Actions for Continuous Integration (CI) to automatically run tests and generate coverage reports on every commit. The configuration is located in .github/workflows/python-app.yml
.
- Push your changes to your fork.
- Create a pull request to the main repository.
- The CI will automatically run and display results on the pull request page.
- Ensure all tests pass.
- Ensure code coverage is adequate.
- Create a pull request with a clear description of your changes.
- Search our repository for open or closed Pull Requests that relate to your submission. You don't want to duplicate effort.
- Fork the project
- Create your feature branch (
git checkout -b feat/amazing_feature
) - Commit your changes (
git commit -m 'feat: add amazing_feature'
) yourIP uses conventional commits, so please follow the specification in your commit messages. - Push to the branch (
git push origin feat/amazing_feature
) - Open a Pull Request
Thank you for contributing! Your help is much appreciated. If you have any questions, feel free to open an issue.