Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Fix many releases issues:
Browse files Browse the repository at this point in the history
-Windows powershell syntax
-Nuitka not properly linking openssl
-Problem with the test

And clean up bits of PySteamAuth.py
  • Loading branch information
melvyn2 committed Nov 3, 2019
1 parent 28e1280 commit 7426eaf
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 46 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
run: python make.py deps
- name: Build
run: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && python make.py build --zip -v'
shell: cmd
- name: Test
run: python make.py test
- run: go get github.com/aktau/github-release
Expand Down
2 changes: 2 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 1 addition & 20 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions .idea/markdown-navigator/profiles_settings.xml

This file was deleted.

3 changes: 3 additions & 0 deletions .idea/scopes/Main_Code.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 13 additions & 11 deletions PySteamAuth/PySteamAuth.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def load_info():
info.index -= 1
conf_ui.titleLabel.setText(conf.description)
conf_ui.infoLabel.setText('{0}\nTime: {1}\nID: {2}\nType: {3}'
.format(conf.sub_description, conf.time, conf.id, conf.type_str))
.format(conf.sub_description, conf.time, conf.id, conf.type_str))
if conf.icon_url:
pixmap = QtGui.QPixmap()
pixmap.loadFromData(requests.get(conf.icon_url).content)
Expand Down Expand Up @@ -249,9 +249,10 @@ def refresh_confs():
load_info()
conf_ui.refreshButton.clicked.connect(refresh_confs)
conf_ui.nextButton.clicked.connect(lambda: (setattr(info, 'index', ((info.index + 1) if info.index <
(len(info.confs) - 1) else info.index)), load_info()))
(len(info.confs) - 1) else info.index)),
load_info()))
conf_ui.backButton.clicked.connect(lambda: (setattr(info, 'index', ((info.index - 1) if info.index > 0
else info.index)), load_info()))
else info.index)), load_info()))
conf_ui.acceptButton.clicked.connect(accept)
conf_ui.denyButton.clicked.connect(deny)
conf_dialog.exec_()
Expand All @@ -271,7 +272,7 @@ def add_authenticator():
code_ui.buttonBox.rejected.connect(lambda: setattr(endfunc, 'endfunc', True))
code_dialog.setWindowTitle('Phone number')
code_ui.actionBox.setText('This account is missing a phone number. Type yours below to add it.\n'
'Eg. +1 123-456-7890')
'Eg. +1 123-456-7890')
code_dialog.exec_()
if endfunc.endfunc:
return
Expand Down Expand Up @@ -299,7 +300,7 @@ def add_authenticator():
code_ui.buttonBox.rejected.connect(lambda: setattr(endfunc, 'endfunc', True))
code_dialog.setWindowTitle('Remove old authenticator')
code_ui.actionBox.setText('There is already an authenticator associated with this account.'
' Enter its revocation code to remove it.')
' Enter its revocation code to remove it.')
code_dialog.exec_()
if endfunc.endfunc:
return
Expand Down Expand Up @@ -327,11 +328,11 @@ def add_authenticator():
with open(os.path.join(mafiles_folder_path, 'manifest.json'), 'w') as manifest_file:
manifest_file.write(json.dumps(
{'periodic_checking': False, 'first_run': False, 'encrypted': False, 'periodic_checking_interval': 5,
'periodic_checking_checkall': False, 'auto_confirm_market_transactions': False,
'entries': [{'steamid': mwa.steam_id, 'encryption_iv': None, 'encryption_salt': None,
'filename': mwa.steam_id + '.maFile'}], 'auto_confirm_trades': False}))
'periodic_checking_checkall': False, 'auto_confirm_market_transactions': False,
'entries': [{'steamid': mwa.steam_id, 'encryption_iv': None, 'encryption_salt': None,
'filename': mwa.steam_id + '.maFile'}], 'auto_confirm_trades': False}))
Common.error_popup('This is your revocation code. Write it down physically and keep it. You will need it in case'
' you lose your authenticator.', sa.secrets['revocation_code'])
' you lose your authenticator.', sa.secrets['revocation_code'])
code_dialog = QtWidgets.QDialog()
code_ui = PyUIs.PhoneDialog.Ui_Dialog()
code_ui.setupUi(code_dialog)
Expand Down Expand Up @@ -429,7 +430,7 @@ def app_load():
manifest_entry_index = manifest['selected_account']
else:
ac_dialog = QtWidgets.QDialog()
ac_ui = PyUIs.AccountChoserDialog.Ui_Dialog()
ac_ui = PyUIs.AccountChooserDialog.Ui_Dialog()
ac_ui.setupUi(ac_dialog)
for i in valid_entries:
try:
Expand Down Expand Up @@ -518,7 +519,8 @@ def main(argv): # TODO debug menubar actions

