Skip to content

Config property for passing environment variables (see #395)#396

Open
joshmoore wants to merge 1 commit intoome:masterfrom
joshmoore:envvars-issue395
Open

Config property for passing environment variables (see #395)#396
joshmoore wants to merge 1 commit intoome:masterfrom
joshmoore:envvars-issue395

Conversation

@joshmoore
Copy link
Member

Rather than needing to update omero-py each time a new env variable needs passing to a script, this adds the

omero.processor.env_vars

property which can be updated. Likely needs more discussion since possibly this should be an "additional" list.

Rather than needing to update omero-py each time a new env
variable needs passing to a script, this adds the

```
omero.processor.env_vars
```

property which can be updated. Likely needs more discussion
since possibly this should be an "additional" list.
@will-moore
Copy link
Member

Couple of tests failing: e.g.

  _________________________ TestProcess.testEnvironment2 _________________________
  [gw1] linux -- Python 3.10.13 /home/runner/work/omero-py/omero-py/.tox/py310/bin/python
  
  self = <test_processor.TestProcess object at 0x7fd4d746e560>
  
      def testEnvironment2(self):
  >       omero.processor.ProcessI(self.ctx, sys.executable,
                                   self.props(), self.params())
  
  test/unit/scriptstest/test_processor.py:137: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  .tox/py310/lib/python3.10/site-packages/omero/processor.py:141: in __init__
      self.make_env()
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  
  self = object #0 (::omero::grid::Process)
  {
  }
  
      def make_env(self):
  >       variables = self.ctx.get("omero.process.env_vars", None)
  E       AttributeError: 'ServerContext' object has no attribute 'get'
  
  .tox/py310/lib/python3.10/site-packages/omero/processor.py:150: AttributeError

@sbesson sbesson closed this Mar 30, 2025
@sbesson sbesson reopened this Mar 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants