Skip to content

Commit efaaea2

Browse files
authored
Merge pull request #45 from derek10cloud/improve-macos-compatibility
fix: Enhance platform check for stackql installation(macOS)
2 parents e8d749a + e97e7d7 commit efaaea2

File tree

7 files changed

+124
-90
lines changed

7 files changed

+124
-90
lines changed

CHANGELOG.md

Lines changed: 52 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,173 @@
11
# Changelog
22

3+
## v3.6.5 (2024-09-19)
4+
5+
### Bug Fixes
6+
7+
- Fix(MacOS): Enhanced platform check for stackql installation
8+
- Fix(Test Code): Removed loading of `test.env` in test execution script and Add mocking logic for `pystackql.StackQL`'s methods.
9+
310
## v3.6.4 (2024-07-17)
411

512
### Updates
613

7-
* added dataflow dependency arguments
14+
- added dataflow dependency arguments
815

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

1118
### Updates
1219

13-
* build updates
20+
- build updates
1421

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

1724
### Updates
1825

19-
* added `rowsaffected` to dict response for `executeStmt`
26+
- added `rowsaffected` to dict response for `executeStmt`
2027

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

2330
### Updates
2431

25-
* modified dict response for `executeStmt`
26-
* modified error response for `execute`, should never return `None`
32+
- modified dict response for `executeStmt`
33+
- modified error response for `execute`, should never return `None`
2734

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

3037
### Updates
3138

32-
* added `suppress_errors` argument to the `execute` function
39+
- added `suppress_errors` argument to the `execute` function
3340

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

3643
### Updates
3744

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

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

4249
### Updates
4350

44-
* added `custom_registry` constructor arg for specifying a non-default registry
51+
- added `custom_registry` constructor arg for specifying a non-default registry
4552

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

4855
### Updates
4956

50-
* included `pandas` and `IPython` install requirements
51-
* optional required import of `psycopg2` only if in `server_mode`
57+
- included `pandas` and `IPython` install requirements
58+
- optional required import of `psycopg2` only if in `server_mode`
5259

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

5562
### Updates
5663

57-
* included `app_root` and `execution_concurrency_limit` options in `StackQL` constructor
64+
- included `app_root` and `execution_concurrency_limit` options in `StackQL` constructor
5865

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

6168
### Updates
6269

63-
* implemented non `server_mode` magic extension
64-
* updated dataframe output for statements
65-
* `pandas` type updates
66-
* updated class parameters
67-
* added additional tests
68-
* bin path defaults for codespaces notebooks
70+
- implemented non `server_mode` magic extension
71+
- updated dataframe output for statements
72+
- `pandas` type updates
73+
- updated class parameters
74+
- added additional tests
75+
- bin path defaults for codespaces notebooks
6976

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

7279
### Updates
7380

74-
* added `StackqlMagic` class for `jupyter`, `IPython` integration
75-
* `server_mode` is now used to connect to a `stackql` server process using `pyscopg2`
76-
* added additional tests
81+
- added `StackqlMagic` class for `jupyter`, `IPython` integration
82+
- `server_mode` is now used to connect to a `stackql` server process using `pyscopg2`
83+
- added additional tests
7784

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

8087
### Updates
8188

82-
* added `executeQueriesAsync` stackql class method
89+
- added `executeQueriesAsync` stackql class method
8390

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

8693
### Updates
8794

88-
* added `server_mode` to run a background stackql server process
95+
- added `server_mode` to run a background stackql server process
8996

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

9299
### Updates
93100

94-
* enabled custom `download_dir` argument
101+
- enabled custom `download_dir` argument
95102

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

98105
### Minor updates
99106

100-
* updated `setup.py`
107+
- updated `setup.py`
101108

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

104111
### Refactor
105112

106-
* refactored package
107-
* added support for `kwargs` for the `StackQL` constructor
108-
* added `setup.py`
109-
* added `docs` using `sphinx`
110-
* added additional tests
113+
- refactored package
114+
- added support for `kwargs` for the `StackQL` constructor
115+
- added `setup.py`
116+
- added `docs` using `sphinx`
117+
- added additional tests
111118

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

114121
### Bug Fixes
115122

116-
* added exception handling
123+
- added exception handling
117124

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

120127
### Bug Fixes
121128

122-
* added local registry support
123-
* updated docs
129+
- added local registry support
130+
- updated docs
124131

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

127134
### Bug Fixes
128135

129-
* added `str` handling
130-
* updated docs
136+
- added `str` handling
137+
- updated docs
131138

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

