Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
04f1d61
added support for cmd specific env vars and auth
jeffreyaven Nov 7, 2024
b701c13
added support for cmd specific env vars and auth
jeffreyaven Nov 7, 2024
7ed47cd
added support for cmd specific env vars and auth
jeffreyaven Nov 7, 2024
d10604f
added support for cmd specific env vars and auth
jeffreyaven Nov 7, 2024
4917f27
added support for cmd specific env vars and auth
jeffreyaven Nov 7, 2024
46b74ae
added support for cmd specific env vars and auth
jeffreyaven Nov 7, 2024
7772a07
added support for cmd specific env vars and auth
jeffreyaven Nov 7, 2024
934dc42
added support for cmd specific env vars and auth
jeffreyaven Nov 7, 2024
ef3903a
added support for cmd specific env vars and auth
jeffreyaven Nov 7, 2024
9c650e9
added support for cmd specific env vars and auth
jeffreyaven Nov 7, 2024
aa12b9e
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
6557c5e
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
06ee71a
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
b596ee7
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
47f4a9d
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
c481086
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
2cffd13
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
000d062
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
5307e82
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
bba91a3
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
0f8ff50
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
0208a6d
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
bacc52d
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
7eea2ce
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
413dac0
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
b705e3e
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
5f1c4c2
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
21f10d6
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
0f45d58
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
27b151e
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
d3057aa
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
6193db8
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
c9e33be
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
6d63234
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
35d9c93
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
90faa37
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
17787d2
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
d80a23b
added support for cmd specific env vars and auth
jeffreyaven Nov 8, 2024
e4058ae
v3.7.0
jeffreyaven Nov 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 0 additions & 82 deletions .github/workflows/async_server_tests.yaml.disabled

This file was deleted.

66 changes: 48 additions & 18 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ jobs:
- windows-latest
- macos-latest
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
# - "3.13"
- "3.13"
exclude:
- os: macos-latest
python-version: "3.7"
python-version: "3.8"
runs-on: ${{matrix.os}}
name: 'Run Tests on ${{matrix.os}} with Python ${{matrix.python-version}}'

Expand All @@ -34,28 +33,35 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade pip
if: matrix.os == 'macos-latest'
run: python${{ matrix.python-version }} -m pip install --upgrade pip

- name: Install dependencies from requirements.txt
shell: bash
run: |
python3 -m pip install --upgrade pip
pip install -r requirements.txt

- name: Install psycopg2 for non-Windows OS
if: matrix.os != 'windows-latest'
run: |
pip install psycopg2-binary

# Windows specific
- name: Install psycopg2-binary for Windows
# Windows
- name: Install psycopg
if: matrix.os == 'windows-latest'
run: |
pip install psycopg2-binary
pip install psycopg[binary]
shell: powershell
# End Windows specific
# End Windows

# Linux
- name: Install PostgreSQL dev libraries on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
pip install psycopg
# End Linux

# macOS
- name: Install PostgreSQL dev libraries on macOS
if: matrix.os == 'macos-latest'
run: |
brew install postgresql@14
pip install psycopg
# End macOS

- name: Install pystackql
run: |
Expand All @@ -66,9 +72,33 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}
CUSTOM_STACKQL_GITHUB_USERNAME: ${{ secrets.CUSTOM_STACKQL_GITHUB_USERNAME }}
CUSTOM_STACKQL_GITHUB_PASSWORD: ${{ secrets.CUSTOM_STACKQL_GITHUB_PASSWORD }}
AWS_REGION: ${{ vars.AWS_REGION }}
AWS_REGIONS: ${{ vars.AWS_REGIONS }}
GCP_PROJECT: ${{ vars.GCP_PROJECT }}
GCP_ZONE: ${{ vars.GCP_ZONE }}
run: |
python3 -m tests.pystackql_tests
shell: bash
if: matrix.os != 'windows-latest'

