Skip to content

Commit 0cb1327

Browse files
committed
refactor: remove redundant version parsing from setup.py
setuptools automatically reads version from pyproject.toml's tool.setuptools.dynamic.version configuration. Manual regex parsing was unnecessary duplication.
1 parent 9eabe56 commit 0cb1327

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

setup.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
import re
2-
from pathlib import Path
3-
41
from setuptools import find_packages, setup
52

6-
version_file = Path(__file__).parent / "contractions" / "_version.py"
7-
version_content = version_file.read_text()
8-
version_match = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', version_content, re.M)
9-
if not version_match:
10-
raise RuntimeError("Unable to find version string.")
11-
VERSION = version_match.group(1)
12-
133
setup(
144
packages=find_packages(exclude=["tests", "tests.*"]),
155
package_data={

0 commit comments

Comments
 (0)