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

Enable xattr test for macOS #4845

Merged
merged 5 commits into from
Apr 27, 2023
Merged

Enable xattr test for macOS #4845

merged 5 commits into from
Apr 27, 2023

Conversation

kenodegard
Copy link
Contributor

@kenodegard kenodegard commented Apr 7, 2023

Description

Xattr test previously only ran on Linux (if setfattr is present), made necessary changes to allow the test to also run on macOS.

Updated testing_homedir fixture to use a simpler tempfile.TemporaryDirectory implementation.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@kenodegard kenodegard self-assigned this Apr 7, 2023
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Apr 7, 2023
from collections import defaultdict
from pathlib import Path
from typing import Generator
Copy link
Contributor

Choose a reason for hiding this comment

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

Deprecated since version 3.9: collections.abc.Generator now supports subscripting ([]). See PEP 585 and Generic Alias Type (source: https://docs.python.org/3/library/typing.html?highlight=typing#typing.Generator)

You can also just use Iterator too if you don't need to specify the extra types in a Generator:

from collections.abc import Iterator

def oh_it_iterates() -> Iterator[str]:
    yield "iter"
    yield "ator"
    yield "!!!"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh cool! I didn't know this!

Copy link
Contributor Author

@kenodegard kenodegard Apr 12, 2023

Choose a reason for hiding this comment

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

Hm, since this was a change introduced in Python 3.9 we'd have to do a try-except to use the updated subscriptable types. So I think we should wait until we drop Python 3.8 support before making the switch from typing to collections.abc.

Copy link
Contributor

@travishathaway travishathaway left a comment

Choose a reason for hiding this comment

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

Looks good. I just want to make sure we are not using any of the deprecated types in the typing module.

Copy link
Contributor

@sven6002 sven6002 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@kenodegard kenodegard merged commit eab7ac4 into conda:main Apr 27, 2023
@kenodegard kenodegard deleted the xattr-test branch April 27, 2023 15:56
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Apr 27, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants