id,node_id,number,state,locked,title,user,body,created_at,updated_at,closed_at,merged_at,merge_commit_sha,assignee,milestone,draft,head,base,author_association,auto_merge,repo,url,merged_by
840454257,PR_kwDOAMm_X84yGFBx,6237,closed,0,Enable running sphinx-build on Windows,38358698,"- [x] User visible changes (including notable bug fixes) are documented in `whats-new.rst`

This PR enables one to build the documentation on Windows by manually invoking `sphinx-build`.

The first commit enables *sphinx* to execute the ""conf.py"" file. Before the commit, *sphinx* complains:

```
Configuration error:
There is a programmable error in your configuration file:
```

with the exception `FileNotFoundError: [WinError 2] The system cannot find the file specified` where it tries to invoke *conda*. On Windows, *conda* environments other than the base environment have ""conda.bat"" on their path rather than ""conda.exe"", and one must call `subprocess.run` with ""conda.bat"" instead of merely ""conda"". However, the `CONDA_EXE` environment variable correctly points to the executable and should do so across platforms; it requires *conda* version 4.5 or later for conda/conda#6923.

The second commit enables the build to tolerate exceptions when deleting temporary files and tells Git to ignore more such files. Without the commit, builds occasionally failed at the `os.remove` calls with exceptions such as `PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'example.nc'`.

Should ""whats-new.rst"" mention these changes, which are developer-visible but not user-visible?

I welcome any feedback.

Edit: Checked the ""whats-new"" task.",2022-02-04T17:15:14Z,2022-03-04T19:15:42Z,2022-03-01T16:00:34Z,2022-03-01T16:00:34Z,0f91f05e532f4424f3d6afd6e6d5bd5a02ceed55,,,0,2c0a29c98e9ebb5b5a2001b155bd15d85fd27797,33067cd24f66d4855babaa6801b009480c4e2cb2,CONTRIBUTOR,,13221727,https://github.com/pydata/xarray/pull/6237,
863479168,PR_kwDOAMm_X84zd6WA,6305,closed,0,"On Windows, enable successful test of opening a dataset containing a cftime index",38358698,"- [X] User visible changes (including notable bug fixes) are documented in `whats-new.rst`

Previously, on Windows, the subject test unnecessarily failed, and the temporary directory and file remained, because the scheduler in the outer context prevented deleting the temporary directory upon exiting the inner context of the latter.

<details><summary>Example failure (with short traceback):</summary>
<p>

```
================================================ FAILURES =================================================
__________________________ test_open_mfdataset_can_open_files_with_cftime_index ___________________________
C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\shutil.py:616: in _rmtree_unsafe
    os.unlink(fullname)
E   PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\STAN~1.WES\\AppData\\Local\\Temp\\tmpdpdajrgc\\test.nc'

During handling of the above exception, another exception occurred:
C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\tempfile.py:802: in onerror
    _os.unlink(path)
E   PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\STAN~1.WES\\AppData\\Local\\Temp\\tmpdpdajrgc\\test.nc'

During handling of the above exception, another exception occurred:
C:\Users\stan.west\Documents\Repositories\xarray\xarray\tests\test_distributed.py:128: in test_open_mfdataset_can_open_files_with_cftime_index
    assert_identical(tf[""test""], da)
C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\tempfile.py:827: in __exit__
    self.cleanup()
C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\tempfile.py:831: in cleanup
    self._rmtree(self.name)
C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\tempfile.py:813: in _rmtree
    _shutil.rmtree(name, onerror=onerror)
C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\shutil.py:740: in rmtree
    return _rmtree_unsafe(path, onerror)
C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\shutil.py:618: in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\tempfile.py:805: in onerror
    cls._rmtree(path)
C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\tempfile.py:813: in _rmtree
    _shutil.rmtree(name, onerror=onerror)
C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\shutil.py:740: in rmtree
    return _rmtree_unsafe(path, onerror)
C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\shutil.py:599: in _rmtree_unsafe
    onerror(os.scandir, path, sys.exc_info())
C:\Users\stan.west\Programs\Miniconda3-64\envs\xarray-dev\lib\shutil.py:596: in _rmtree_unsafe
    with os.scandir(path) as scandir_it:
E   NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Users\\STAN~1.WES\\AppData\\Local\\Temp\\tmpdpdajrgc\\test.nc'
========================================= short test summary info =========================================
FAILED xarray/tests/test_distributed.py::test_open_mfdataset_can_open_files_with_cftime_index - NotADirec...

=========================================== 1 failed in 10.77s ============================================
```

