@@ -154,19 +154,16 @@ def __init__(
154154 host : Optional [str ] = os .getenv ("CRYOSPARC_MASTER_HOSTNAME" ),
155155 base_port : Union [int , str , None ] = os .getenv ("CRYOSPARC_BASE_PORT" ),
156156 email : Optional [str ] = os .getenv ("CRYOSPARC_EMAIL" ),
157- license : Optional [str ] = os .getenv ("CRYOSPARC_LICENSE_ID" ),
158157 password : Optional [str ] = os .getenv ("CRYOSPARC_PASSWORD" ),
158+ license : Optional [str ] = None ,
159159 timeout : int = 300 ,
160160 ):
161161 if license :
162162 warnings .warn (
163- "Support for license argument and CRYOSPARC_LICENSE_ID environment variable "
164- "will be removed in a future release" ,
163+ "Support for license argument will be removed in a future release" ,
165164 DeprecationWarning ,
166165 stacklevel = 2 ,
167166 )
168- if not LICENSE_REGEX .fullmatch (license ):
169- raise ValueError (f"Invalid CryoSPARC license ID { license } " )
170167
171168 if host and base_port :
172169 if base_url :
@@ -180,15 +177,15 @@ def __init__(
180177 auth = None
181178 if email and password :
182179 auth = (email , sha256 (password .encode ()).hexdigest ())
183- elif license :
184- auth = ("cryosparc" , sha256 (license .encode ()).hexdigest ())
185180 elif session := InstanceAuthSessions .load ().find (self .base_url , email ):
186181 auth = session .token .access_token
182+ elif license :
183+ auth = ("cryosparc" , sha256 (license .encode ()).hexdigest ())
187184 else :
188185 raise ValueError (
189186 f"CryoSPARC authentication not provided or expired for { self .base_url } . "
190187 "If required, create a new session with command\n \n "
191- " python -m cryosparc.tools login\n \n "
188+ " python3 -m cryosparc.tools login\n \n "
192189 "Please see documentation at https://tools.cryosparc.com for instructions."
193190 )
194191
0 commit comments