134141
### Updates
135142

136-
* updated `version` output
137-
* updated docs
143+
- updated `version` output
144+
- updated docs
138145

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

141148
### Initial release as `pystackql`
142149

143-
* added `auth` switch
144-
* converted `byte` output to `str`
150+
- added `auth` switch
151+
- converted `byte` output to `str`
145152

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

148155
### Updates to `pyinfraql`
149156

150-
* added `version` method
151-
* updates to accept `None` for arguments
152-
* updated docs
157+
- added `version` method
158+
- updates to accept `None` for arguments
159+
- updated docs
153160

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

156163
### Updates to `pyinfraql`
157164

158-
* added `dbfilepath` argument
165+
- added `dbfilepath` argument
159166

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

162169
### Initial Release (as `pyinfraql`)
163170

164-
* class constructor for `pyinfraql`
165-
* support for `google` provider
166-
* support for integration with `pandas`, `matplotlib` and `jupyter`
171+
- class constructor for `pyinfraql`
172+
- support for `google` provider
173+
- support for integration with `pandas`, `matplotlib` and `jupyter`

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = ''
2828
# The full version, including alpha/beta/rc tags
29-
release = '3.6.4'
29+
release = 'v3.6.5'
3030

3131

3232
# -- General configuration ---------------------------------------------------
@@ -158,4 +158,4 @@
158158
]
159159

160160

161-
# -- Extension configuration -------------------------------------------------
161+
# -- Extension configuration -------------------------------------------------

pystackql/_util.py

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,28 @@ def _download_file(url, path, showprogress=True):
8080
exit(1)
8181

8282
def _setup(download_dir, platform, showprogress=False):
83-
print('installing stackql...')
84-
try:
85-
binary_name = _get_binary_name(platform)
86-
url = _get_url()
87-
print("downloading latest version of stackql from %s to %s" % (url, download_dir))
88-
archive_file_name = os.path.join(download_dir, os.path.basename(url))
89-
_download_file(url, archive_file_name, showprogress)
90-
if platform == 'Darwin':
91-
unpacked_file_name = os.path.join(download_dir, 'stackql')
92-
command = 'pkgutil --expand-full {} {}'.format(archive_file_name, unpacked_file_name)
93-
os.system(command)
94-
else:
95-
with zipfile.ZipFile(archive_file_name, 'r') as zip_ref:
96-
zip_ref.extractall(download_dir)
97-
98-
os.chmod(os.path.join(download_dir, binary_name), 0o755)
99-
except Exception as e:
100-
print("ERROR: [_setup] %s" % (str(e)))
101-
exit(1)
83+
try:
84+
print('installing stackql...')
85+
binary_name = _get_binary_name(platform)
86+
url = _get_url()
87+
print("downloading latest version of stackql from %s to %s" % (url, download_dir))
88+
archive_file_name = os.path.join(download_dir, os.path.basename(url))
89+
_download_file(url, archive_file_name, showprogress)
90+
# if Platform is starting with Darwin, then it is a MacOS
91+
if platform.startswith('Darwin'):
92+
unpacked_file_name = os.path.join(download_dir, 'stackql')
93+
command = 'pkgutil --expand-full {} {}'.format(archive_file_name, unpacked_file_name)
94+
# if there are files in unpacked_file_name, then remove them
95+
if os.path.exists(unpacked_file_name):
96+
os.system('rm -rf {}'.format(unpacked_file_name))
97+
os.system(command)
98+
else:
99+
with zipfile.ZipFile(archive_file_name, 'r') as zip_ref:
100+
zip_ref.extractall(download_dir)
101+
os.chmod(os.path.join(download_dir, binary_name), 0o755)
102+
except Exception as e:
103+
print("ERROR: [_setup] %s" % (str(e)))
104+
exit(1)
102105

103106
def _get_version(bin_path):
104107
try:

run_tests

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#!/bin/bash
2-
. tests/creds/env_vars/test.env
3-
python3 -m tests.pystackql_tests
2+
python3 -m tests.pystackql_tests

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name='pystackql',
13-
version='3.6.4',
13+
version='v3.6.5',
1414
description='A Python interface for StackQL',
1515
long_description=readme,
1616
author='Jeffrey Aven',
@@ -41,4 +41,4 @@
4141
'Programming Language :: Python :: 3.12',
4242
'License :: OSI Approved :: MIT License',
4343
]
44-
)
44+
)

0 commit comments

Comments
 (0)