Skip to content

Commit 66c8857

Browse files
authored
Merge branch 'master' into master
2 parents aa9a3cf + 52d992d commit 66c8857

309 files changed

Lines changed: 11178 additions & 10577 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.flake8

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/auto-merge-dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Auto approve
15-
uses: hmarr/auto-approve-action@v3.1.0
15+
uses: hmarr/auto-approve-action@v4.0.0
1616
if: github.actor == 'dependabot[bot]'
1717
with:
1818
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- name: Dependabot metadata
2424
id: metadata
25-
uses: dependabot/fetch-metadata@v1.3.4
25+
uses: dependabot/fetch-metadata@v2.0.0
2626
with:
2727
github-token: "${{ secrets.GITHUB_TOKEN }}"
2828

.github/workflows/benchmark.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: codspeed-benchmarks
2+
3+
on:
4+
push:
5+
branches: [ master, pydantic_v2 ]
6+
pull_request:
7+
branches: [ master, pydantic_v2 ]
8+
# `workflow_dispatch` allows CodSpeed to trigger backtest
9+
# performance analysis in order to generate initial data.
10+
workflow_dispatch:
11+
12+
jobs:
13+
benchmarks:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v3
18+
with:
19+
python-version: "3.11"
20+
21+
- name: Install Poetry
22+
uses: snok/install-poetry@v1.3.3
23+
with:
24+
version: 1.4.2
25+
virtualenvs-create: false
26+
27+
- name: Poetry details
28+
run: |
29+
poetry --version
30+
poetry config --list
31+
32+
- name: Install dependencies
33+
run: poetry install --extras "all"
34+
35+
- name: Run benchmarks
36+
uses: CodSpeedHQ/action@v2
37+
with:
38+
token: ${{ secrets.CODSPEED_TOKEN }}
39+
run: poetry run pytest benchmarks/ --codspeed

.github/workflows/deploy-docs.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
11
name: Build Documentation using MkDocs
22
on:
33
push:
4-
branches: [ master ]
4+
# Pattern matched against refs/tags
5+
tags:
6+
- '**'
57
jobs:
68
build:
79
name: Build and Deploy Documentation
810
runs-on: ubuntu-latest
911
steps:
1012
- name: Checkout Master
11-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1214
- name: Set up Python 3.8
13-
uses: actions/setup-python@v4
15+
uses: actions/setup-python@v5
1416
with:
1517
python-version: '3.8'
1618
- name: Install dependencies
1719
run: |
18-
python -m pip install poetry==1.1.11
20+
python -m pip install poetry==1.4.1
1921
poetry install --extras "all"
2022
env:
2123
POETRY_VIRTUALENVS_CREATE: false
24+
- name: Set env
25+
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
26+
- name: Test
27+
run: |
28+
echo $RELEASE_VERSION
29+
echo ${{ env.RELEASE_VERSION }}
2230
- name: Deploy
2331
run: |
24-
mkdocs gh-deploy --force
32+
mike deploy --push --update-aliases ${{ env.RELEASE_VERSION }} latest

.github/workflows/lint.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: lint
5+
6+
on:
7+
push:
8+
branches-ignore:
9+
- 'gh-pages'
10+
pull_request:
11+
branches: [ master, pydantic_v2 ]
12+
13+
jobs:
14+
lint:
15+
name: "Python ${{ matrix.python-version }}"
16+
runs-on: ubuntu-latest
17+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'collerek/ormar'
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: 3.11
25+
26+
- name: Install Poetry
27+
uses: snok/install-poetry@v1.3.3
28+
with:
29+
version: 1.4.2
30+
virtualenvs-create: false
31+
32+
- name: Poetry details
33+
run: |
34+
poetry --version
35+
poetry config --list
36+
37+
- name: Install dependencies
38+
run: poetry install --extras "all" --no-root
39+
40+
- name: Format
41+
run: make fmt
42+
43+
- name: Lint
44+
run: make lint

.github/workflows/python-publish.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- name: Set up Python
21-
uses: actions/setup-python@v4
21+
uses: actions/setup-python@v5
2222
with:
2323
python-version: '3.x'
2424

2525
- name: Install Poetry
2626
uses: snok/install-poetry@v1.3
2727
with:
28+
version: 1.4.1
2829
virtualenvs-create: true
2930
virtualenvs-in-project: true
3031

.github/workflows/test-package.yml

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: build
4+
name: test
55

66
on:
77
push:
88
branches-ignore:
99
- 'gh-pages'
1010
pull_request:
11-
branches: [ master ]
11+
branches: [ master, pydantic_v2 ]
1212

1313
jobs:
1414
tests:
@@ -17,7 +17,7 @@ jobs:
1717
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'collerek/ormar'
1818
strategy:
1919
matrix:
20-
python-version: [3.7, 3.8, 3.9, "3.10"]
20+
python-version: [3.8, 3.9, "3.10", 3.11]
2121
fail-fast: false
2222
services:
2323
mysql:
@@ -39,37 +39,80 @@ jobs:
3939
POSTGRES_DB: testsuite
4040
ports:
4141
- 5432:5432
42-
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
42+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 --name postgres
4343

