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

Revise parse_registry_path or add a new function to check if path is a valid registry path #43

Open
donaldcampbelljr opened this issue Mar 19, 2024 · 1 comment

Comments

@donaldcampbelljr
Copy link
Contributor

          After discussion:
  • We should check first if a file was provided, then check if its a proper registry path, then send to PEPHUB.
  • Write a function in ubiquerg (or update the existing one) such that the user can pass flags, e.g. require_namespace=True and have it return the parsed path (or a False if it could not parse)

Originally posted by @donaldcampbelljr in pepkit/looper#456 (comment)

@donaldcampbelljr donaldcampbelljr changed the title Revise is_registry_path Revise parse_registry_path or add a new function to check if path is a valid registry path Mar 19, 2024
@donaldcampbelljr
Copy link
Contributor Author

From Looper:

def is_pephub_registry_path(input_string: str) -> bool:
    """
    Check if input is a registry path to pephub
    :param str input_string: path to the PEP (or registry path)
    :return bool: True if input is a registry path
    """
    try:
        registry_path = RegistryPath(**parse_registry_path(input_string))
    except (ValidationError, TypeError):
        return False
    return True

The above function (from Looper), should be moved here to Ubiquerg and actually fail if the input is anything other than a valid PEPHub registry path.

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

No branches or pull requests

1 participant