fix: Enhance platform check for stackql installation(macOS) #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enhances the reliability of stackql installation on MacOS + Fix Test Codes by:
1) Modifying the platform check to use startswith('Darwin') instead of strict equality. This ensures compatibility with various Darwin-based OS versions.
When
_setup
function check the platform, MacOS user's platform is not excatlyDarwin
,but it just starts with
Darwin
, so I changed the condition to check ifplatform.startswith('Darwin')
.2) Adding a step to clear any existing files in the unpacked directory before extracting the new stackql binary. This prevents potential conflicts and ensures a clean installation.
[before]
command is like
pkgutil --expand-full /Users/derek/.local/stackql_darwin_multiarch.pkg /Users/derek/.local/stackql
/Users/derek/.local/stackql_darwin_multiarch.pkg
(archive_file_name): This is the path to your macOS package file./Users/derek/.local/stackql
(unpacked_file_name): This is the directory where the package's contents will be extracted.But if I didn't remove
unpacked_file_name
, there was an error like below,So I add remove existing
unpacked_file_name
to make a newunpacked_file_name
.After I apply this logic, there are no error like above.
(Sorry for debugging message..!)
But if there are any other options instead of deleting
unpacked_file_name
, let me know any time 😃3) Removing External Dependencies: Eliminated the reliance on the test.env file during test execution. This enables me to test locally without
test.env
file[before]
[after]
After I deleted
. tests/creds/env_vars/test.env
execution logic, there is no error.Instead, I changed
os.environ[VARIABLES]
to simple string value.4) Introducing Mocking for Server Mode Tests: Added mocking logic to simulate the behavior of pystackql.StackQL methods in server mode.
[before]
There were errors, because it tried to execute real methods such as
pystackql.StackQL.execute
,pystackql.stackql.StackQL._run_server_query
.[After]
After I mock the method and the response, it doesn't make any error.