-
Notifications
You must be signed in to change notification settings - Fork 309
docs: improve onboarding #1775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
docs: improve onboarding #1775
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,35 +69,53 @@ except ValidationError as e: | |
|
||
## Getting Started | ||
|
||
You'll need rust stable [installed](https://rustup.rs/), or rust nightly if you want to generate accurate coverage. | ||
### Prerequisites | ||
|
||
With rust and python 3.9+ installed, compiling pydantic-core should be possible with roughly the following: | ||
You'll need: | ||
1. **[Rust](https://rustup.rs/)** - Rust stable (or nightly for coverage) | ||
2. **[Python 3.9+](https://www.python.org/downloads/)** - Python 3.9 or later | ||
|
||
3. **[uv](https://docs.astral.sh/uv/getting-started/installation/)** - Fast Python package manager | ||
4. **[git](https://git-scm.com/)** - For version control | ||
5. **[make](https://www.gnu.org/software/make/)** - For running development commands (or use `nmake` on Windows) | ||
|
||
### Quick Start | ||
|
||
```bash | ||
# clone this repo or your fork | ||
# Clone the repository (or from your fork) | ||
git clone [email protected]:pydantic/pydantic-core.git | ||
cd pydantic-core | ||
# create a new virtual env | ||
python3 -m venv env | ||
source env/bin/activate | ||
# install dependencies and install pydantic-core | ||
|
||
# Install all dependencies using uv, setup pre-commit hooks, and build the development version | ||
make install | ||
``` | ||
|
||
That should be it, the example shown above should now run. | ||
Verify your installation by running: | ||
|
||
```bash | ||
make | ||
``` | ||
|
||
This runs a full development cycle: formatting, building, linting, and testing | ||
|
||
### Development Commands | ||
|
||
Run `make help` to see all available commands, or use these common ones: | ||
|
||
```bash | ||
make build-dev # to build the package during development | ||
make build-prod # to perform an optimised build for benchmarking | ||
make test # to run the tests | ||
make testcov # to run the tests and generate a coverage report | ||
make lint # to run the linter | ||
make format # to format python and rust code | ||
make all # to run to run build-dev + format + lint + test | ||
``` | ||
|
||
You might find it useful to look at [`python/pydantic_core/_pydantic_core.pyi`](./python/pydantic_core/_pydantic_core.pyi) and | ||
[`python/pydantic_core/core_schema.py`](./python/pydantic_core/core_schema.py) for more information on the python API, | ||
beyond that, [`tests/`](./tests) provide a large number of examples of usage. | ||
### Useful Resources | ||
|
||
If you want to contribute to pydantic-core, you'll want to use some other make commands: | ||
* `make build-dev` to build the package during development | ||
* `make build-prod` to perform an optimised build for benchmarking | ||
* `make test` to run the tests | ||
* `make testcov` to run the tests and generate a coverage report | ||
* `make lint` to run the linter | ||
* `make format` to format python and rust code | ||
* `make` to run `format build-dev lint test` | ||
* [`python/pydantic_core/_pydantic_core.pyi`](./python/pydantic_core/_pydantic_core.pyi) - Python API types | ||
* [`python/pydantic_core/core_schema.py`](./python/pydantic_core/core_schema.py) - Core schema definitions | ||
* [`tests/`](./tests) - Comprehensive usage examples | ||
|
||
## Profiling | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this get wiped by future
uv sync
commands? Should we useuv tool install pre-commit
instead? That will affect global state, though, so we might have to go back to just recommending it? 🤔