PrefectHQ / prefect-collection-template

Template to quickly bootstrap a Prefect Collection
Apache License 2.0
66 stars 9 forks source link

The collection name and collection slug are not a valid Prefect collection name #155

Open umutaktas opened 6 months ago

umutaktas commented 6 months ago

Hello, I developing on prefect project and I want give new name for collection and slug names. But I've got an error when I was get install command. How can I set new name?


import re
import sys

MODULE_REGEX = r"^[_a-zA-Z][_a-zA-Z0-9]+$"
PREFECT_COLLECTION_MODULE_REGEX = r"^prefect_[_a-zA-Z][_a-zA-Z0-9]+$"
PREFECT_COLLECTION_NAME_REGEX = r"^prefect-[-a-zA-Z][-a-zA-Z0-9]+$"

collection_slug = "my_collection"
collection_name = "my-collection"

if not re.match(MODULE_REGEX, collection_slug):
    print(
        f"ERROR: The collection slug ({collection_slug}) is not a valid Python module name. "
        "Please do not use - and use _ instead"
    )
    sys.exit(1)

if not re.match(PREFECT_COLLECTION_MODULE_REGEX, collection_slug):
    print(
        f"ERROR: The collection slug ({collection_slug}) is not a valid Prefect collection module name. "
        "Please ensure your collection slug is prefixed with 'prefect_'"
    )