Skip to content
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

Update pip commands to install 1.10 #6930

Merged
merged 5 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't have pdm in V1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make install failed without pdm being installed so I added it. Do you still want me to remove it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. Sorry!


```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]
```