Skip to content

Commit

Permalink
Pin Python 3.9 version to 3.9.6
Browse files Browse the repository at this point in the history
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
  • Loading branch information
simu committed Oct 29, 2021
1 parent ab91fd1 commit 246861b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.9.6' # XXX: Regression in 3.9.7 with gitpython-3.1.20
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand All @@ -53,16 +53,18 @@ jobs:
&& chmod +x /opt/bin/jb
- name: Update PATH
run: echo "/opt/bin" >> $GITHUB_PATH
- name: Extract Python minor version from matrix python-version
run: echo "PYVER=$(echo ${{ matrix.python-version}} |cut -d. -f1,2)" >> $GITHUB_ENV
- name: Run tests on Python ${{ matrix.python-version }}
run: make test_py${{ matrix.python-version }}
run: make bench_py${PYVER}
benchs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.9.6' # XXX: Regression in 3.9.7 with gitpython-3.1.20
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand All @@ -78,15 +80,17 @@ jobs:
&& chmod +x /opt/bin/jb
- name: Update PATH
run: echo "/opt/bin" >> $GITHUB_PATH
- name: Extract Python minor version from matrix python-version
run: echo "PYVER=$(echo ${{ matrix.python-version}} |cut -d. -f1,2)" >> $GITHUB_ENV
- name: Run benchmarks on Python ${{ matrix.python-version }}
run: make bench_py${{ matrix.python-version }}
run: make bench_py${PYVER}
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.9.6' # XXX: Regression in 3.9.7 with gitpython-3.1.20
- name: Install Poetry, setup Poetry virtualenv, and build Kapitan helm bindings
run: |
pip install poetry
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/python:3.9.7-slim-buster AS base
FROM docker.io/python:3.9.6-slim-buster AS base

ENV HOME=/app

Expand Down

0 comments on commit 246861b

Please sign in to comment.