Skip to content

Commit

Permalink
Fetch upstream
Browse files Browse the repository at this point in the history
source /home/aleksul/projects/pydantic/venv/bin/activatebuild(deps): bump actions/setup-python from 2 to 3
(pydantic#3868)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 3.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump actions/checkout from 2 to 3 (pydantic#3869)

Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump mkdocs-material from 8.1.3 to 8.2.3 (pydantic#3865)

Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 8.1.3 to 8.2.3.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@8.1.3...8.2.3)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump coverage from 6.2 to 6.3.2 (pydantic#3839)

Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.2 to 6.3.2.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](nedbat/coveragepy@6.2...6.3.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Fixed a typo in decimal_encoder's doc. (pydantic#3820)

build(deps): bump pre-commit from 2.16.0 to 2.17.0 (pydantic#3731)

Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.16.0 to 2.17.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/master/CHANGELOG.md)
- [Commits](pre-commit/pre-commit@v2.16.0...v2.17.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump mypy from 0.930 to 0.931 (pydantic#3656)

Bumps [mypy](https://github.com/python/mypy) from 0.930 to 0.931.
- [Release notes](https://github.com/python/mypy/releases)
- [Commits](python/mypy@v0.930...v0.931)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

docs: fix typo in settings management page (pydantic#3781)

build(deps): bump black from 21.12b0 to 22.3.0 (pydantic#3950)

* build(deps): bump black from 21.12b0 to 22.3.0

Bumps [black](https://github.com/psf/black) from 21.12b0 to 22.3.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits/22.3.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

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

* apply new black styles, fix docs

* try upgrading pip before fastapi tests

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

build(deps): bump python-dotenv from 0.19.2 to 0.20.0 (pydantic#3963)

Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 0.19.2 to 0.20.0.
- [Release notes](https://github.com/theskumar/python-dotenv/releases)
- [Changelog](https://github.com/theskumar/python-dotenv/blob/master/CHANGELOG.md)
- [Commits](theskumar/python-dotenv@v0.19.2...v0.20.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump hypothesis from 6.31.6 to 6.41.0 (pydantic#3964)

Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.31.6 to 6.41.0.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@hypothesis-python-6.31.6...hypothesis-python-6.41.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump pytest from 6.2.5 to 7.1.1 (pydantic#3926)

Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.5 to 7.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@6.2.5...7.1.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump twine from 3.7.1 to 4.0.0 (pydantic#3965)

Bumps [twine](https://github.com/pypa/twine) from 3.7.1 to 4.0.0.
- [Release notes](https://github.com/pypa/twine/releases)
- [Changelog](https://github.com/pypa/twine/blob/main/docs/changelog.rst)
- [Commits](pypa/twine@3.7.1...4.0.0)

---
updated-dependencies:
- dependency-name: twine
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump cython from 0.29.26 to 0.29.28 (pydantic#3871)

Bumps [cython](https://github.com/cython/cython) from 0.29.26 to 0.29.28.
- [Release notes](https://github.com/cython/cython/releases)
- [Changelog](https://github.com/cython/cython/blob/master/CHANGES.rst)
- [Commits](cython/cython@0.29.26...0.29.28)

---
updated-dependencies:
- dependency-name: cython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump typing-extensions from 4.0.1 to 4.1.1 (pydantic#3874)

Bumps [typing-extensions](https://github.com/python/typing) from 4.0.1 to 4.1.1.
- [Release notes](https://github.com/python/typing/releases)
- [Changelog](https://github.com/python/typing/blob/master/typing_extensions/CHANGELOG)
- [Commits](python/typing@4.0.1...4.1.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump pytest-mock from 3.6.1 to 3.7.0 (pydantic#3967)

Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.6.1 to 3.7.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest-mock@v3.6.1...v3.7.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Combine dependabot prs (pydantic#3969)

* allow combining of dependabot PRs

* add combine-dependabot.yml

CentOS 7: `read_text(encoding='utf-8')` (pydantic#3625)

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>

fix: clarify that discriminated unions do not support singletons (pydantic#3639)

Add Robusta.dev to list of Pydantic users (pydantic#3715)

* add robusta.dev to pydantic users

* update robusta.dev description and fix typo

Prevent subclasses of bytes being converted to bytes (pydantic#3707)

* adding a test

* fix and add change description

build(deps): bump mypy from 0.931 to 0.942 (pydantic#3968)

* build(deps): bump mypy from 0.931 to 0.942

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

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

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

* build(deps): bump mypy from 0.931 to 0.942

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

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

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

* fix mypy

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

Fix pytest crashes with hypothesis and pydantic (pydantic#3727)

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 (pydantic#3806)

* 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

[no ci] correct name of change file

Remove benchmarks completely (pydantic#3973)

* removing benchmarks completely

* [no ci] add change

fix: `Config.copy_on_model_validation` does a deep copy and not a shallow one (pydantic#3642)

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

closes pydantic#3641

* fix: typo

* use python 3.10 to run fastapi tests

* fix fastapi test call

Co-authored-by: Samuel Colvin <s@muelcolvin.com>

build(deps): bump typing-extensions from 4.1.1 to 4.2.0 (pydantic#4040)

Bumps [typing-extensions](https://github.com/python/typing) from 4.1.1 to 4.2.0.
- [Release notes](https://github.com/python/typing/releases)
- [Changelog](https://github.com/python/typing/blob/master/typing_extensions/CHANGELOG.md)
- [Commits](python/typing@4.1.1...4.2.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump mkdocs-material from 8.2.8 to 8.2.12 (pydantic#4038)

Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 8.2.8 to 8.2.12.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@8.2.8...8.2.12)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump pytest from 7.1.1 to 7.1.2 (pydantic#4037)

Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.1.1 to 7.1.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@7.1.1...7.1.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump actions/upload-artifact from 2 to 3 (pydantic#4035)

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump actions/download-artifact from 2 to 3 (pydantic#4034)

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v2...v3)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump email-validator from 1.1.3 to 1.2.1 (pydantic#4060)

Bumps [email-validator](https://github.com/JoshData/python-email-validator) from 1.1.3 to 1.2.1.
- [Release notes](https://github.com/JoshData/python-email-validator/releases)
- [Commits](JoshData/python-email-validator@v1.1.3...v1.2.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump hypothesis from 6.41.0 to 6.46.3 (pydantic#4059)

Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.41.0 to 6.46.3.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](HypothesisWorks/hypothesis@hypothesis-python-6.41.0...hypothesis-python-6.46.3)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

build(deps): bump pre-commit from 2.17.0 to 2.19.0 (pydantic#4061)

Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 2.17.0 to 2.19.0.
- [Release notes](https://github.com/pre-commit/pre-commit/releases)
- [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md)
- [Commits](pre-commit/pre-commit@v2.17.0...v2.19.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

test pyright with pydantic (pydantic#3972)

* test pyright with pydantic

* rename file to avoid pytest running it

* try another name 😴

* add docs about BaseSettings and Field

* add change

Fix regression in handling of nested dataclasses in `get_flat_models_from_field` (pydantic#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 (pydantic#3713)

* Fix issue with self-referencing dataclass

* Fix mypy issue

guard against ClassVar in fields (pydantic#4064)

* guard against ClassVar in fields, fix pydantic#3679

* fix linting

* skipif for test_class_var_forward_ref

Fix issue with in-place modification of FieldInfo (pydantic#4067)

* 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>

build(deps): bump mkdocs-material from 8.2.8 to 8.2.14 (pydantic#4063)

Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 8.2.8 to 8.2.14.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](squidfunk/mkdocs-material@8.2.8...8.2.14)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
dependabot[bot] authored and aleksul committed May 13, 2022
1 parent afb83a6 commit c49868a
Show file tree
Hide file tree
Showing 64 changed files with 519 additions and 1,005 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Expand Up @@ -4,7 +4,7 @@ updates:
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
interval: monthly

- package-ecosystem: github-actions
directory: /
Expand Down
88 changes: 37 additions & 51 deletions .github/workflows/ci.yml
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: set up python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.9

Expand All @@ -37,13 +37,22 @@ jobs:
- name: check dist
run: make check-dist

- name: install node for pyright
uses: actions/setup-node@v3
with:
node-version: '14'

- run: npm install -g pyright

- run: make pyright

docs-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: set up python
uses: actions/setup-python@v1
uses: actions/setup-python@v3
with:
python-version: 3.8

Expand All @@ -54,7 +63,7 @@ jobs:
run: make docs

- name: Store docs site
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: docs
path: site
Expand All @@ -71,10 +80,10 @@ jobs:
OS: ubuntu

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: set up python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -120,7 +129,7 @@ jobs:
CONTEXT: linux-py${{ matrix.python-version }}-compiled-no-deps-no

- name: store coverage files
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage
Expand All @@ -140,10 +149,10 @@ jobs:

runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: set up python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -159,7 +168,7 @@ jobs:
CONTEXT: ${{ matrix.os }}-py${{ matrix.python-version }}

- name: store coverage files
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage
Expand All @@ -173,10 +182,10 @@ jobs:
mypy-version: ['0.910', '0.920', '0.921']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: set up python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.10'

Expand All @@ -200,7 +209,7 @@ jobs:
CONTEXT: linux-py3.10-mypy${{ matrix.mypy-version }}

- name: store coverage files
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage
Expand All @@ -210,14 +219,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v1
- uses: actions/setup-python@v3
with:
python-version: '3.8'

- name: get coverage files
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage
Expand All @@ -230,7 +239,7 @@ jobs:
- run: coverage html --show-contexts

- name: Store coverage html
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: coverage-html
path: htmlcov
Expand All @@ -239,10 +248,10 @@ jobs:
name: test fastAPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: set up python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.10'

Expand All @@ -252,32 +261,9 @@ jobs:
- name: test
run: make test-fastapi

benchmark:
name: run benchmarks
runs-on: ubuntu-latest
env:
BENCHMARK_REPEATS: 1

steps:
- uses: actions/checkout@v2

- name: set up python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: install and build
run: |
make build
make install-benchmarks
- run: make benchmark-pydantic
- run: make benchmark-all
- run: make benchmark-json

build:
name: build py3.${{ matrix.python-version }} on ${{ matrix.platform || matrix.os }}
needs: [lint, test-linux, test-windows-mac, test-old-mypy, test-fastapi, benchmark]
needs: [lint, test-linux, test-windows-mac, test-old-mypy, test-fastapi]
if: "success() && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master')"
strategy:
fail-fast: false
Expand All @@ -292,10 +278,10 @@ jobs:

runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: set up python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.8'

Expand Down Expand Up @@ -331,7 +317,7 @@ jobs:
twine check dist/*
- name: Store dist artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: pypi_files
path: dist
Expand All @@ -343,21 +329,21 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: set up python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.8'

- name: get dist artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: pypi_files
path: dist

- name: get docs
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: docs
path: site
Expand Down
137 changes: 137 additions & 0 deletions .github/workflows/combine-dependabot.yml
@@ -0,0 +1,137 @@
# from https://github.com/hrvey/combine-prs-workflow/blob/master/combine-prs.yml
name: 'Combine Dependabot PRs'

on:
workflow_dispatch:
inputs:
branchPrefix:
description: 'Branch prefix to find combinable PRs based on'
required: true
default: 'dependabot/'
mustBeGreen:
description: 'Only combine PRs that are green'
required: true
default: true
combineBranchName:
description: 'Name of the branch to combine PRs into'
required: true
default: 'combine-dependabot-bumps'
ignoreLabel:
description: 'Exclude PRs with this label'
required: true
default: 'nocombine'

jobs:
combine-prs:
runs-on: ubuntu-latest

steps:
- uses: actions/github-script@v6
id: fetch-branch-names
name: Fetch branch names
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const pulls = await github.paginate('GET /repos/:owner/:repo/pulls', {
owner: context.repo.owner,
repo: context.repo.repo
});
branches = [];
prs = [];
base_branch = null;
for (const pull of pulls) {
const branch = pull['head']['ref'];
console.log('Pull for branch: ' + branch);
if (branch.startsWith('${{ github.event.inputs.branchPrefix }}')) {
console.log('Branch matched: ' + branch);
statusOK = true;
if(${{ github.event.inputs.mustBeGreen }}) {
console.log('Checking green status: ' + branch);
const statuses = await github.paginate('GET /repos/{owner}/{repo}/commits/{ref}/status', {
owner: context.repo.owner,
repo: context.repo.repo,
ref: branch
});
if(statuses.length > 0) {
const latest_status = statuses[0]['state'];
console.log('Validating status: ' + latest_status);
if(latest_status != 'success') {
console.log('Discarding ' + branch + ' with status ' + latest_status);
statusOK = false;
}
}
}
console.log('Checking labels: ' + branch);
const labels = pull['labels'];
for(const label of labels) {
const labelName = label['name'];
console.log('Checking label: ' + labelName);
if(labelName == '${{ github.event.inputs.ignoreLabel }}') {
console.log('Discarding ' + branch + ' with label ' + labelName);
statusOK = false;
}
}
if (statusOK) {
console.log('Adding branch to array: ' + branch);
branches.push(branch);
prs.push('#' + pull['number'] + ' ' + pull['title']);
base_branch = pull['base']['ref'];
}
}
}
if (branches.length == 0) {
core.setFailed('No PRs/branches matched criteria');
return;
}
core.setOutput('base-branch', base_branch);
core.setOutput('prs-string', prs.join('\n'));
combined = branches.join(' ')
console.log('Combined: ' + combined);
return combined
- uses: actions/checkout@v3
with:
fetch-depth: 0

# Creates a branch with other PR branches merged together
- name: Created combined branch
env:
BASE_BRANCH: ${{ steps.fetch-branch-names.outputs.base-branch }}
BRANCHES_TO_COMBINE: ${{ steps.fetch-branch-names.outputs.result }}
COMBINE_BRANCH_NAME: ${{ github.event.inputs.combineBranchName }}
run: |
echo "$BRANCHES_TO_COMBINE"
sourcebranches="${BRANCHES_TO_COMBINE%\"}"
sourcebranches="${sourcebranches#\"}"
basebranch="${BASE_BRANCH%\"}"
basebranch="${basebranch#\"}"
git config pull.rebase false
git config user.name github-actions
git config user.email github-actions@github.com
git branch $COMBINE_BRANCH_NAME $basebranch
git checkout $COMBINE_BRANCH_NAME
git pull origin $sourcebranches --no-edit
git push origin $COMBINE_BRANCH_NAME
# Creates a PR with the new combined branch
- uses: actions/github-script@v6
name: Create Combined Pull Request
env:
PRS_STRING: ${{ steps.fetch-branch-names.outputs.prs-string }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const prString = process.env.PRS_STRING;
const body = 'This PR was created by the Combine PRs action by combining the following PRs:\n' + prString;
await github.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Combined Dependabot Bumps',
head: '${{ github.event.inputs.combineBranchName }}',
base: '${{ steps.fetch-branch-names.outputs.base-branch }}',
body: body
});
2 changes: 1 addition & 1 deletion .github/workflows/upload-previews.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/setup-python@v1
- uses: actions/setup-python@v3
with:
python-version: '3.8'

Expand Down

0 comments on commit c49868a

Please sign in to comment.