Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 5186769
Author: David Meyer <[email protected]>
Date:   Wed Apr 12 19:43:11 2023 -0400

    Update python version support

commit e508fcd
Merge: 5e3603d 514e7d2
Author: David Meyer <[email protected]>
Date:   Wed Apr 12 19:38:50 2023 -0400

    Merge pull request #98 from labscript-suite/qt-float-fix

    Only pass ints to self.ui.move

commit 5e3603d
Merge: fb8bcd9 79119b9
Author: David Meyer <[email protected]>
Date:   Wed Apr 12 16:56:39 2023 -0400

    Merge pull request #99 from dihm/update-workflow

    Sync workflow with current state of the art

commit 79119b9
Author: David Meyer <[email protected]>
Date:   Wed Apr 12 16:44:29 2023 -0400

    Sync workflow with current state of the art

commit 514e7d2
Author: chrisjbillington <[email protected]>
Date:   Sat Apr 8 21:11:43 2023 +1000

    Only pass ints to self.ui.move

    as floats to QWidget.move are depreceated and raise an exception.

    Also update the log line to print the full exception for easier
    detection of issues in the future.

commit fb8bcd9
Merge: 6f7a653 2e6d140
Author: David Meyer <[email protected]>
Date:   Tue Jan 3 12:07:48 2023 -0500

    Merge pull request #91 from labscript-suite/ipv6-remotes

    Correctly parse ipv6 host:port for remote workers

commit 6f7a653
Merge: 75ef861 cb87bc7
Author: David Meyer <[email protected]>
Date:   Fri Aug 5 16:45:25 2022 -0400

    Merge pull request #96 from dihm/update-workflow

    Bring workflow up to date with sandbox

commit cb87bc7
Author: David Meyer <[email protected]>
Date:   Wed Aug 3 13:24:26 2022 -0400

    Bring workflow up to date with sandbox

commit 75ef861
Merge: 8551005 029c3b6
Author: David Meyer <[email protected]>
Date:   Thu Jun 2 10:52:25 2022 -0400

    Merge pull request #95 from dihm/fix_docs_build

    Bump sphinx version and update intersphinx links

commit 029c3b6
Author: David Meyer <[email protected]>
Date:   Thu Jun 2 10:38:46 2022 -0400

    Bump sphinx version and update intersphinx links

commit 8551005
Merge: 84731bb cea8ca1
Author: Chris Billington <[email protected]>
Date:   Sun May 1 22:44:25 2022 +1000

    Merge pull request #93 from dihm/datetime

    Upgrade 'run time' to datetime timestamp.

commit cea8ca1
Author: David Meyer <[email protected]>
Date:   Sat Apr 30 02:09:32 2022 -0400

    Upgrade 'run time' to datetime timestamp.

    This gives the saved 'run time' resolution better than 1 second.

commit 2e6d140
Author: chrisjbillington <[email protected]>
Date:   Sat Jan 29 12:58:52 2022 +1100

    Correctly parse ipv6 host:port for remote workers

    IPv6 addresses contain colons, so we need to split only on the last
    colon.

    Zprocess currently has ipv6 disabled by default, but it will be enabled
    in the next release.
  • Loading branch information
dihm committed Apr 13, 2023
1 parent 84731bb commit 7e49ae2
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 112 deletions.
186 changes: 84 additions & 102 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ on:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

defaults:
run:
shell: bash

env:
PACKAGE_NAME: blacs
SCM_LOCAL_SCHEME: no-local-version
Expand Down Expand Up @@ -41,26 +37,34 @@ jobs:
strategy:
matrix:
include:
- { os: ubuntu-latest, python: 3.8, arch: x64 }
# - { os: ubuntu-latest, python: 3.7, arch: x64 }
# - { os: ubuntu-latest, python: 3.6, arch: x64 }

# - { os: macos-latest, python: 3.8, arch: x64 }
# - { os: macos-latest, python: 3.7, arch: x64 }
# - { os: macos-latest, python: 3.6, arch: x64 }

# - { os: windows-latest, python: 3.8, arch: x64 }
# - { os: windows-latest, python: 3.7, arch: x64 }
# - { os: windows-latest, python: 3.6, arch: x64 }

# - { os: windows-latest, python: 3.8, arch: x86 }
# - { os: windows-latest, python: 3.7, arch: x86 }
# - { os: windows-latest, python: 3.6, arch: x86 }
- { os: ubuntu-latest, python: '3.11', arch: x64, conda: true}
# - { os: ubuntu-latest, python: '3.10', arch: x64, conda: true }
# - { os: ubuntu-latest, python: '3.9', arch: x64, conda: true }
# - { os: ubuntu-latest, python: '3.8', arch: x64, conda: true }
# - { os: ubuntu-latest, python: '3.7', arch: x64, conda: true }

# - { os: macos-11, python: '3.11', arch: x64, conda: true }
# - { os: macos-11, python: '3.10', arch: x64, conda: true }
# - { os: macos-11, python: '3.9', arch: x64, conda: true }
# - { os: macos-11, python: '3.8', arch: x64, conda: true }
# - { os: macos-11, python: '3.7', arch: x64, conda: true }

# - { os: windows-latest, python: '3.11', arch: x64, conda: true }
# - { os: windows-latest, python: '3.10', arch: x64, conda: true }
# - { os: windows-latest, python: '3.9', arch: x64, conda: true }
# - { os: windows-latest, python: '3.8', arch: x64, conda: true }
# - { os: windows-latest, python: '3.7', arch: x64, conda: true }

# - { os: windows-latest, python: '3.11', arch: x86, conda: false } # conda not yet available
# - { os: windows-latest, python: '3.10', arch: x86, conda: true }
# - { os: windows-latest, python: '3.9', arch: x86, conda: true }
# - { os: windows-latest, python: '3.8', arch: x86, conda: true }
# - { os: windows-latest, python: '3.7', arch: x86, conda: true }

if: github.repository == 'labscript-suite/blacs' && (github.event_name != 'create' || github.event.ref_type != 'branch')
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -69,80 +73,74 @@ jobs:
run: git tag -d $(git tag --points-at HEAD)

- name: Install Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.arch }}

- name: Source Distribution
if: strategy.job-index == 0
run: |
python -m pip install --upgrade pip setuptools wheel pep517
python -m pep517.build -s .
python -m pip install --upgrade pip setuptools wheel build
python -m build -s .
- name: Wheel Distribution
# Impure Linux wheels are built in the manylinux job.
if: (env.PURE == 'true' && strategy.job-index == 0) || (env.PURE == 'false' && runner.os != 'Linux')
run: |
python -m pip install --upgrade pip setuptools wheel pep517
python -m pep517.build -b .
python -m pip install --upgrade pip setuptools wheel build
python -m build -w .
- name: Upload Artifact
if: strategy.job-index == 0 || (env.PURE == 'false' && runner.os != 'Linux')
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: dist
path: ./dist

- name: Set Variables for Conda Build
if: matrix.conda
shell: bash
run: |
if [ $RUNNER_OS == Windows ] && [ ${{ matrix.arch }} == x64 ]; then
CONDA_INSTALLER=Miniconda3-latest-Windows-x86_64.exe
elif [ $RUNNER_OS == Windows ]; then
CONDA_INSTALLER=Miniconda3-latest-Windows-x86.exe
elif [ $RUNNER_OS == Linux ]; then
CONDA_INSTALLER=Miniconda3-latest-Linux-x86_64.sh
else
CONDA_INSTALLER=Miniconda3-latest-MacOSX-x86_64.sh
fi
if [ $NOARCH == true ]; then
CONDA_BUILD_ARGS="--noarch"
else
CONDA_BUILD_ARGS=""
fi
echo "CONDA_INSTALLER=$CONDA_INSTALLER" >> $GITHUB_ENV
echo "CONDA_BUILD_ARGS=$CONDA_BUILD_ARGS" >> $GITHUB_ENV
- name: Install Miniconda
if: matrix.conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python }}
architecture: ${{ matrix.arch }}
miniconda-version: "latest"

- name: Workaround conda-build incompatibility with xcode 12+
if: runner.os == 'macOS'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 11.7

