Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes 101 #114

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions assist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,11 @@ def assist_error_messages(e: int) -> str:
raise RuntimeError("assist_error_messages is missing from libassist. Please report this issue on GitHub.")
return message.decode("ascii")

try:
import pkg_resources
moduleversion = pkg_resources.require("assist")[0].version
libassistversion = __version__
if moduleversion != libassistversion:
print("WARNING: python module and libassist have different version numbers: ", moduleversion, libassistversion)
except:
pass # this check fails in python 3. Problem with setuptools
# Do not change the following line. Will be updated automatically with update_version.py
moduleversion = '1.1.9'
libassistversion = __version__
if moduleversion != libassistversion:
print("WARNING: python module and libassist have different version numbers: ", moduleversion, libassistversion)

from .ephem import Ephem
from .extras import Extras
Expand Down
9 changes: 9 additions & 0 deletions update_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@
with open("setup.py", "w") as f:
f.writelines(setuplines)

with open("assist/__init__.py") as f:
lines = f.readlines()
for i,l in enumerate(lines):
if "moduleversion = " in l:
lines[i]= "moduleversion = '"+assistversion+"'\n"

with open("assist/__init__.py", "w") as f:
f.writelines(lines)

#shortversion = assistversion
#while shortversion[-1] != '.':
# shortversion = shortversion[:-1]
Expand Down
Loading