Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c43c66f
DEV-3737 testing matrix builds
Aug 10, 2026
a4dc9f3
DEV-3737 more testing of matrix stuff
Aug 10, 2026
09bf43d
DEV-3737 Matrix building is fun (for real)
Aug 10, 2026
6aed7a2
DEV-3737 fix typos
Aug 10, 2026
d3cae07
DEV-3737 Get uv setup before tests
Aug 10, 2026
74214f0
DEV-3737 Deal with pip to uv changes
Aug 10, 2026
2dc9fcd
DEV-3737 Deal with pip to uv changes in a different way
Aug 10, 2026
f5939af
DEV-3737 Use better variable
Aug 10, 2026
c35676b
DEV-3737 Add missing slash
Aug 10, 2026
284c234
DEV-3737 More uv work
Aug 10, 2026
6aacf13
DEV-3737 Another stab at uv
Aug 10, 2026
e844d51
DEV-3737 Pip and uv
Aug 10, 2026
0335997
DEV-3737 More testing
Aug 10, 2026
abb88a3
DEV-3737 Get things there when needed
Aug 10, 2026
ab6aa2b
DEV-3737 Help setuptools find license
Aug 10, 2026
4ce7a3d
DEV-3737 More uv testing
Aug 10, 2026
eb72e7f
DEV-3737 More uv work
Aug 10, 2026
3c39698
DEV-3737 Mac connection work
Aug 10, 2026
b312f1e
DEV-3737 Add more no_proxy
Aug 10, 2026
edad78b
DEV-3737 Work with macos networking changes
Aug 10, 2026
4331cbf
DEV-3737 more value tempering
Aug 10, 2026
0fb80f4
DEV-3737 Write a better waiting loop
Aug 10, 2026
02fedb5
DEV-3737 Fix typo and move more to uv
Aug 10, 2026
347511b
DEV-3737 More uv migration
Aug 10, 2026
de5b35e
DEV-3737 Small change with newer python versions
Aug 10, 2026
9bfd2d5
DEV-3737 Remove possible unneeded changes
Aug 10, 2026
f41166c
DEV-3737 Remove possible unneeded change correctly
Aug 10, 2026
a33a562
DEV-3737 Test another change
Aug 10, 2026
416644a
DEV-3737 Restore changes that were needed
Aug 10, 2026
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
35 changes: 20 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- develop
- release/**
- hotfix/**
- test-ci-matrix-upgrade
tags:
- '*'

Expand All @@ -14,15 +15,15 @@ jobs:
strategy:
matrix:
os:
- macos-12
- macos-13
- macos-14
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
- windows-2022
- macos-latest
- ubuntu-latest
- windows-latest
Comment on lines +18 to +20

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python:
- 3.8
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
env:
GDC_CLIENT_ZIP: 'gdc-client.zip'
steps:
Expand All @@ -34,17 +35,21 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
- name: Install dependencies
run: uv sync --extra dev
env:
UV_DEFAULT_INDEX: https://pypi.org/simple
- name: Run Tests
if: matrix.os != 'windows-latest'
run: |
pip install --upgrade pip
pip install tox
tox -e py
env:
NO_PROXY: "127.0.0.1,localhost"
no proxy: "127.0.0.1,localhost"
run: uv run pytest tests/
- name: Package
run: |
cd bin
pip install virtualenv
. ./package
uv run bash ./package
echo "GDC_CLIENT_ZIP=$GDC_CLIENT_ZIP" >> $GITHUB_ENV
shell: bash
- uses: actions/upload-artifact@v4
Expand Down
75 changes: 11 additions & 64 deletions bin/package
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
#!/usr/bin/env bash

set -euox pipefail

function cleanup() {
# get rid of the virtualenv
echo "Cleaning up"
deactivate
rm -rf "${VENV_NAME:?}/" build/ dist/ include/ local/ share/ gdc-client.spec
}

function compress() {
# this way it's cross platform
local zip_name=$1
Expand All @@ -24,76 +16,35 @@ with ZipFile('${zip_name}', 'w') as z:

while getopts ":d" opt; do
case $opt in
d)
DATE=$(date "+%m_%d_%Y")
;;
\?)
echo "Invalid option: -$OPTARG" >&2
;;
esac
d) DATE=$(date "+%m_%d_%Y") ;;
\?) echo "Invalid option: -$OPTARG" >&2 ;;
esac
done

DATE=${DATE-} # if date is not passed in, default DATE variable to empty string
VENV_NAME="venv"
BINARY_NAME="gdc-client"
VENV_PATH="$VENV_NAME/bin/activate"

case $(uname -s) in
*NT*)
# for use in git bash with all the nice unix utilities
TARGET_ENVIRONMENT="Windows"
BINARY_NAME="gdc-client.exe"

# this works in git bash
alias python="winpty python"

# why does windows have to be so different?
VENV_PATH="$VENV_NAME/Scripts/activate"

# Presumably Python3 is the only `python` in the Windows %PATH% variable
python -m virtualenv "$VENV_NAME"
source "$VENV_PATH"
pip install pywin32
;;
*Linux*)
TARGET_ENVIRONMENT="Ubuntu"
python -m virtualenv "$VENV_NAME" --python=python3
source "$VENV_PATH"
;;
*Darwin*)
TARGET_ENVIRONMENT="OSX"
python -m virtualenv "$VENV_NAME" --python=python3
source "$VENV_PATH"
;;
case "$(uname -s)" in
*NT*) TARGET_ENVIRONMENT="Windows"; BINARY_NAME="gdc-client.exe" ;;
*Linux*) TARGET_ENVIRONMENT="Ubuntu" ;;
*Darwin*) TARGET_ENVIRONMENT="OSX" ;;
*) echo "Unsupported OS"; exit 1 ;;
esac

# setup.py is in previous dir
cd ..

python -m pip install --upgrade pip
python -m pip install --no-deps -r requirements.txt
python -m pip install --no-deps .
uv sync --locked --extra dev

# go back go the ./gdc_client/bin dir
cd bin

echo "Building for ${TARGET_ENVIRONMENT}..."

# Make sure the correct version of pyinstaller and setuptools are installed
pip install -U PyInstaller

# Ran into ModuleNotFoundError: No module named 'pkg_resources.py2_warn' with higher versions of setuptools
pip install --upgrade setuptools

# Get version
VERSION=$(python -c "
VERSION=$(uv run python -c "
import gdc_client.version
print(gdc_client.version.__version__)")

echo "Creating ${TARGET_ENVIRONMENT} package for version ${VERSION}..."

# Create binary
pyinstaller \
uv run --with pyinstaller pyinstaller \
--clean \
--additional-hooks-dir=. \
--noconfirm \
Expand All @@ -118,7 +69,3 @@ ZIP_NAME="$PRE_ZIP_NAME.zip"
echo "The output zip file will be called ${ZIP_NAME}"
compress "$ZIP_NAME" "$BINARY_NAME"
mv "$ZIP_NAME" ..
cd ..

cleanup
export GDC_CLIENT_ZIP="$PRE_ZIP_NAME"
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ dependencies = [
description = "Queue Client Facade: A generalized API that allows for connection to multiple queue implementations."
dynamic = ["version"]
keywords = ["rabbitmq", "depot"]
license-files = ["LICENSE"]
maintainers = [
{name = "GDC Feature Team", email = "gdc_dev_questions-aaaaae2lhsbell56tlvh3upgoq@cdis.slack.com"}
]
Expand Down Expand Up @@ -105,6 +104,9 @@ select = [
[tool.ruff.lint.per-file-ignores]
"**/portability.py" = ["F401"]

