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

Fix Python global install #64

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

omckeon
Copy link
Contributor

@omckeon omckeon commented Oct 18, 2024

Description

This pull request updates the global install to copy the splashkit.py file to the global python location and updates the splashkit.py file generated from splashkit-core.

Changes

  1. Improved the python library loading in splashkit.py
  2. Updated global install to copy all win64 dlls (not just SplashKit.dll) to /mingw64/lib as this was needed for the splashkit.py library loading to be able to use the global lib folder.
  3. Updated the global install to copy the splashkit.py file to each OS' global python location (based on the current python3 version) to remove the need for skm when running python files.
  4. Updated the python string to remove carriage returns that were causing strange behaviour with read_line (where string variables assigned with read_line would be overwritten by any strings joined after the variable when calling write_line - eg. write_line(name + "!") with a read_line input of "Olivia" would end up as "!livia"). Issue now fixed.
    Note: This issue was solved with the help of @Liquidscroll.
  5. Updated the skm help python3 command to include global commands.
  6. Updated the skm uninstall command to remove global files and remove splashkit path from .bashrc/.bash_profile/.zshrc and remove splashkit paths from Windows User "Path" environment variable.
  7. Updated the skm-install.sh script to add splashkit paths to Windows User "Path" environment variable using powershell. This reduces the extra "junk" paths that are added/duplicated to the User "Path" from the System "Path" with the previous format/code.

How has this been tested?

  1. Copied file changes from this PR into each file inside .splashkit folder after running initial bash install script command.
  2. Ran test python program successfully (with python3 program.py).
  3. Ran skm uninstall command to check files were changed/removed as expected (with success).

Note: Above steps were tested on Linux (Ubuntu and Manjaro), Windows (MSYS2 and WSL) and macOS.

Global python testing results

Using the following test program code:

from splashkit import *

write("What is your name: ")
name = read_line()

write_line(name + "!")

Linux (Ubuntu):
global-python-UbuntuLinux

Linux (Manjaro):
global-python-ManjaroLinux

Windows (MSYS2):
global-python-MSYS2

Windows (WSL):
global-python-WSL

macOS:
global-python-macOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants