Skip to content

Commit

Permalink
Supporting Python 3.13 (#1996)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science authored Nov 1, 2024
1 parent e777af7 commit 7dffa72
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
python: [3.9, '3.10', '3.11', '3.12']
python: [3.9, '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: Update package index
run: sudo apt-get update
- name: Install mpi libs
Expand Down
5 changes: 5 additions & 0 deletions armi/utils/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def __new__(cls, name, bases, attrs):

# Auto fields have been resolved, so now collect all ints
allFields = {name: val for name, val in attrs.items() if isinstance(val, int)}
allFields = {n: v for n, v in allFields.items() if not _FlagMeta.isdunder(n)}
flagClass._nameToValue = allFields
flagClass._valuesTaken = set(val for _, val in allFields.items())
flagClass._autoAt = autoAt
Expand All @@ -104,6 +105,10 @@ def __new__(cls, name, bases, attrs):

return flagClass

@staticmethod
def isdunder(s):
return s.startswith("__") and s.endswith("__")

def __getitem__(cls, key):
"""
Implement indexing at the class level.
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Information Analysis",
]

Expand Down

0 comments on commit 7dffa72

Please sign in to comment.