Skip to content

Commit

Permalink
Merge pull request #45 from derek10cloud/improve-macos-compatibility
Browse files Browse the repository at this point in the history
fix: Enhance platform check for stackql installation(macOS)
  • Loading branch information
jeffreyaven authored Sep 21, 2024
2 parents e8d749a + e97e7d7 commit efaaea2
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 90 deletions.
97 changes: 52 additions & 45 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,166 +1,173 @@
# Changelog

## v3.6.5 (2024-09-19)

### Bug Fixes

- Fix(MacOS): Enhanced platform check for stackql installation
- Fix(Test Code): Removed loading of `test.env` in test execution script and Add mocking logic for `pystackql.StackQL`'s methods.

## v3.6.4 (2024-07-17)

### Updates

* added dataflow dependency arguments
- added dataflow dependency arguments

## v3.6.3 (2024-06-22)

### Updates

* build updates
- build updates

## v3.6.2 (2024-05-06)

### Updates

* added `rowsaffected` to dict response for `executeStmt`
- added `rowsaffected` to dict response for `executeStmt`

## v3.6.1 (2024-04-18)

### Updates

* modified dict response for `executeStmt`
* modified error response for `execute`, should never return `None`
- modified dict response for `executeStmt`
- modified error response for `execute`, should never return `None`

## v3.5.4 (2024-04-11)

### Updates

* added `suppress_errors` argument to the `execute` function
- added `suppress_errors` argument to the `execute` function

## v3.5.3 (2024-04-08)

### Updates

* added `backend_storage_mode` and `backend_file_storage_location` constructor args for specifying a file based backend (not applicable in `server_mode`)
- added `backend_storage_mode` and `backend_file_storage_location` constructor args for specifying a file based backend (not applicable in `server_mode`)

## v3.5.2 (2024-03-21)

### Updates

* added `custom_registry` constructor arg for specifying a non-default registry
- added `custom_registry` constructor arg for specifying a non-default registry

## v3.5.1 (2024-03-15)

### Updates

* included `pandas` and `IPython` install requirements
* optional required import of `psycopg2` only if in `server_mode`
- included `pandas` and `IPython` install requirements
- optional required import of `psycopg2` only if in `server_mode`

## v3.2.5 (2023-12-07)

### Updates

* included `app_root` and `execution_concurrency_limit` options in `StackQL` constructor
- included `app_root` and `execution_concurrency_limit` options in `StackQL` constructor

## v3.2.4 (2023-10-24)

### Updates

* implemented non `server_mode` magic extension
* updated dataframe output for statements
* `pandas` type updates
* updated class parameters
* added additional tests
* bin path defaults for codespaces notebooks
- implemented non `server_mode` magic extension
- updated dataframe output for statements
- `pandas` type updates
- updated class parameters
- added additional tests
- bin path defaults for codespaces notebooks

## v3.0.0 (2023-10-11)

### Updates

* added `StackqlMagic` class for `jupyter`, `IPython` integration
* `server_mode` is now used to connect to a `stackql` server process using `pyscopg2`
* added additional tests
- added `StackqlMagic` class for `jupyter`, `IPython` integration
- `server_mode` is now used to connect to a `stackql` server process using `pyscopg2`
- added additional tests

## v2.0.0 (2023-08-15)

### Updates

* added `executeQueriesAsync` stackql class method
- added `executeQueriesAsync` stackql class method

## v1.5.0 (2023-04-04)

### Updates

* added `server_mode` to run a background stackql server process
- added `server_mode` to run a background stackql server process

## v1.0.2 (2023-02-23)

### Updates

* enabled custom `download_dir` argument
- enabled custom `download_dir` argument

## v1.0.1 (2023-02-23)

### Minor updates

* updated `setup.py`
- updated `setup.py`

## v1.0.0 (2023-02-22)

### Refactor

* refactored package
* added support for `kwargs` for the `StackQL` constructor
* added `setup.py`
* added `docs` using `sphinx`
* added additional tests
- refactored package
- added support for `kwargs` for the `StackQL` constructor
- added `setup.py`
- added `docs` using `sphinx`
- added additional tests

## v0.9.0 (2022-06-06)