- name: Run tests on Windows
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
STACKQL_GITHUB_USERNAME: ${{ secrets.STACKQL_GITHUB_USERNAME }}
STACKQL_GITHUB_PASSWORD: ${{ secrets.STACKQL_GITHUB_PASSWORD }}
CUSTOM_STACKQL_GITHUB_USERNAME: ${{ secrets.CUSTOM_STACKQL_GITHUB_USERNAME }}
CUSTOM_STACKQL_GITHUB_PASSWORD: ${{ secrets.CUSTOM_STACKQL_GITHUB_PASSWORD }}
AWS_REGION: ${{ vars.AWS_REGION }}
AWS_REGIONS: ${{ vars.AWS_REGIONS }}
GCP_PROJECT: ${{ vars.GCP_PROJECT }}
GCP_ZONE: ${{ vars.GCP_ZONE }}
GCP_ZONE: ${{ vars.GCP_ZONE }}
run: |
python3 -m tests.pystackql_tests
python3 -m tests.pystackql_tests
shell: pwsh
if: matrix.os == 'windows-latest'
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v3.7.0 (2024-11-08)

### Updates

- Added support for setting command specific environment variables (`env_vars` and `custom_auth`) in `execute` and `executeStmt`.
- Upgraded to use `psycopg`

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

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Before testing, ensure you have all the required packages installed:
::

pip install -r requirements.txt
pip install psycopg2-binary
pip install psycopg

Once the dependencies are installed, you can run the tests using the provided script:

Expand Down
1 change: 0 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
sphinx_rtd_theme
psycopg2
pandas
requests
IPython
2 changes: 1 addition & 1 deletion 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 = 'v3.6.5'
release = 'v3.6.6'


# -- General configuration ---------------------------------------------------
Expand Down
43 changes: 31 additions & 12 deletions pystackql/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def _get_download_dir():
return site.getuserbase()

def _get_binary_name(platform):
if platform == 'Windows':
if platform.startswith('Windows'):
return r'stackql.exe'
elif platform == 'Darwin':
elif platform.startswith('Darwin'):
return r'stackql/Payload/stackql'
else:
return r'stackql'
Expand Down Expand Up @@ -82,25 +82,44 @@ def _download_file(url, path, showprogress=True):
def _setup(download_dir, platform, showprogress=False):
try:
print('installing stackql...')
binary_name = _get_binary_name(platform)
binary_name = _get_binary_name(platform) # Should return 'stackql.exe' for Windows
url = _get_url()
print("downloading latest version of stackql from %s to %s" % (url, download_dir))
print(f"Downloading latest version of stackql from {url} to {download_dir}")

# Paths
archive_file_name = os.path.join(download_dir, os.path.basename(url))
binary_path = os.path.join(download_dir, binary_name)

# Download and extract
_download_file(url, archive_file_name, showprogress)
# if Platform is starting with Darwin, then it is a MacOS

# Handle extraction
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
command = f'pkgutil --expand-full {archive_file_name} {unpacked_file_name}'
if os.path.exists(unpacked_file_name):
os.system('rm -rf {}'.format(unpacked_file_name))
os.system(f'rm -rf {unpacked_file_name}')
os.system(command)
else:

else: # Handle Windows and Linux
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)
zip_ref.extractall(download_dir)

# Specific check for Windows to ensure `stackql.exe` is extracted
if platform.startswith("Windows"):
if not os.path.exists(binary_path) and os.path.exists(os.path.join(download_dir, "stackql")):
os.rename(os.path.join(download_dir, "stackql"), binary_path)

# Confirm binary presence and set permissions
if os.path.exists(binary_path):
print(f"StackQL executable successfully located at: {binary_path}")
os.chmod(binary_path, 0o755)
else:
print(f"ERROR: Expected binary '{binary_path}' not found after extraction.")
exit(1)

except Exception as e:
print("ERROR: [_setup] %s" % (str(e)))
print(f"ERROR: [_setup] {str(e)}")
exit(1)

def _get_version(bin_path):
Expand Down
Loading