Skip to content

Commit d44d0ca

Browse files
committed
fix setup and backport
1 parent 5510c5f commit d44d0ca

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

csv2cmi.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from csv import DictReader
1717
from datetime import datetime
1818
from email.utils import parseaddr
19-
from enum import StrEnum
2019
from pathlib import Path
2120
from secrets import token_hex
2221
from typing import Optional
@@ -27,6 +26,11 @@
2726
__version__ = "3.0.0-alpha"
2827
__author__ = "Klaus Rettinghaus"
2928

29+
if sys.version_info >= (3, 11):
30+
from enum import StrEnum
31+
else:
32+
from backports.strenum import StrEnum
33+
3034
# define log output
3135
logging.basicConfig(format="%(levelname)s: %(message)s")
3236
logs = logging.getLogger()

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "csv2cmi"
77
dynamic = ["version"]
8+
dependencies = [
9+
"backports.strenum; python_version < '3.11'",
10+
]
11+
requires-python = ">= 3.8"
812
authors = [{name = "Klaus Rettinghaus"}]
913
description = "converts a table of letters into CMI format"
1014
readme = {file = "README.md", content-type = "text/markdown"}
@@ -22,5 +26,8 @@ keywords = ["TEI", "CSV", "CMIF", "digital humanities", "correspondence"]
2226
[tool.ruff]
2327
line-length = 120
2428

29+
[tool.setuptools]
30+
py-modules = ["csv2cmi"]
31+
2532
[tool.setuptools.dynamic]
26-
version = {attr = "package.__version__"}
33+
version = {attr = "csv2cmi.__version__"}

0 commit comments

Comments
 (0)