- name: Conda package (Unix)
if: runner.os != 'Windows'
if: (matrix.conda && runner.os != 'Windows')
shell: bash -l {0}
run: |
curl -LO https://repo.continuum.io/miniconda/$CONDA_INSTALLER
bash "$CONDA_INSTALLER" -b -p .miniconda
source .miniconda/etc/profile.d/conda.sh
conda activate
conda update -n base -c defaults conda
conda create -n py${{ matrix.python }} python=${{ matrix.python }}
conda activate py${{ matrix.python }}
conda install -c cbillington setuptools-conda
pip install --upgrade setuptools_scm
conda install -c labscript-suite setuptools-conda
setuptools-conda build $CONDA_BUILD_ARGS .
- name: Conda Package (Windows)
if: runner.os == 'Windows'
shell: cmd
if: (matrix.conda && runner.os == 'Windows')
shell: cmd /C CALL {0}
run: |
curl -LO https://repo.continuum.io/miniconda/%CONDA_INSTALLER%
%CONDA_INSTALLER% /S /D=%CD%\.miniconda && ^
.miniconda\Scripts\activate && ^
conda update -n base -c defaults conda && ^
conda create -n py${{ matrix.python }} python=${{ matrix.python }} && ^
conda activate py${{ matrix.python }} && ^
conda install -c cbillington setuptools-conda && ^
pip install --upgrade setuptools_scm && ^
setuptools-conda build %CONDA_BUILD_ARGS% .
conda install -c labscript-suite setuptools-conda && ^
setuptools-conda build %CONDA_BUILD_ARGS% --croot ${{ runner.temp }}\cb .
- name: Upload Artifact
uses: actions/upload-artifact@v2
if: matrix.conda
uses: actions/upload-artifact@v3
with:
name: conda_packages
path: ./conda_packages
Expand All @@ -151,16 +149,11 @@ jobs:
manylinux:
name: Build Manylinux
runs-on: ubuntu-latest
strategy:
matrix:
include:
- { python: 'cp36-cp36m cp37-cp37m cp38-cp38' }

if: github.repository == 'labscript-suite/blacs' && (github.event_name != 'create' || github.event.ref_type != 'branch')
steps:
- name: Checkout
if: env.PURE == 'false'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -170,16 +163,17 @@ jobs:

- name: Build Manylinux Wheels
if: env.PURE == 'false'
uses: RalfG/python-wheels-manylinux-build@v0.2.2-manylinux2010_x86_64
uses: RalfG/python-wheels-manylinux-build@v0.4.2
with:
python-versions: ${{ matrix.python }}
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
pre-build-command: 'git config --global --add safe.directory "*"'