</p>
</details>

The first commit swaps the two contexts to resolve the issue. The second commit replaces the `tempfile.TemporaryDirectory()` context manager with *pytest*'s `tmp_path` fixture, which slightly simplifies the test and relies on *pytest* to remove the directory on a subsequent invocation.",2022-02-25T14:07:50Z,2022-02-28T16:06:33Z,2022-02-28T09:53:22Z,2022-02-28T09:53:22Z,613a8fda4f07181fbc41d6ff2296fec3726fd351,,,0,3337833f44172f823a7174eb363f5cb3484a56af,de965f342e1c9c5de92ab135fbc4062e21e72453,CONTRIBUTOR,,13221727,https://github.com/pydata/xarray/pull/6305,
870790082,PR_kwDOAMm_X84z5zPC,6326,closed,0,"Lengthen underline, correct spelling, and reword",38358698,"Lengthening the underline resolves the following warning from *sphinx-build*:

```
[...]\xarray\doc\whats-new.rst:20: WARNING: Title underline too short.

v2022.03.1 (unreleased)
---------------------
```",2022-03-03T16:40:55Z,2022-03-03T17:27:42Z,2022-03-03T17:01:15Z,2022-03-03T17:01:15Z,f42ac28629b7b2047f859f291e1d755c36f2e834,,,0,a5cdac63c32c8c23c199717fa1e1b67ce5f1b7f4,a01460bd90e3ae31a32e40005f33c2919efba8bb,CONTRIBUTOR,,13221727,https://github.com/pydata/xarray/pull/6326,
871935485,PR_kwDOAMm_X84z-K39,6330,closed,0,"In documentation on adding a new backend, add missing import and tweak headings",38358698,"Adding the import resolves the following exception that *sphinx-build* raises when one builds only ""doc/internals/how-to-add-new-backend.rst"":

```
NameError                                 Traceback (most recent call last)
Input In [1], in <module>
----> 1 var = xr.Variable(
      2     dims=(""x"",), data=np.arange(10.0), attrs={""scale_factor"": 10, ""add_offset"": 2}
      3 )

NameError: name 'xr' is not defined
```

While in the file, I revised headings to have only their first letter capitalized (except for case-sensitive code), which seems to be the majority convention in the documentation.",2022-03-04T19:13:30Z,2022-03-07T14:17:29Z,2022-03-07T13:13:50Z,2022-03-07T13:13:50Z,29a87cc110f1a1ff7b21c308ba7277963b51ada3,,,0,263ed36e61a5fb34e236421da890cfcc00784f21,f42ac28629b7b2047f859f291e1d755c36f2e834,CONTRIBUTOR,,13221727,https://github.com/pydata/xarray/pull/6330,
872032930,PR_kwDOAMm_X84z-iqi,6334,closed,0,"In backends, support expressing a dimension's preferred chunk sizes as a tuple of integers",38358698,"- [X] Closes #6333
- [X] Tests added
- [X] User visible changes (including notable bug fixes) are documented in `whats-new.rst`
",2022-03-04T21:39:46Z,2022-04-08T17:18:50Z,2022-04-08T17:18:50Z,2022-04-08T17:18:50Z,8389fe6e8c86a04d57f25fe137b6f2db77065523,,,0,75ccf72e89e4c330d761d4ee41f1fa101c2fd3f8,2e93d549d267dd976384d5837be25c932df95717,CONTRIBUTOR,,13221727,https://github.com/pydata/xarray/pull/6334,