Skip to content

Commit

Permalink
Update pip commands to install 1.10 (#6930)
Browse files Browse the repository at this point in the history
Co-authored-by: Johannes Rueschel <johannes.rueschel@telekom.de>
  • Loading branch information
chbndrhnns and Johannes Rueschel committed Jul 28, 2023
1 parent d9c2af3 commit 87bf417
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions changes/6930-chbndrhnns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Docs: Fix pip commands to install v1
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ To make contributing as easy and fast as possible, you'll want to run tests and
*pydantic* has few dependencies, doesn't require compiling and tests don't need access to databases, etc.
Because of this, setting up and running the tests should be very simple.

You'll need to have a version between **Python 3.7 and 3.11**, **virtualenv**, **git**, and **make** installed.
You'll need to have a version between **Python 3.7 and 3.11**, **virtualenv**, **git**, **pdm** and **make** installed.

```bash
# 1. clone your fork and cd into the repo directory
Expand Down
18 changes: 9 additions & 9 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Installation is as simple as:

```bash
pip install pydantic
pip install 'pydantic<2'
```

*pydantic* has no required dependencies except Python 3.7, 3.8, 3.9, 3.10 or 3.11 and
Expand All @@ -12,7 +12,7 @@ Pydantic is also available on [conda](https://www.anaconda.com) under the [conda
channel:

```bash
conda install pydantic -c conda-forge
conda install 'pydantic<2' -c conda-forge
```

## Compiled with Cython
Expand All @@ -36,7 +36,7 @@ print('compiled:', pydantic.compiled)
Compiled binaries can increase the size of your Python environment. If for some reason you want to reduce the size of your *pydantic* installation you can avoid installing any binaries using the [`pip --no-binary`](https://pip.pypa.io/en/stable/cli/pip_install/#install-no-binary) option. Make sure `Cython` is not in your environment, or that you have the `SKIP_CYTHON` environment variable set to avoid re-compiling *pydantic* libraries:

```bash
SKIP_CYTHON=1 pip install --no-binary pydantic pydantic
SKIP_CYTHON=1 pip install --no-binary pydantic pydantic<2
```
!!! note
`pydantic` is repeated here intentionally, `--no-binary pydantic` tells `pip` you want no binaries for pydantic,
Expand All @@ -47,7 +47,7 @@ Alternatively, you can re-compile *pydantic* with custom [build options](https:/
CFLAGS="-Os -g0 -s" pip install \
--no-binary pydantic \
--global-option=build_ext \
pydantic
pydantic<2
```

## Optional dependencies
Expand All @@ -60,11 +60,11 @@ CFLAGS="-Os -g0 -s" pip install \

To install these along with *pydantic*:
```bash
pip install pydantic[email]
pip install 'pydantic[email]<2'
# or
pip install pydantic[dotenv]
pip install 'pydantic[dotenv]<2'
# or just
pip install pydantic[email,dotenv]
pip install 'pydantic[email,dotenv]<2'
```

Of course, you can also install these requirements manually with `pip install email-validator` and/or `pip install python-dotenv`.
Expand All @@ -74,7 +74,7 @@ Of course, you can also install these requirements manually with `pip install em

And if you prefer to install *pydantic* directly from the repository:
```bash
pip install git+git://github.com/pydantic/pydantic@main#egg=pydantic
pip install git+https://github.com/pydantic/pydantic@1.10.X-fixes#egg=pydantic
# or with extras
pip install git+git://github.com/pydantic/pydantic@main#egg=pydantic[email,dotenv]
pip install git+https;://github.com/pydantic/pydantic@1.10.X-fixes#egg=pydantic[email,dotenv]
```

0 comments on commit 87bf417

Please sign in to comment.