### Bug Fixes

* added exception handling
- added exception handling

## v0.5.0 (2022-06-03)

### Bug Fixes

* added local registry support
* updated docs
- added local registry support
- updated docs

## v0.4.1 (2022-05-31)

### Bug Fixes

* added `str` handling
* updated docs
- added `str` handling
- updated docs

## v0.4.0 (2022-02-08)

### Updates

* updated `version` output
* updated docs
- updated `version` output
- updated docs

## v0.3.0 (2022-02-07)

### Initial release as `pystackql`

* added `auth` switch
* converted `byte` output to `str`
- added `auth` switch
- converted `byte` output to `str`

## v0.2.0 (2021-07-19)

### Updates to `pyinfraql`

* added `version` method
* updates to accept `None` for arguments
* updated docs
- added `version` method
- updates to accept `None` for arguments
- updated docs

## v0.1.1 (2021-07-16)

### Updates to `pyinfraql`

* added `dbfilepath` argument
- added `dbfilepath` argument

## v0.1.0 (2021-02-15)

### Initial Release (as `pyinfraql`)

* class constructor for `pyinfraql`
* support for `google` provider
* support for integration with `pandas`, `matplotlib` and `jupyter`
- class constructor for `pyinfraql`
- support for `google` provider
- support for integration with `pandas`, `matplotlib` and `jupyter`
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '3.6.4'
release = 'v3.6.5'


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -158,4 +158,4 @@
]


# -- Extension configuration -------------------------------------------------
# -- Extension configuration -------------------------------------------------
41 changes: 22 additions & 19 deletions pystackql/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,28 @@ def _download_file(url, path, showprogress=True):
exit(1)

def _setup(download_dir, platform, showprogress=False):
print('installing stackql...')
try:
binary_name = _get_binary_name(platform)
url = _get_url()
print("downloading latest version of stackql from %s to %s" % (url, download_dir))
archive_file_name = os.path.join(download_dir, os.path.basename(url))
_download_file(url, archive_file_name, showprogress)
if platform == 'Darwin':
unpacked_file_name = os.path.join(download_dir, 'stackql')
command = 'pkgutil --expand-full {} {}'.format(archive_file_name, unpacked_file_name)
os.system(command)
else:
with zipfile.ZipFile(archive_file_name, 'r') as zip_ref:
zip_ref.extractall(download_dir)

os.chmod(os.path.join(download_dir, binary_name), 0o755)
except Exception as e:
print("ERROR: [_setup] %s" % (str(e)))
exit(1)
try:
print('installing stackql...')
binary_name = _get_binary_name(platform)
url = _get_url()
print("downloading latest version of stackql from %s to %s" % (url, download_dir))
archive_file_name = os.path.join(download_dir, os.path.basename(url))
_download_file(url, archive_file_name, showprogress)
# if Platform is starting with Darwin, then it is a MacOS
if platform.startswith('Darwin'):
unpacked_file_name = os.path.join(download_dir, 'stackql')
command = 'pkgutil --expand-full {} {}'.format(archive_file_name, unpacked_file_name)
# if there are files in unpacked_file_name, then remove them
if os.path.exists(unpacked_file_name):
os.system('rm -rf {}'.format(unpacked_file_name))
os.system(command)
else:
with zipfile.ZipFile(archive_file_name, 'r') as zip_ref:
zip_ref.extractall(download_dir)
os.chmod(os.path.join(download_dir, binary_name), 0o755)
except Exception as e:
print("ERROR: [_setup] %s" % (str(e)))
exit(1)

def _get_version(bin_path):
try:
Expand Down
3 changes: 1 addition & 2 deletions run_tests
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#!/bin/bash
. tests/creds/env_vars/test.env
python3 -m tests.pystackql_tests
python3 -m tests.pystackql_tests
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='pystackql',
version='3.6.4',
version='v3.6.5',
description='A Python interface for StackQL',
long_description=readme,
author='Jeffrey Aven',
Expand Down Expand Up @@ -41,4 +41,4 @@
'Programming Language :: Python :: 3.12',
'License :: OSI Approved :: MIT License',
]
)
)
Loading

0 comments on commit efaaea2

Please sign in to comment.