File tree Expand file tree Collapse file tree 4 files changed +100
-0
lines changed Expand file tree Collapse file tree 4 files changed +100
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Run tests
2
+
3
+ on :
4
+ push :
5
+ pull_request :
6
+
7
+ env :
8
+ # global env to all steps
9
+ TOX_WORKERS : -n2
10
+
11
+ jobs :
12
+ run-test :
13
+ name : ${{ matrix.python-version }}-${{ matrix.sqlalchemy }}
14
+ runs-on : " ubuntu-latest"
15
+ strategy :
16
+ matrix :
17
+ python-version :
18
+ - " 3.9"
19
+ sqlalchemy :
20
+ - sqla_release
21
+ - sqla_master
22
+
23
+ fail-fast : false
24
+
25
+ # steps to run in each job. Some are github actions, others run shell commands
26
+ steps :
27
+ - name : Checkout repo
28
+ uses : actions/checkout@v2
29
+
30
+ - name : Set up python
31
+ uses : actions/setup-python@v2
32
+ with :
33
+ python-version : ${{ matrix.python-version }}
34
+ architecture : ${{ matrix.architecture }}
35
+
36
+ - name : Install dependencies
37
+ run : |
38
+ python -m pip install --upgrade pip
39
+ pip install --upgrade tox setuptools
40
+ pip list
41
+
42
+ - name : Set env
43
+ run : |
44
+ echo "SQLA_REF=$(python .github/workflows/scripts/find_version.py ${{ matrix.sqlalchemy }})" >> $GITHUB_ENV
45
+
46
+ - name : Run tests
47
+ run : |
48
+ tox
Original file line number Diff line number Diff line change
1
+ import json
2
+ import sys
3
+ from urllib import request
4
+
5
+
6
+ def go (argv ):
7
+ if "sqla_release" in argv :
8
+ result = request .urlopen (
9
+ "https://pypi.org/pypi/SQLAlchemy/json" , timeout = 10
10
+ )
11
+ assert result .status == 200
12
+ parsed = json .loads (result .read ())
13
+ version = parsed ["info" ]["version" ]
14
+ print (f"rel_{ version } " .replace ("." , "_" ))
15
+ else :
16
+ print ("master" )
17
+
18
+ if __name__ == "__main__" :
19
+ go (sys .argv )
Original file line number Diff line number Diff line change 7
7
* .egg-info
8
8
9
9
10
+ sqla
Original file line number Diff line number Diff line change
1
+ [tox]
2
+
3
+ ; envlist = py
4
+
5
+ SQLA_REPO = {env:SQLA_REPO:https://github.com/sqlalchemy/sqlalchemy.git}
6
+ SQLA_REF = {env:SQLA_REF:master}
7
+
8
+ [testenv]
9
+
10
+ allowlist_externals =
11
+ git
12
+
13
+ setenv =
14
+ WORKERS ={env:TOX_WORKERS:-n2}
15
+
16
+ deps =
17
+ pytest>=6.2
18
+ pytest-xdist
19
+ greenlet != 0.4.17
20
+ importlib_metadata; python_version < '3.8'
21
+ mypy
22
+ patch ==1.*
23
+
24
+ changedir = sqla
25
+
26
+ commands_pre =
27
+ python -c ' import shutil; shutil.rmtree(".", ignore_errors=True)'
28
+ git clone --depth 1 {[tox]SQLA_REPO} --branch {[tox]SQLA_REF} .
29
+
30
+
31
+ commands =
32
+ pytest {env:WORKERS} -v test/ext/mypy/test_mypy_plugin_py3k.py {posargs}
You can’t perform that action at this time.
0 commit comments