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

Branch v1.9.x #4075

Closed
wants to merge 22 commits into from
Closed

Branch v1.9.x #4075

wants to merge 22 commits into from

Conversation

samuelcolvin
Copy link
Member

cherry-picking changes required for v1.9.1.

PrettyWood and others added 22 commits May 14, 2022 16:11
* use python 3.10 to run fastapi tests

* fix fastapi test call
With CentOS 7 Python 3.6, running install from source with pip failed:

    sudo podman run -ti --rm centos:7
    yum -y update
    yum -y install epel-release
    yum -y install git python3 python3-devel python3-pip python3-setuptools python3-wheel
    git clone https://github.com/samuelcolvin/pydantic.git
    cd pydantic
    pip3 install .

With following error message:

    [root@c99d0585636c pydantic]# pip3 install .
    Processing /pydantic
        Complete output from command python setup.py egg_info:
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-91v_ixvz-build/setup.py", line 62, in <module>
            history = (THIS_DIR / 'HISTORY.md').read_text()
          File "/usr/lib64/python3.6/pathlib.py", line 1197, in read_text
            return f.read()
          File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
            return codecs.ascii_decode(input, self.errors)[0]
        UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 14648: ordinal not in range(128)

        ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-91v_ixvz-build/

This PR add the required `read_text(encoding='utf-8')` for `setup.py`.

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
* add robusta.dev to pydantic users

* update robusta.dev description and fix typo
* adding a test

* fix and add change description
Pytest (sometimes?) crashes when it is invoked with `-vv` and pydantic and hypthesis are installed.

This is because `_registered(typ)` modifies `_DEFINED_TYPES` while it is being iterated:

```
INTERNALERROR>   File ".../lib/python3.9/site-packages/pydantic/_hypothesis_plugin.py", line 361, in <module>
INTERNALERROR>     for typ in pydantic.types._DEFINED_TYPES:
INTERNALERROR>   File ".../lib/python3.9/_weakrefset.py", line 65, in __iter__
INTERNALERROR>     for itemref in self.data:
INTERNALERROR> RuntimeError: Set changed size during iteration
```
)

* Remove incorrect comment about lazy evaluation of setting sources

It looks like the current implementation always evaluates every source (https://github.com/samuelcolvin/pydantic/blob/9d631a3429a66f30742c1a52c94ac18ec6ba848d/pydantic/env_settings.py#L73) before coalescing them into a single dictionary to pass to `BaseModel`. So the comment about lazy evaluation is incorrect and should be removed.

* Add changelog
* removing benchmarks completely

* [no ci] add change
…llow one (#3642)

* fix: `Config.copy_on_model_validation` does a deep copy and not a shallow one

closes #3641

* fix: typo

* use python 3.10 to run fastapi tests

* fix fastapi test call

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
* test pyright with pydantic

* rename file to avoid pytest running it

* try another name 😴

* add docs about BaseSettings and Field

* add change
…from_field` (#3819)

* add test for nested python dataclass schema generation

* fix handling of dataclasses in `get_flat_models_from_field`

* add change note
* Fix issue with self-referencing dataclass

* Fix mypy issue
* guard against ClassVar in fields, fix #3679

* fix linting

* skipif for test_class_var_forward_ref
* Fix info with in-place modification of field info

* add changes

* add test for 3714

* Update changes/4067-adriangb.md

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
In #3972, `# pyright: ignore` was added in multiple places in the docs, and `# pylance: ignore` only once. I believe it's a typo, as AFAIK such a typing ignore comment flag doesn't exist.
)

* Fix JSON Schema generation for Discriminated Unions within lists.

* linting

* fix mypy
* build(deps): bump mypy from 0.942 to 0.950

Bumps [mypy](https://github.com/python/mypy) from 0.942 to 0.950.
- [Release notes](https://github.com/python/mypy/releases)
- [Commits](python/mypy@v0.942...v0.950)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* ignore ChainMap type

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
* update mypy ci

* test against older mypy
* try speeding up ci using caching and rearranging jobs

* fix job references

* cache lint and docs install

* tweak caching

* tweak caching to avoid conflicts

* correct use of runner.os

* bump

* stop skipping steps depending on cache

* prevent hypothesis flakeyness

* try skipping install steps again

* remove skipping install :-(
@samuelcolvin samuelcolvin mentioned this pull request May 14, 2022
11 tasks
@samuelcolvin
Copy link
Member Author

I think #4076 is an easier route.

@samuelcolvin samuelcolvin deleted the branch-v1.9.x branch August 8, 2022 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet