Skip to content

Commit 3b7cf56

Browse files
committed
Merge branch 'master' into 1.5.x-sync
2 parents 87ca49e + def8d01 commit 3b7cf56

File tree

7 files changed

+320
-210
lines changed

7 files changed

+320
-210
lines changed

.github/workflows/2_auto_publish_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
uses: cylc/release-actions/build-python-package@v1
4040

4141
- name: Publish distribution to PyPI
42-
uses: pypa/gh-action-pypi-publish@v1.9.0
42+
uses: pypa/gh-action-pypi-publish@v1.10.3
4343
with:
4444
user: __token__ # uses the API token feature of PyPI - least permissions possible
4545
password: ${{ secrets.PYPI_TOKEN }}

changes.d/619.fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ensure that subprocesses created by Cylc UI Server are cleaned up correctly when the server shuts down.

cylc/uiserver/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# You should have received a copy of the GNU General Public License
1414
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1515

16-
__version__ = "1.5.2.dev"
16+
__version__ = "1.6.0.dev"
1717

1818
import os
1919
from typing import Dict

cylc/uiserver/app.py

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,16 @@
5353
the environment variable ``CYLC_SITE_CONF_PATH``.
5454
"""
5555

56-
from concurrent.futures import ProcessPoolExecutor
5756
import getpass
5857
import os
59-
from pathlib import Path, PurePath
6058
import sys
59+
from concurrent.futures import ProcessPoolExecutor
60+
from pathlib import Path, PurePath
6161
from textwrap import dedent
62-
from typing import List, Optional
62+
from types import SimpleNamespace
63+
from typing import List, Optional, Union
6364

65+
from jupyter_server.extension.application import ExtensionApp
6466
from pkg_resources import parse_version
6567
from tornado import ioloop
6668
from tornado.web import RedirectHandler
@@ -76,9 +78,7 @@
7678
default,
7779
validate,
7880
)
79-
from types import SimpleNamespace
80-
81-
from jupyter_server.extension.application import ExtensionApp
81+
from traitlets.config.loader import LazyConfigValue
8282

8383
from cylc.flow.network.graphql import (
8484
CylcGraphQLBackend, IgnoreFieldMiddleware
@@ -109,6 +109,7 @@
109109
from cylc.uiserver.websockets.tornado import TornadoSubscriptionServer
110110
from cylc.uiserver.workflows_mgr import WorkflowsManager
111111

112+
112113
INFO_FILES_DIR = Path(USER_CONF_ROOT / "info_files")
113114

114115

@@ -549,15 +550,26 @@ def set_sub_server(self):
549550
auth=self.authobj,
550551
)
551552

552-
def set_auth(self):
553+
def set_auth(self) -> Authorization:
553554
"""Create authorization object.
554555
One for the lifetime of the UIServer.
555556
"""
557+
user_auth: Union[LazyConfigValue, dict] = (
558+
self.config.CylcUIServer.user_authorization
559+
)
560+
site_auth: Union[LazyConfigValue, dict] = (
561+
self.config.CylcUIServer.site_authorization
562+
)
563+
if isinstance(user_auth, LazyConfigValue):
564+
user_auth = user_auth.to_dict()
565+
if isinstance(site_auth, LazyConfigValue):
566+
site_auth = site_auth.to_dict()
567+
556568
return Authorization(
557569
getpass.getuser(),
558-
self.config.CylcUIServer.user_authorization,
559-
self.config.CylcUIServer.site_authorization,
560-
self.log
570+
user_auth,
571+
site_auth,
572+
self.log,
561573
)
562574

563575
def initialize_templates(self):

0 commit comments

Comments
 (0)