mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-08-09 23:13:23 -04:00
Fix undefined __version__ variable in setup.py
Replace exec() call with direct string parsing to read version from RNS/_version.py. This resolves the Pylance "reportUndefinedVariable" error while maintaining single-source-of-truth for version management. - Remove exec(open("RNS/_version.py").read()) pattern - Add simple string parsing: f.read().split('=')[1].strip().strip('"') - Eliminates scope issues with version variable access
This commit is contained in:
parent
6989948c40
commit
e64a1bc73b
1 changed files with 4 additions and 1 deletions
5
setup.py
5
setup.py
|
@ -1,5 +1,6 @@
|
|||
import setuptools
|
||||
import sys
|
||||
from RNS._version import __version__
|
||||
|
||||
pure_python = False
|
||||
pure_notice = "\n\n**Warning!** *This package is the zero-dependency version of Reticulum. You should almost certainly use the [normal package](https://pypi.org/project/rns) instead. Do NOT install this package unless you know exactly why you are doing it!*"
|
||||
|
@ -9,7 +10,9 @@ if '--pure' in sys.argv:
|
|||
sys.argv.remove('--pure')
|
||||
print("Building pure-python wheel")
|
||||
|
||||
exec(open("RNS/_version.py", "r").read())
|
||||
with open("RNS/_version.py", "r") as f:
|
||||
__version__ = f.read().split('=')[1].strip().strip('"')
|
||||
|
||||
with open("README.md", "r") as fh:
|
||||
long_description = fh.read()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue