pydata / pydata/xarray

Add a case_sensitivity keyword arguments to methods relying on pathlib (Python 3.12)

Open
#9,503 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic-DataTree
Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

What is your issue?

Copied issue from https://github.com/xarray-contrib/datatree/issues/292

Motive

In Python 3.12, PurePath.match, Path.glob and Path.rglob now supports a case_sensitivity argument, so that the user have full-control on the behavior of the path matching.

https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.match

Changed in version 3.12: The case_sensitive parameter was added.

https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob

Changed in version 3.12: The case_sensitive parameter was added.

https://docs.python.org/3/library/pathlib.html#pathlib.Path.rglob

Changed in version 3.12: The case_sensitive parameter was added.

By default, None means "use OS defaults"

typically, case-sensitive on POSIX, and case-insensitive on Windows.

Proposal: Since datatree only supports POSIX-paths, the default behaviour in datatree should be case-sensitive.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the pathlib-dependent match, glob, and rglob entry points and review how their current arguments are exposed. Confirm the Python 3.12 behavior and compatibility constraints; done means callers can control case sensitivity while the default remains case-sensitive for datatree's POSIX paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.