[tool.setuptools]
license-files = ["LICENSE"]

[tool.setuptools_scm]
fallback_version = "0.0.0"

Expand Down
2 changes: 1 addition & 1 deletion src/gdc_client/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from importlib_metadata import version
from importlib.metadata import version

__version__ = version("gdc_client")
29 changes: 26 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import hashlib
import hmac
import multiprocessing
import tarfile
import time
import urllib.error
import urllib.request
from collections.abc import Iterable, Mapping
from io import BytesIO
from multiprocessing import Process
from unittest.mock import patch

import boto3
Expand Down Expand Up @@ -141,11 +143,32 @@ def run_mock_server():

@pytest.fixture(scope="class")
def setup_mock_server() -> None:
server = Process(target=run_mock_server)
# MacOS does things differently, so get everyone acting the same way
try:
ctx = multiprocessing.get_context("fork")
server = ctx.Process(target=run_mock_server)
except ValueError:
server = multiprocessing.Process(target=run_mock_server)

server.start()
time.sleep(5) # starting with py38, takes longer for process to start on macOS

# Since py38, a sleep is needed for MacOS. 10 is no longer enough as of py310
# Instead of time.sleep(30), this loop could exit faster.
for _ in range(60):
try:
with urllib.request.urlopen("http://127.0.0.1:5000", timeout=1):
break
# listen for any response, and then stop waiting
except urllib.error.HTTPError:
break
except Exception:
time.sleep(0.5)
else:
raise RuntimeError("Mock server failed to start on 127.0.0.1:5000 in 30 secs.")

yield
server.terminate()
server.join()


@pytest.fixture
Expand Down
Loading