Skip to content

Commit

Permalink
Merge pull request #180 from scipion-em/devel
Browse files Browse the repository at this point in the history
release 3.3.0
  • Loading branch information
JorMaister authored Nov 24, 2023
2 parents 7bf0cd3 + 1184952 commit ea95ae1
Show file tree
Hide file tree
Showing 9 changed files with 234 additions and 52 deletions.
9 changes: 8 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

V3.3.0
developers:
- Exist code is not masked when running xmipp, relion etc commands
- CommandDef and CondaCommandDef assist in the definition of commands for the binaries
V3.2.0
- Update message is green now
- SCIPION_DONT_INSTALL_BINARIES is used in the plugin manager to initialize "Skip binaries" check box
- Do not raise error when one of the CUDA env vars is not set
v3.1.0
users:
- Fixing an error related with the Plugin Manager when clicking the plugin treeview
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
scipion-em
outdated==0.2.2
typing_extensions
2 changes: 1 addition & 1 deletion scipion/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '3.1.0'
__version__ = '3.3.0'

19 changes: 14 additions & 5 deletions scipion/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"""
Main entry point to scipion. It launches the gui, tests, etc.
"""
import subprocess
import sys
import os
from os.path import join, exists, expanduser, expandvars
Expand Down Expand Up @@ -104,10 +105,9 @@ def runCmd(cmd, args=''):
cmd = '%s %s' % (cmd, args)

os.environ.update(VARS)
# sys.stdout.write(">>>>> %s\n" % cmd)
result = os.system(cmd)
if not -256 < result < 256:
result = 1 # because if not, 256 is confused with 0 !
# result = os.system(cmd)
# Replacement of os.system with subprocess.call(cmd, shell=True)
result = subprocess.call(cmd, shell=True)
sys.exit(result)


Expand Down Expand Up @@ -278,7 +278,16 @@ def main():
from pyworkflow.utils.log import LoggingConfigurator
LoggingConfigurator.setUpGUILogging()
from pyworkflow.apps.pw_project import openProject
arg = sys.argv[2] if mode == MODE_PROJECT else mode

if mode == MODE_PROJECT:
if len(sys.argv)==3:
arg = sys.argv[2]

else:
arg = "list" #TODO, import LIST from pyworkflow.apps.pw_project
else:
arg = mode

openProject(arg)

elif mode == MODE_TESTS or mode == MODE_TEST:
Expand Down
213 changes: 176 additions & 37 deletions scipion/install/funcs.py

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions scipion/install/plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@
from tkinter import *
import threading

from pyworkflow import Config
from pyworkflow.gui.project import ProjectManagerWindow
from pyworkflow.project import MenuConfig
from pyworkflow.gui import *
import pyworkflow.gui.dialog as pwgui
from scipion.install.plugin_funcs import PluginRepository, PluginInfo, NULL_VERSION
from scipion.install.plugin_funcs import PluginRepository, PluginInfo, NULL_VERSION, installBinsDefault

from pyworkflow.utils.properties import *
from pyworkflow.utils import redStr, makeFilePath
Expand Down Expand Up @@ -434,7 +433,7 @@ def _fillToolbar(self, frame):
# Add option to cancel binaries installation
self._col += 1
self.skipBinaries = tk.BooleanVar()
self.skipBinaries.set(False)
self.skipBinaries.set(not installBinsDefault())
installBinsEntry = tk.Checkbutton(frame, variable=self.skipBinaries,
font=getDefaultFont(), text="Skip binaries")
installBinsEntry.grid(row=0, column=self._col, sticky='ew', padx=5)
Expand Down
2 changes: 1 addition & 1 deletion scipion/install/update_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def getPackagesStatus(cls, printAll=True):
if needToUpdate:
outdatedPackages.append((package[0], version))
print(
redStr('The package %s is out of date. Your version is %s, '
greenStr('The package %s is out of date. Your version is %s, '
'the latest is %s.' % (package[0], package[1],
version)))
elif printAll:
Expand Down
11 changes: 7 additions & 4 deletions scipion/scripts/kickoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _onClosing(self):


class KickoffView(tk.Frame):
def __init__(self, parent, windows, template=None, argsList=[],
def __init__(self, parent, windows, template:Template=None, argsList=[],
showScheduleOption=True, schedule=True, showProjectOption=True,
showProject=True, showProjectName=True, **kwargs):

Expand Down Expand Up @@ -282,9 +282,12 @@ def _onReadDataFromTemplateForm(self, e=None):
for field in self.template.params.values():
newValue = self._getValue(field.getTitle())
field.setValue(newValue)
if not field.validate():
errors.append("%s value does not validate. Value: %s, Type: %s"
% (field.getTitle(), field.getValue(),

validationMsg = field.validate()

if validationMsg:
errors.append("%s value does not validate: %s. Value: %s, Type: %s."
% (field.getTitle(), validationMsg, field.getValue(),
field.getType()))

# Do more checks only if there are no previous errors
Expand Down
24 changes: 24 additions & 0 deletions scipion/tests/installation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import unittest
from scipion.install.funcs import CommandDef, CondaCommandDef

class TestCommands(unittest.TestCase):
def test_command_class(self):

myCmd = CommandDef("ls -l", "lolo")\
.append("cd ..", ["one", "two"])\
.append("cd .", sep="?")

self.assertEqual(myCmd.getCommands()[0][0], "ls -l && cd .. ? cd .")
self.assertEqual(myCmd.getCommands()[0][1], ["lolo", "one", "two"])

cmds = CondaCommandDef("modelangelo-3.0")
cmds.create('python=3.9').activate().cd('model-angelo')\
.pipInstall('-r requirements.txt')\
.condaInstall('-y torchvision torchaudio cudatoolkit=11.3 -c pytorch')\
.pipInstall('-e .').touch('../env-installed.txt')

print(cmds.getCommands())


if __name__ == '__main__':
unittest.main()

0 comments on commit ea95ae1

Please sign in to comment.