Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use resource_path for datatypes linter #19188

Closed
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
6 changes: 4 additions & 2 deletions lib/galaxy/tool_util/linters/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@
)

# from galaxy import config
from galaxy.tool_util import linters
from galaxy.tool_util.lint import Linter
from galaxy.util import (
listify,
parse_xml,
)
from galaxy.util.resources import resource_path

if TYPE_CHECKING:
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.parser import ToolSource

DATATYPES_CONF = os.path.join(os.path.dirname(__file__), "datatypes_conf.xml.sample")
DATATYPES_CONF = resource_path(linters, "datatypes_conf.xml.sample")


def _parse_datatypes(datatype_conf_path: str) -> Set[str]:
def _parse_datatypes(datatype_conf_path) -> Set[str]:
Copy link
Member

Choose a reason for hiding this comment

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

@bernt-matthias Unfortunately dropping the type annotation here hides issues when datatype_conf_path is processed by galaxy.util.parse_xml() . Do you mind if I open a separate PR that addresses them? I went down a rabbit hole for the last couple of days unfortunately :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mind if I open a separate PR that addresses them?

No at all. Please do so.

I went down a rabbit hole for the last couple of days unfortunately

Good that you found out again.

datatypes = set()
tree = parse_xml(datatype_conf_path)
root = tree.getroot()
Expand Down
Loading