4444
steps:
45-
- uses: actions/checkout@v3
45+
- name: Checkout
46+
uses: actions/checkout@v4
47+
with:
48+
submodules: false
4649
- name: Set up Python
47-
uses: actions/setup-python@v4
50+
uses: actions/setup-python@v5
4851
with:
4952
python-version: ${{ matrix.python-version }}
50-
- name: Install dependencies
53+
54+
- name: Install Poetry
55+
uses: snok/install-poetry@v1.3.3
56+
with:
57+
version: 1.4.2
58+
virtualenvs-create: false
59+
60+
- name: Poetry details
5161
run: |
52-
python -m pip install poetry==1.1.11
53-
poetry install --extras "all"
54-
env:
55-
POETRY_VIRTUALENVS_CREATE: false
62+
poetry --version
63+
poetry config --list
64+
65+
- name: Install dependencies
66+
run: poetry install --extras "all"
67+
5668
- name: Run mysql
5769
env:
5870
DATABASE_URL: "mysql://username:password@127.0.0.1:3306/testsuite"
5971
run: bash scripts/test.sh
72+
73+
- name: Install postgresql-client
74+
run: |
75+
sudo apt-get update
76+
sudo apt-get install --yes postgresql-client
77+
78+
- name: Connect to PostgreSQL with CLI
79+
run: env PGPASSWORD=password psql -h localhost -U username -c 'SELECT VERSION();' testsuite
80+
81+
- name: Show max connections
82+
run: env PGPASSWORD=password psql -h localhost -U username -c 'SHOW max_connections;' testsuite
83+
84+
- name: Alter max connections
85+
run: |
86+
87+
docker exec -i postgres bash << EOF
88+
sed -i -e 's/max_connections = 100/max_connections = 1000/' /var/lib/postgresql/data/postgresql.conf
89+
sed -i -e 's/shared_buffers = 128MB/shared_buffers = 512MB/' /var/lib/postgresql/data/postgresql.conf
90+
EOF
91+
docker restart --time 0 postgres
92+
sleep 5
93+
94+
- name: Show max connections
95+
run: env PGPASSWORD=password psql -h localhost -U username -c 'SHOW max_connections;' testsuite
96+
6097
- name: Run postgres
6198
env:
6299
DATABASE_URL: "postgresql://username:password@localhost:5432/testsuite"
63100
run: bash scripts/test.sh
101+
64102
- name: Run sqlite
65103
env:
66104
DATABASE_URL: "sqlite:///testsuite"
67105
run: bash scripts/test.sh
68-
- run: mypy ormar tests
106+
69107
- name: Upload coverage
70-
uses: codecov/codecov-action@v3.1.1
108+
uses: codecov/codecov-action@v4.1.0
109+
with:
110+
name: codecov-umbrella
111+
token: ${{ secrets.CODCOV_TOKEN }}
112+
verbose: true
113+
71114
- name: Test & publish code coverage
72-
uses: paambaati/codeclimate-action@v3.2.0
115+
uses: paambaati/codeclimate-action@v5.0.0
73116
if: github.event.pull_request.head.repo.full_name == 'collerek/ormar'
74117
env:
75118
CC_TEST_REPORTER_ID: ${{ secrets.CC_COVERAGE_TOKEN }}

.github/workflows/test_docs.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: test_docs
5+
6+
on:
7+
push:
8+
branches-ignore:
9+
- 'gh-pages'
10+
pull_request:
11+
branches: [ master, pydantic_v2 ]
12+
13+
jobs:
14+
tests_docs:
15+
name: "Python ${{ matrix.python-version }}"
16+
runs-on: ubuntu-latest
17+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'collerek/ormar'
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: 3.11
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install poetry==1.4.2
27+
poetry install --extras "all"
28+
env:
29+
POETRY_VIRTUALENVS_CREATE: false
30+
- name: Test docs
31+
run: bash scripts/test_docs.sh

.github/workflows/type-check.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: type_check
5+
6+
on:
7+
push:
8+
branches-ignore:
9+
- 'gh-pages'
10+
pull_request:
11+
branches: [ master, pydantic_v2 ]
12+
13+
jobs:
14+
lint:
15+
name: "Python ${{ matrix.python-version }}"
16+
runs-on: ubuntu-latest
17+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'collerek/ormar'
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: 3.11
25+
26+
- name: Install Poetry
27+
uses: snok/install-poetry@v1.3.3
28+
with:
29+
version: 1.4.2
30+
virtualenvs-create: false
31+
32+
- name: Poetry details
33+
run: |
34+
poetry --version
35+
poetry config --list
36+
37+
- name: Install dependencies
38+
run: poetry install --extras "all" --no-root
39+
40+
- name: Type check
41+
run: make type_check

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ build
99
*.pyc
1010
*.log
1111
test.db
12+
.vscode/
1213
dist
1314
/ormar.egg-info/
1415
site
1516
profile.py
1617
*.db
1718
*.db-journal
18-
*coverage.xml
19+
*coverage.xml
20+
.benchmarks/

0 commit comments

Comments
 (0)