1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
|
# Setup
Thank you for your interest in contributing to this project!
Follow these steps to set up your environment for development.
!!! note "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.
!!! warning "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
1. Navigate to [our repository on GitHub](https://github.com/hhursev/recipe-scrapers).
2. Click the "Fork" button in the top right corner to create your own copy of the repository.
## Clone Your Fork
```sh
git clone https://github.com/<your-username>/recipe-scrapers.git
cd recipe-scrapers
```
## Set Upstream Remote
!!! tip "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.
```sh
git remote add upstream https://github.com/hhursev/recipe-scrapers.git
```
## Create a Virtual Environment
It's recommended to use a virtual environment to manage dependencies. You can create one using `venv`
```sh
python -m venv .venv
source .venv/bin/activate # On Windows: `.venv\Scripts\activate`
```
!!! tip "Virtual Environment"
Remember to activate your virtual environment each time you work on the project:
```sh
source .venv/bin/activate # On Windows: .venv\Scripts\activate
```
## Install Dependencies
Install the required dependencies using `pip`
```sh
pip install -e ".[all]"
```
Our pyproject.toml file lists the installed dependencies and their purposes.
## Development Workflow
Create a new branch for your changes:
```sh
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:
```sh
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:
```sh
git fetch upstream
git merge upstream/main
```
Then create a Pull Request back to the [main repository](https://github.com/hhursev/recipe-scrapers)
from your fork.
If you have troubles check out [Submitting A Pull Request Section](#submitting-a-pull-request).
## Submitting a Pull Request
1. Navigate to your fork on GitHub.
2. Click the "New pull request" button.
3. Ensure the base fork is the original repository and the base branch is `main`.
4. Fill out the pull request template and submit.
## Thank you for contributing!
### What happens after a PR
When you submit your PR:
1. Our CI suite will run against your code to ensure everything works as expected. You can run the
2. tests locally before submitting:
```sh
python -m unittest
# or
unittest-parallel --level test
```
2. 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
3. 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!
|