Setup
Thank you for your interest in contributing to this project!
Follow these steps to set up your environment for development.
Prerequisites
This guide assumes you have basic familiarity with Python development, including using pip
,
virtual environments
, and git
. These core concepts are beyond the scope of this documentation.
Python Version Requirement
We strongly recommend using Python 3.11 or above for all development work related to recipe-scrapers
.
This version includes built-in tomllib
support, which is essential for the project's configuration handling.
We welcome various types of code contributions to recipe-scrapers
, including:
- Bug fixes
- New recipe site scrapers
- Performance improvements
- Feature enhancements
- Test coverage improvements
Fork the Repository
- Navigate to our repository on GitHub.
- Click the "Fork" button in the top right corner to create your own copy of the repository.
Clone Your Fork
Set Upstream Remote
Upstream Remote
Setting the upstream remote allows you to sync changes from the original repository to your fork. This is useful to keep your fork up-to-date with the latest changes.
Create a Virtual Environment
It's recommended to use a virtual environment to manage dependencies. You can create one using venv
Virtual Environment
Remember to activate your virtual environment each time you work on the project:
Install Dependencies
Install the required dependencies using pip
Our pyproject.toml file lists the installed dependencies and their purposes.
Development Workflow
Create a new branch for your changes:
git checkout -b fix/your-fix-name # for bug fixes
# or
git checkout -b site/website-name # for new site scrapers
# or
git checkout -b docs/your-addition # for docs updates
# or
git checkout -b feature/feature-name # for new features
After making your changes, commit them:
git add -p # Review changes before adding them
git commit -m "meaningful commit message"
git push origin your-branch-name
Pre-commit Hooks
The project uses pre-commit hooks to ensure code quality and consistency. These hooks run automatically when you commit changes, handling tasks like:
- Code formatting (black, isort)
- Linting (flake8)
- Type checking
- Other code quality checks
Syncing Your Fork
To keep your fork up-to-date with the original repository, you can fetch and merge changes from the upstream remote:
Then create a Pull Request back to the main repository from your fork.
If you have troubles check out Submitting A Pull Request Section.
Submitting a Pull Request
- Navigate to your fork on GitHub.
- Click the "New pull request" button.
- Ensure the base fork is the original repository and the base branch is
main
. - Fill out the pull request template and submit.
Thank you for contributing!
What happens after a PR
When you submit your PR:
- Our CI suite will run against your code to ensure everything works as expected. You can run the
-
tests locally before submitting:
-
Community members and core contributors will review your code. They may:
- Request changes or improvements
- Suggest alternative approaches
- Provide feedback on test coverage
- Ask for documentation updates
-
Once approved, a core contributor will merge your PR
- Your contribution will be included in the next release
- Tackle any follow-up improvements in subsequent PRs
Don't worry if your first PR needs some adjustments - this is normal and part of the collaborative development process!