Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UI and connect to constructor manager API #63

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
104 changes: 79 additions & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,106 @@ on:
- main
paths:
- 'constructor-manager/**'
- 'constructor-manager-cli/**'
- 'constructor-manager-api/**'
- 'constructor-manager-ui/**'
workflow_dispatch:

jobs:
test:
name: ${{ matrix.platform }} py${{ matrix.python-version }}
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10']

env:
DISPLAY: ':99.0'
steps:
- name: Install OS dependencies
if: contains(matrix.platform, 'ubuntu')
run: |
sudo apt-get update --fix-missing
sudo apt install xvfb

- uses: tlambert03/setup-qt-libs@v1

- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: "constructor-manager"
python-version: ${{ matrix.python-version }}
auto-activate-base: true
run-post: false

- name: Install dependencies constructor-manager-cli
- name: Install dependencies on base environment
run: |
python -m pip install --upgrade pip
python -m pip install setuptools tox tox-gh-actions
cd constructor-manager-cli
pip install -e .
pip list
conda install -n base conda-lock mamba -c conda-forge --quiet
conda list

- name: Test constructor-manager-cli
- name: create constructor-manager-environment
run: |
cd constructor-manager-cli
python -m tox
env:
PLATFORM: ${{ matrix.platform }}
conda install -n constructor-manager conda packaging requests pyyaml -c conda-forge --quiet
# List installed packages
conda list

- name: Install dependencies constructor-manager
- name: Install constructor-manager
run: |
cd constructor-manager-cli
pip install -e .
pip list
env:
PLATFORM: ${{ matrix.platform }}
# Install constructor manager
git clone https://github.com/goanpeca/packaging.git packaging_clone
cd packaging_clone
git checkout constructor-updater
cd constructor-manager
pip install -e . --no-deps

- name: Test constructor-manager
# Install test deps
conda install -n constructor-manager pytest pytest-cov pytest-qt -c conda-forge --quiet

# List installed packages
conda list

- name: Install constructor-manager-api
run: |
cd constructor-manager
python -m tox
env:
PLATFORM: ${{ matrix.platform }}
# Install dependencies
conda install -n constructor-manager qtpy pyqt -c conda-forge --quiet

# Install constructor manager
cd packaging_clone
git checkout constructor-cli
cd constructor-manager-api
pip install -e . --no-deps

# List installed packages
conda list

- name: Install constructor-manager-ui
run: |
# Install constructor manager ui
cd constructor-manager-ui
pip install -e . --no-deps

# List installed packages
conda list

- name: List installed packages
run: |
conda list

- name: Test constructor-manager-ui (linux)
if: contains(matrix.platform, 'ubuntu')
run: |
# Run Tests
cd constructor-manager-ui/src
xvfb-run pytest constructor_manager_ui --cov=constructor_manager_ui

- name: Test constructor-manager-ui (other)
if: "!contains(matrix.platform, 'ubuntu')"
run: |
# Run Tests
cd constructor-manager-ui/src
pytest constructor_manager_ui --cov=constructor_manager_ui
Comment on lines +102 to +114
Copy link
Member

Choose a reason for hiding this comment

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

I guess the UI part will not use tox for the tests on the CI? Should the tox.ini file be removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, since all the workflow for these packages revolves around constructor using a base environment and a constructor-manager environment, tox does not help a lot. Will remove!

50 changes: 0 additions & 50 deletions .github/workflows/tests_ui.yml

This file was deleted.

9 changes: 9 additions & 0 deletions constructor-manager-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,12 @@ constructor-manager-ui-qrc
```

You need to have pyqt5 installed.

### Example commands

```bash
constructor-manager-ui napari --current-version 0.4.16 --build-string pyside --plugins-url https://api.napari-hub.org/plugins --channel conda-forge
constructor-manager-ui napari --build-string pyside --plugins-url https://api.napari-hub.org/plugins --channel conda-forge --channel napari
constructor-manager-ui napari --build-string pyside --plugins-url https://api.napari-hub.org/plugins --channel conda-forge --channel napari --dev
constructor-manager-ui napari --build-string pyside --plugins-url https://api.napari-hub.org/plugins --channel conda-forge --channel napari -cv 0.4.17
```
2 changes: 1 addition & 1 deletion constructor-manager-ui/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ where = src

[options.entry_points]
console_scripts =
constructor-manager-ui = constructor_manager_ui.cli:run
constructor-manager-ui = constructor_manager_ui.main:run
constructor-manager-ui-qrc = constructor_manager_ui.style.utils:generate_resource_file

[options.extras_require]
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
"""Constructor manager."""
40 changes: 32 additions & 8 deletions constructor-manager-ui/src/constructor_manager_ui/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,39 @@

import argparse

from constructor_manager_ui.main import main


def run():
def create_parser():
parser = argparse.ArgumentParser()
parser.add_argument("package", type=str)
args = parser.parse_args()
main(args.package)


if __name__ == "__main__":
run()
parser.add_argument(
"--current-version",
"-cv",
type=str,
default=None,
)
parser.add_argument(
"--build-string",
help="increase output verbosity",
type=str,
default=None,
)
parser.add_argument(
"--plugins-url",
"-pu",
type=str,
default=None,
)
parser.add_argument(
"--channel",
"-c",
action="append",
default=None,
)
parser.add_argument(
"--log",
default="WARNING",
choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
)
parser.add_argument("--dev", "-d", action="store_true")
return parser
Loading