Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 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
ceadbab
DEV-3737 Remove testing line
Aug 11, 2026
97c5375
DEV-3737 Use a more robust set of OS options
Aug 11, 2026
ba2c0c2
DEV-3737 Remove final ambiguous OS
Aug 11, 2026
af0257a
Merge branch 'feaet/DEV-3737_Update_python_and_standardize' into feat…
Aug 11, 2026
73cdce0
DEV-3737 Move project information back to project
Aug 11, 2026
8a60af2
DEV-3737 Isolate issues
Aug 11, 2026
1d2b826
DEV-3737 Try to work with newer setuptools
Aug 11, 2026
b798bc3
DEV-3737 Reduce unneeded libraries
Aug 11, 2026
0e89471
DEV-3737 Remove unneeded packages
Aug 11, 2026
d326913
DEV-3737 Add packages as needed
Aug 11, 2026
ecb0e94
DEV-3737 Improve library usage
Aug 11, 2026
0dec662
DEV-3737 Remove testing line
Aug 11, 2026
af68af5
DEV-3737 Remove unneeded step
Aug 11, 2026
29fda5a
DEV-3737 Clean up command
Aug 11, 2026
0265035
DEV-3737 Add simple network test
Aug 11, 2026
735551b
DEV-3737 Use correct indentation
Aug 11, 2026
b8f4b89
DEV-3737 Remove helpful but unneeded test
Aug 11, 2026
16d595c
DEV-3737 Test moving to gitlab
Aug 12, 2026
cd03bdc
DEV-3737 Reduce load on github while testing
Aug 12, 2026
4396843
DEV-3737 Update code to match very helpful meeting
Aug 13, 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
29 changes: 17 additions & 12 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/**
- feat/DEV-3737_Matrix_update
tags:
- '*'

Expand All @@ -14,15 +15,19 @@ jobs:
strategy:
matrix:
os:
- macos-12
- macos-13
- macos-14
- ubuntu-20.04
- macos-15
- macos-26
- ubuntu-22.04
- windows-2019
- ubuntu-24.04
- windows-2022
- windows-2025
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 +39,17 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
- 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"
UV_INDEX_URL: "https://pypi.org/simple"
run: uv run tox
- 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
1 change: 0 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ include:
- templates/artifacts/python-library.yaml

variables:
LANGUAGE_VERSION: python3.10
PYTHON_MULTIPROCESSING_START_METHOD: "fork"

tox:
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 --no-dev --no-editable

# 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"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8"]
requires = ["setuptools>=80", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Was this something that changed for mac since py38?

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.

I can find stuff online saying this change from fork to spawn for just MacOS happened for python 3.8. I don't know how this wasn't an issue for previous builds using python 3.8 on MacOS, but for the build matrix steps, this was causing issues for testing as part of the build process.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are you seeing a significant reduction in the wait time for this? This increases complexity a bit and I might recommend just going with the 30 sec sleep if we're only saving a couple seconds.

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.

I can tell a difference on my machine when running sleep(30) instead of this loop, but how often does a person run the tests? Maybe taking longer and being less complex would be preferred

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