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

SupportedRegion as a StrEnum #112

Closed

Conversation

davidbuckman
Copy link

@davidbuckman davidbuckman commented Jul 1, 2023

SupportedRegion should be a StrEnum so that __str__ works as expected, e.g. in

https://github.com/firebase/functions-samples/blob/main/Python/taskqueues-backup-images/functions/main.py#L144-L168

@google-cla
Copy link

google-cla bot commented Jul 1, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@russellwheatley
Copy link
Member

russellwheatley commented Jul 10, 2023

Thanks @davidbuckman, do you mind writing a few tests along the line of:

def test_supported_region_enum():
    """
    Testing SupportedRegion enum
    """
    assert options.SupportedRegion.EUROPE_WEST2 == "europe-west2"

in this file, please? https://github.com/firebase/firebase-functions-python/blob/main/tests/test_options.py

@davidbuckman davidbuckman force-pushed the supported-region-as-a-str-enum branch from cc6090b to edf5495 Compare July 20, 2023 02:33
@exaby73
Copy link
Contributor

exaby73 commented Sep 11, 2023

Hello @davidbuckman. Could you run the commands for formatting and fix the linting and push so that the CI is green? You can find these commands on the contributing guidelines page

@davidbuckman
Copy link
Author

@russellwheatley anything else needed here?

@exaby73
Copy link
Contributor

exaby73 commented Feb 16, 2024

@davidbuckman since StrEnum was added in 3.11, and we are currently on 3.12 but supporting 3.10, this would be a breaking change. We've decided for now to just override the __str__ method manually on all enum classes, with the this PR being merged in on the next major version bump. For now, I'll leave this PR open and come back to it at a later date. Sorry for the inconvenience

@exaby73
Copy link
Contributor

exaby73 commented Mar 18, 2024

Superseded by #178

@exaby73 exaby73 closed this Mar 18, 2024
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

Successfully merging this pull request may close these issues.

3 participants