mirror of
https://github.com/openbsd/ports.git
synced 2026-06-17 23:13:55 +02:00
pick up upstream commit fixing with newer python
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
From 469058d50d4b7ff8da54b623a0a1aa972cd78dc6 Mon Sep 17 00:00:00 2001
|
||||
From: Seva Alekseyev <sevaa@nih.gov>
|
||||
Date: Thu, 4 Dec 2025 11:24:19 -0500
|
||||
Subject: [PATCH] No more hand parsing __init__ for VERSION
|
||||
|
||||
Index: setup.py
|
||||
--- setup.py.orig
|
||||
+++ setup.py
|
||||
@@ -1,22 +1,4 @@
|
||||
from setuptools import setup
|
||||
-import ast
|
||||
-import os
|
||||
-currentDir = os.path.dirname(os.path.abspath(__file__))
|
||||
-#currentDir = Path(__file__).parent
|
||||
+from filebytes.__init__ import VERSION
|
||||
|
||||
-def extractMetaInfo(src):
|
||||
- info = {}
|
||||
- a=ast.parse(src)
|
||||
- for e in a.body:
|
||||
- if isinstance(e, ast.Assign) and isinstance(e.value, ast.Str):
|
||||
- info[e.targets[0].id] = e.value.s
|
||||
- return info
|
||||
-
|
||||
-text = ''
|
||||
-with open(currentDir +os.path.sep+"filebytes"+ os.path.sep+"__init__.py") as f:
|
||||
- text = f.read()
|
||||
-
|
||||
-version = extractMetaInfo(text)["VERSION"]
|
||||
-
|
||||
-
|
||||
-setup(version=version)
|
||||
+setup(version=VERSION)
|
||||
Reference in New Issue
Block a user