Skip to content

Commit

Permalink
Add aenum as a dependency for python versions <= 3.12 to support requ…
Browse files Browse the repository at this point in the history
…ired enum functionalities.
  • Loading branch information
jatkinson1000 committed Jan 25, 2025
1 parent 6cd8391 commit 9f934f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion archeryutils/classifications/AGB_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
"""Set of useful enums for input to Archery GB classification routines."""

from enum import Enum, Flag, auto
# To support python versions < 3.12 we can use the aenum library as a separate
# dependency before it was integrated into python3.11
# It is needed for iterable Flag in 3.11 and use of `in` for Flag in 3.12
import sys

if sys.version_info >= (3, 12):
from enum import Enum, Flag, auto
else:
from aenum import Enum, Flag, auto


class AGB_genders(Enum):
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ classifiers = [
]
dependencies = [
"numpy>=1.20.0",
"aenum; python_version<'3.12'",
]

[project.optional-dependencies]
Expand Down

0 comments on commit 9f934f0

Please sign in to comment.