Skip to content

Commit

Permalink
Re-add Python 3.8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Moguri committed Jul 28, 2023
1 parent 014b163 commit 3ea3dea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
pyversion: ['3.9', '3.10']
pyversion: ['3.8', '3.9', '3.10']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 4 additions & 2 deletions gltf/_converter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import base64
import collections
import itertools
Expand Down Expand Up @@ -47,8 +49,8 @@ def get_extras(gltf_data):
class CharInfo:
character: p3d.Character
nodepath: p3d.NodePath
jvtmap: dict[int, p3d.JointVertexTransform]
cvsmap: dict[tuple[int, str], p3d.CharacterVertexSlider]
jvtmap: 'dict[int, p3d.JointVertexTransform]'
cvsmap: 'dict[tuple[int, str], p3d.CharacterVertexSlider]'

def __init__(self, name: str):
self.character = p3d.Character(name)
Expand Down
4 changes: 2 additions & 2 deletions gltf/_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def load_model(file_path, gltf_settings=None):

def _config_var_for_type(var_type):
return {
str: p3d.ConfigVariableString,
bool: p3d.ConfigVariableBool,
'str': p3d.ConfigVariableString,
'bool': p3d.ConfigVariableBool,
}.get(var_type, None)


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies = [
"panda3d >= 1.10.8",
"panda3d-simplepbr >= 0.6",
]
requires-python = ">= 3.9"
requires-python = ">= 3.8"

[project.urls]
homepage = "https://github.com/Moguri/panda3d-gltf"
Expand Down

1 comment on commit 3ea3dea

@ekiefl
Copy link

@ekiefl ekiefl commented on 3ea3dea Jul 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand this change correctly, an alternative way to provide 3.8 support without changing your types to strings:

from __future__ import annotations

Please sign in to comment.