Skip to content

remoce unnecessary imports #421

remoce unnecessary imports

remoce unnecessary imports #421

############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 for python3
#
# written in python3, (c) 2019-2024 by mworion
# Licence APL2.0
#
###########################################################
name: test_scripts_packages
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
gh: 'https://github.com/mworion/InstallerMW4/main/support/'
wid: 'mw4/gui/widgets/'
uic: 'pyside6-uic'
ucc: 'pyside6-rcc'
res: 'mw4/resource/'
version: '-v 4.0.0a10'
on:
push:
# Run this action on the trigger event when specific files are touched
paths:
- 'setup.py'
- 'support/**'
- '.github/workflows/test_scripts_packages.yml'
jobs:
build_widgets_resource:
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-python-environment
with:
path: ~/.env
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: build_widgets_resource
run: |
python -m pip install PySide6
${{env.uic}} ${{env.wid}}devicePopup.ui -o ${{env.wid}}devicePopup_ui.py
${{env.uic}} ${{env.wid}}downloadPopup.ui -o ${{env.wid}}downloadPopup_ui.py
${{env.uic}} ${{env.wid}}uploadPopup.ui -o ${{env.wid}}uploadPopup_ui.py
${{env.uic}} ${{env.wid}}hemisphere.ui -o ${{env.wid}}hemisphere_ui.py
${{env.uic}} ${{env.wid}}image.ui -o ${{env.wid}}image_ui.py
${{env.uic}} ${{env.wid}}keypad.ui -o ${{env.wid}}keypad_ui.py
${{env.uic}} ${{env.wid}}main.ui -o ${{env.wid}}main_ui.py
${{env.uic}} ${{env.wid}}measure.ui -o ${{env.wid}}measure_ui.py
${{env.uic}} ${{env.wid}}message.ui -o ${{env.wid}}message_ui.py
${{env.uic}} ${{env.wid}}satellite.ui -o ${{env.wid}}satellite_ui.py
${{env.uic}} ${{env.wid}}analyse.ui -o ${{env.wid}}analyse_ui.py
${{env.uic}} ${{env.wid}}simulator.ui -o ${{env.wid}}simulator_ui.py
# ${{env.uic}} ${{env.wid}}material.ui -o ${{env.wid}}material_ui.py
${{env.ucc}} ${{env.res}}resources.qrc -o ${{env.res}}resources.py
- name: build_package
run: |
python -m pip install setuptools wheel
python setup.py sdist
mv dist/mountwizzard4*.* dist/mountwizzard4.tar.gz
- name: upload_package
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
install_package_windows:
needs: [build_widgets_resource]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
python-version: [ '3.9', '3.12' ]
steps:
- uses: actions/checkout@v4
- name: setup_python_windows ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Install Script Install
uses: suisei-cn/actions-download-file@v1.6.0
with:
url: ${{ env.gh }}startup.pyz ${{ env.version }}
target: dist/
- name: MountWizzard4 Install
shell: cmd
run: |
cd dist
python startup.pyz --no-start ${{ env.version }}
dir
- name: Run MountWizzard4
shell: cmd
run: |
cd dist
touch test.run
python startup.pyz
dir
install_package_ubuntu:
needs: [build_widgets_resource]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
python-version: [ '3.9', '3.12' ]
steps:
- uses: actions/checkout@v4
- name: setup_python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Install Head
run: |
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install -y xvfb libxkbcommon-x11-0 x11-utils libxcb-icccm4
sudo apt-get install -y libxcb-image0 libxcb-keysyms1 libxcb-randr0
sudo apt-get install -y libxcb-render-util0 libpulse-mainloop-glib0
sudo apt-get install -y libx11-xcb1 libxcb-xinerama0 libxcb-xkb1
sudo apt-get install -y libxcb-keysyms1 ffmpeg libsm6 libxext6
sudo apt-get install -y libxcb-cursor0 libegl1-mesa
- name: Install Script Run
uses: suisei-cn/actions-download-file@v1.6.0
with:
url: ${{ env.gh }}startup.pyz
target: dist/
- name: MountWizzard4 Install
run: |
cd dist
python startup.pyz --no-start ${{ env.version }}
ls -la
- name: Run MountWizzard4
run: |
cd dist
touch test.run
xvfb-run python3 startup.pyz ${{ env.version }}
ls -la
install_package_macOS:
needs: [build_widgets_resource]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13, macos-latest]
python-version: [ '3.9', '3.12' ]
steps:
- uses: actions/checkout@v4
- name: setup_python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Install Script Run
uses: suisei-cn/actions-download-file@v1.6.0
with:
url: ${{ env.gh }}startup.pyz
target: dist/
- name: MountWizzard4 Install
run: |
cd dist
python startup.pyz --no-start ${{ env.version }}
ls -la