Skip to content

Commit 8670c01

Browse files
committed
Pin Python 3.9 version to 3.9.6
gitpython-3.1.20 (imported via Kapitan 0.30.0rc0) triggers a regression in Python 3.9.7, with errors like ``` simon@wyvern:~/work/syn/commodore $ poetry run commodore component new test Adding component test... Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/simon/work/syn/commodore/commodore/cli.py", line 327, in main commodore.main(prog_name="commodore", auto_envvar_prefix="COMMODORE") File "/home/simon/.cache/pypoetry/virtualenvs/syn-commodore-mfZDsTMQ-py3.9/lib/python3.9/site-packages/click/core.py", line 1053, in main rv = self.invoke(ctx) File "/home/simon/.cache/pypoetry/virtualenvs/syn-commodore-mfZDsTMQ-py3.9/lib/python3.9/site-packages/click/core.py", line 1659, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/simon/.cache/pypoetry/virtualenvs/syn-commodore-mfZDsTMQ-py3.9/lib/python3.9/site-packages/click/core.py", line 1659, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/simon/.cache/pypoetry/virtualenvs/syn-commodore-mfZDsTMQ-py3.9/lib/python3.9/site-packages/click/core.py", line 1395, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/simon/.cache/pypoetry/virtualenvs/syn-commodore-mfZDsTMQ-py3.9/lib/python3.9/site-packages/click/core.py", line 754, in invoke return __callback(*args, **kwargs) File "/home/simon/.cache/pypoetry/virtualenvs/syn-commodore-mfZDsTMQ-py3.9/lib/python3.9/site-packages/click/decorators.py", line 84, in new_func return ctx.invoke(f, obj, *args, **kwargs) File "/home/simon/.cache/pypoetry/virtualenvs/syn-commodore-mfZDsTMQ-py3.9/lib/python3.9/site-packages/click/core.py", line 754, in invoke return __callback(*args, **kwargs) File "/home/simon/work/syn/commodore/commodore/cli.py", line 264, in component_new f.create() File "/home/simon/work/syn/commodore/commodore/component/template.py", line 100, in create git.commit(repo, "Initial commit", self.config) File "/home/simon/work/syn/commodore/commodore/git.py", line 230, in commit repo.index.commit(commit_message, author=author, committer=author) File "/home/simon/.cache/pypoetry/virtualenvs/syn-commodore-mfZDsTMQ-py3.9/lib/python3.9/site-packages/git/index/base.py", line 1000, in commit tree = self.write_tree() File "/home/simon/.cache/pypoetry/virtualenvs/syn-commodore-mfZDsTMQ-py3.9/lib/python3.9/site-packages/git/index/base.py", line 574, in write_tree root_tree = Tree(self.repo, binsha, path='') File "/home/simon/.cache/pypoetry/virtualenvs/syn-commodore-mfZDsTMQ-py3.9/lib/python3.9/site-packages/git/objects/tree.py", line 215, in __init__ super(Tree, self).__init__(repo, binsha, mode, path) File "/home/simon/.cache/pypoetry/virtualenvs/syn-commodore-mfZDsTMQ-py3.9/lib/python3.9/site-packages/git/objects/base.py", line 168, in __init__ super(IndexObject, self).__init__(repo, binsha) File "/home/simon/.cache/pypoetry/virtualenvs/syn-commodore-mfZDsTMQ-py3.9/lib/python3.9/site-packages/git/objects/base.py", line 56, in __init__ super(Object, self).__init__() File "/usr/lib/python3.9/typing.py", line 1083, in _no_init raise TypeError('Protocols cannot be instantiated') TypeError: Protocols cannot be instantiated ``` This issue has been reported in gitpython-developers/GitPython#1332 and should be fixed with a workaround in the next release of gitpython. Additionally, the regression should be fixed in the next Python 3.9 patch release, cf. https://bugs.python.org/issue45121
1 parent ef3ce01 commit 8670c01

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.github/workflows/test.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
python-version:
3838
- '3.7'
3939
- '3.8'
40-
- '3.9'
40+
- '3.9.6' # XXX: Regression in 3.9.7 with gitpython-3.1.20
4141
steps:
4242
- uses: actions/checkout@v2
4343
- uses: actions/setup-python@v2
@@ -53,16 +53,18 @@ jobs:
5353
&& chmod +x /opt/bin/jb
5454
- name: Update PATH
5555
run: echo "/opt/bin" >> $GITHUB_PATH
56+
- name: Extract Python minor version from matrix python-version
57+
run: echo "PYVER=$(echo ${{ matrix.python-version}} |cut -d. -f1,2)" >> $GITHUB_ENV
5658
- name: Run tests on Python ${{ matrix.python-version }}
57-
run: make test_py${{ matrix.python-version }}
59+
run: make bench_py${PYVER}
5860
benchs:
5961
runs-on: ubuntu-latest
6062
strategy:
6163
matrix:
6264
python-version:
6365
- '3.7'
6466
- '3.8'
65-
- '3.9'
67+
- '3.9.6' # XXX: Regression in 3.9.7 with gitpython-3.1.20
6668
steps:
6769
- uses: actions/checkout@v2
6870
- uses: actions/setup-python@v2
@@ -78,15 +80,17 @@ jobs:
7880
&& chmod +x /opt/bin/jb
7981
- name: Update PATH
8082
run: echo "/opt/bin" >> $GITHUB_PATH
83+
- name: Extract Python minor version from matrix python-version
84+
run: echo "PYVER=$(echo ${{ matrix.python-version}} |cut -d. -f1,2)" >> $GITHUB_ENV
8185
- name: Run benchmarks on Python ${{ matrix.python-version }}
82-
run: make bench_py${{ matrix.python-version }}
86+
run: make bench_py${PYVER}
8387
integration:
8488
runs-on: ubuntu-latest
8589
steps:
8690
- uses: actions/checkout@v2
8791
- uses: actions/setup-python@v2
8892
with:
89-
python-version: '3.9'
93+
python-version: '3.9.6' # XXX: Regression in 3.9.7 with gitpython-3.1.20
9094
- name: Install Poetry, setup Poetry virtualenv, and build Kapitan helm bindings
9195
run: |
9296
pip install poetry

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/python:3.9.7-slim-buster AS base
1+
FROM docker.io/python:3.9.6-slim-buster AS base
22

33
ENV HOME=/app
44

0 commit comments

Comments
 (0)