- name: Upload Artifact
if: env.PURE == 'false'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: dist
path: wheelhouse/*manylinux*.whl
path: dist/*manylinux*.whl

release:
name: Release
Expand All @@ -188,73 +182,62 @@ jobs:
steps:

- name: Download Artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: dist
path: ./dist

- name: Download Artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: conda_packages
path: ./conda_packages

- name: Publish on TestPyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.testpypi }}
repository_url: https://test.pypi.org/legacy/

- name: Get Version Number
if: github.event.ref_type == 'tag'
run: |
VERSION="${GITHUB_REF/refs\/tags\/v/}"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create GitHub Release
- name: Create GitHub Release and Upload Release Asset
if: github.event.ref_type == 'tag'
id: create_release
uses: actions/create-release@latest
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.ref }}
release_name: ${{ env.PACKAGE_NAME }} ${{ env.VERSION }}
name: ${{ env.PACKAGE_NAME }} ${{ env.VERSION }}
draft: true
prerelease: ${{ contains(github.event.ref, 'rc') }}
files: ./dist/${{ env.PACKAGE_NAME }}-${{ env.VERSION }}.tar.gz

- name: Upload Release Asset
if: github.event.ref_type == 'tag'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish on TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/${{ env.PACKAGE_NAME }}-${{ env.VERSION }}.tar.gz
asset_name: ${{ env.PACKAGE_NAME }}-${{ env.VERSION }}.tar.gz
asset_content_type: application/gzip
user: __token__
password: ${{ secrets.testpypi }}
repository-url: https://test.pypi.org/legacy/

- name: Publish on PyPI
if: github.event.ref_type == 'tag'
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi }}

- name: Install Miniconda and cloud client
run: |
curl -LO https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p .miniconda
source .miniconda/etc/profile.d/conda.sh
conda activate
conda install anaconda-client
- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true

- name: Install Anaconda cloud client
shell: bash -l {0}
run: conda install anaconda-client

- name: Publish to Anaconda test label
if: github.event.ref_type != 'tag'
shell: bash -l {0}
run: |
source .miniconda/etc/profile.d/conda.sh
conda activate
anaconda \
--token ${{ secrets.ANACONDA_API_TOKEN }} \
upload \
Expand All @@ -263,10 +246,9 @@ jobs:
conda_packages/*/*
- name: Publish to Anaconda main label
shell: bash -l {0}
if: github.event.ref_type == 'tag'
run: |
source .miniconda/etc/profile.d/conda.sh
conda activate
anaconda \
--token ${{ secrets.ANACONDA_API_TOKEN }} \
upload \
Expand Down
15 changes: 12 additions & 3 deletions blacs/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,17 @@ def restore_window(self,tab_data):
# Actually this is a waste of time because if you close when maximized, reoopen and then
# de-maximize, the window moves to a random position (not the position it was at before maximizing)
# so bleh!
self.ui.move(tab_data['BLACS settings']["window_xpos"]-tab_data['BLACS settings']['window_frame_width']/2,tab_data['BLACS settings']["window_ypos"]-tab_data['BLACS settings']['window_frame_height']+tab_data['BLACS settings']['window_frame_width']/2)
self.ui.resize(tab_data['BLACS settings']["window_width"],tab_data['BLACS settings']["window_height"])
self.ui.move(
tab_data['BLACS settings']["window_xpos"]
- tab_data['BLACS settings']['window_frame_width'] // 2,
tab_data['BLACS settings']["window_ypos"]
- tab_data['BLACS settings']['window_frame_height']
+ tab_data['BLACS settings']['window_frame_width'] // 2,
)
self.ui.resize(
tab_data['BLACS settings']["window_width"],
tab_data['BLACS settings']["window_height"],
)

if 'window_maximized' in tab_data['BLACS settings'] and tab_data['BLACS settings']['window_maximized']:
self.ui.showMaximized()
Expand All @@ -474,7 +483,7 @@ def restore_window(self,tab_data):
pane.setSizes(tab_data['BLACS settings'][pane_name])

except Exception as e:
logger.warning("Unable to load window and notebook defaults. Exception:"+str(e))
logger.exception("Unable to load window and notebook defaults. Exception:"+str(e))

def order_tabs(self,tab_data):
# Move the tabs to the correct notebook
Expand Down
5 changes: 3 additions & 2 deletions blacs/experiment_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import os
import threading
import time
import datetime
import sys
import shutil
from collections import defaultdict
Expand Down Expand Up @@ -722,7 +723,7 @@ def restart_function(device_name):
# A Queue for event-based notification of when the experiment has finished.
experiment_finished_queue = queue.Queue()
logger.debug('About to start the master pseudoclock')
run_time = time.localtime()
run_time = datetime.datetime.now()

##########################################################################################################################################
# Plugin callbacks #
Expand Down Expand Up @@ -850,7 +851,7 @@ def restart_function(device_name):

data_group = hdf5_file['/'].create_group('data')
# stamp with the run time of the experiment
hdf5_file.attrs['run time'] = time.strftime('%Y%m%dT%H%M%S',run_time)
hdf5_file.attrs['run time'] = run_time.strftime('%Y%m%dT%H%M%S.%f')

error_condition = False
response_list = {}
Expand Down
2 changes: 1 addition & 1 deletion blacs/tab_base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def _get_remote_configuration(self):
if remote_server_device.parent.name != PRIMARY_BLACS:
msg = "Multi-hop remote workers not yet supported by BLACS"
raise NotImplementedError(msg)
remote_host, remote_port = remote_server_device.parent_port.split(':')
remote_host, remote_port = remote_server_device.parent_port.rsplit(':', 1)
remote_port = int(remote_port)
return RemoteProcessClient(remote_host, remote_port)
return None
Expand Down
Loading

0 comments on commit 7e49ae2

Please sign in to comment.