Skip to content
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
7 changes: 5 additions & 2 deletions irods/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
from irods import env_filename_from_keyword_args
import irods.exception as ex
from irods.message import ET, XML_Parser_Type, IRODS_VERSION
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the removal of the IRODS_VERSION symbol break client code?

from irods.message import ET, XML_Parser_Type, _IRODS_VERSION
from irods.path import iRODSPath
from irods.session import iRODSSession

Expand Down Expand Up @@ -54,9 +54,12 @@ def make_session(test_server_version=False, **kwargs):

env_file = env_filename_from_keyword_args(kwargs)
session = iRODSSession(irods_env_file=env_file, **kwargs)
# irods.test.helpers version of this function sets test_server_version True by default, so
# that sessions generated for the test methods will abort on connecting with a server that
# is too recent. This is a way to ensure that tests don't fail due to a server mismatch.
if test_server_version:
connected_version = _get_server_version_for_test(session, curtail_length=3)
advertised_version = IRODS_VERSION[:3]
advertised_version = _IRODS_VERSION()[:3]
if connected_version > advertised_version:
msg = (
"Connected server is {connected_version}, "
Expand Down
12 changes: 10 additions & 2 deletions irods/message/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,16 @@ def ET(xml_type=(), server_version=None):

logger = logging.getLogger(__name__)

# Advertised server version compatibility. More recent servers are not guaranteed to work.
# We avail ourselves of this macro in running tests to abort if the session has connected
# to a server that is too new.

# Deprecated. Not for use external to the library.
Comment on lines +184 to +188
Copy link
Contributor

Choose a reason for hiding this comment

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

Are lines 184 to 186 about IRODS_VERSION? If so, let's join them with line 188 so that's clear.

Suggested change
# Advertised server version compatibility. More recent servers are not guaranteed to work.
# We avail ourselves of this macro in running tests to abort if the session has connected
# to a server that is too new.
# Deprecated. Not for use external to the library.
# Advertised server version compatibility. More recent servers are not guaranteed to work.
# We avail ourselves of this macro in running tests to abort if the session has connected
# to a server that is too new.
#
# Deprecated. Not for use external to the library.

Or ...

Suggested change
# Advertised server version compatibility. More recent servers are not guaranteed to work.
# We avail ourselves of this macro in running tests to abort if the session has connected
# to a server that is too new.
# Deprecated. Not for use external to the library.
# Advertised server version compatibility. More recent servers are not guaranteed to work.
# We avail ourselves of this macro in running tests to abort if the session has connected
# to a server that is too new.
# Deprecated. Not for use external to the library.

IRODS_VERSION = (5, 0, 2, "d")
Copy link
Contributor

@korydraughn korydraughn Jan 8, 2026

Choose a reason for hiding this comment

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

Noting here that we cannot remove symbols from the public interface until a major version bump.

Steps:

  • Restore the old symbol for backward compatibility
  • Introduce _IRODS_VERSION as a duplicate of IRODS_VERSION
  • Dependent code must then be updated to use the new symbol
  • Add a comment stating the old symbol is deprecated


def _IRODS_VERSION():
return IRODS_VERSION

UNICODE = str

_METADATA_FIELD_TYPES = {str, UNICODE, bytes}
Expand Down Expand Up @@ -473,8 +481,8 @@ def __init__(self, proxy_user, client_user, application_name=""):
self.connectCnt = 0
self.proxyUser, self.proxyRcatZone = proxy_user
self.clientUser, self.clientRcatZone = client_user
self.relVersion = "rods{}.{}.{}".format(*IRODS_VERSION)
self.apiVersion = "{3}".format(*IRODS_VERSION)
self.relVersion = "rods{}.{}.{}".format(*_IRODS_VERSION())
self.apiVersion = "{3}".format(*_IRODS_VERSION())
self.option = application_name

irodsProt = IntegerProperty()
Expand Down
2 changes: 1 addition & 1 deletion irods/test/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from irods.helpers import (
home_collection,
make_session as _irods_helpers_make_session)
from irods.message import iRODSMessage, IRODS_VERSION
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the removal of the IRODS_VERSION symbol break client code?

from irods.message import iRODSMessage
from irods.password_obfuscation import encode
import irods.rule
from irods.session import iRODSSession
Expand Down