app = QtWidgets.QApplication(argv)
if '--test' in argv:
QtCore.QTimer.singleShot(3000, app.quit)
sys.exit()
# QtCore.QTimer.singleShot(3000, app.quit)
main_window = QtWidgets.QMainWindow()
main_ui = PyUIs.MainWindow.Ui_MainWindow()
main_ui.setupUi(main_window)
Expand Down
2 changes: 1 addition & 1 deletion PySteamAuth/UIs/PySteamAuth.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ FORMS += \
ErrorDialog.ui \
ConfirmationDialog.ui \
BackupCodesDeleteDialog.ui \
AccountChoserDialog.ui \
AccountChooserDialog.ui \
BackupCodesCreatedDialog.ui

DISTFILES +=
Expand Down
43 changes: 32 additions & 11 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,28 @@ def build_qt_files():
.replace('${USERNAME}', username)
.replace('${VERSION}', version))
os.rename('PySteamAuth.dist', os.path.join('PySteamAuth.app', 'Contents', 'MacOS'))
os.chdir('..')
# Hotfix for issue Nuitka/Nuitka#516
os.chdir(os.path.join('PySteamAuth.app', 'Contents', 'MacOS'))
try:
libs = subprocess.check_output(['otool', '-L', '_ssl.so']).decode('utf-8').split('\n')
for i in libs[1:]:
if 'libssl' in i:
target_lib = i.strip().split(' (')[0].replace('@executable_path', '.')
break
else:
raise FileNotFoundError('could not find target lib path')
libs = subprocess.check_output(['otool', '-L', target_lib]).decode('utf-8').split('\n')
for i in libs[1:]:
if 'libcrypto' in i:
static_lib = i.strip().split(' (')[0]
break
else:
raise FileNotFoundError('could not find static lib path')
distributed_lib = os.path.join('@executable_path', os.path.basename(static_lib))
subprocess.check_output(['install_name_tool', '-change', static_lib, distributed_lib, target_lib])
except (subprocess.CalledProcessError, FileNotFoundError):
print('Warning: failed to patch statically linked libraries. Bundle may not work!')
os.chdir('../' * 4)
os.mkdir('dist')
os.rename(os.path.join('build', 'PySteamAuth.app'), os.path.join('dist', 'PySteamAuth.app'))
else:
Expand Down Expand Up @@ -314,6 +335,14 @@ def build_qt_files():
print('Using github-release at', gh_release)

set_target = True
try:
rev_sha = subprocess.run(['git', 'rev-parse', '--short', 'HEAD'], check=True, stderr=subprocess.PIPE,
stdout=subprocess.PIPE).stdout.decode('utf-8').strip()
except subprocess.CalledProcessError as e:
raise SystemExit('Failed to get revision sha\n' + e.stderr.decode('utf-8'))
except FileNotFoundError:
raise SystemExit('Failed to find git')

if '-t' in sys.argv:
try:
tag = sys.argv[sys.argv.index('-t') + 1]
Expand All @@ -323,16 +352,9 @@ def build_qt_files():
try:
tag = subprocess.run(['git', 'describe', '--exact-match'], check=True, stderr=subprocess.PIPE,
stdout=subprocess.PIPE).stdout.decode('utf-8').strip()
except FileNotFoundError:
raise SystemExit('Failed to find git')
except subprocess.CalledProcessError as e:
if b'no tag exactly matches' in e.stderr:
try:
tag = 'pre-' + subprocess.run(['git', 'rev-parse', '--short', 'HEAD'], check=True,
stderr=subprocess.PIPE, stdout=subprocess.PIPE) \
.stdout.decode('utf-8').strip()
except subprocess.CalledProcessError as e1:
raise SystemExit('Failed to create tag\n' + e1.stderr.decode('utf-8'))
tag = 'pre-' + rev_sha
else:
raise SystemExit('Failed to fetch tag\n' + e.stderr.decode('utf-8'))
else:
Expand All @@ -343,8 +365,7 @@ def build_qt_files():

if prerelease and '-f' not in sys.argv:
try:
if subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).decode('utf-8').strip() \
!= 'master':
if 'master' in subprocess.check_output(['git', 'branch', '--contains', rev_sha]).decode('utf-8').strip():
print('Not on master branch or tag; use -f to force')
sys.exit(0)
except subprocess.CalledProcessError:
Expand Down

0 comments on commit 7426eaf

Please sign in to comment.