Fix and test docs on Windows (#2262)

There's some weird interaction between Click and
sphinxcontrib-programoutput on Windows that leads to an encoding error
during the printing of black-primer's help text.

Also symlinks aren't well supported on Windows so let's just use
includes which actually work because we now use MyST :D
This commit is contained in:
Richard Si 2021-05-26 22:04:10 -04:00 committed by GitHub
parent 754eecf69e
commit 6613e76658
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 7 deletions

View File

@ -11,14 +11,17 @@ jobs:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
- name: Set up latest Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |

View File

@ -25,6 +25,7 @@
- Fix typos discovered by codespell (#2228)
- Fix Vim plugin installation instructions. (#2235)
- Add new Frequently Asked Questions page (#2247)
- Fix encoding + symlink issues preventing proper build on Windows (#2262)
## 21.5b1

View File

@ -1 +0,0 @@
../AUTHORS.md

3
docs/authors.md Normal file
View File

@ -0,0 +1,3 @@
```{include} ../AUTHORS.md
```

View File

@ -1 +0,0 @@
../CHANGES.md

3
docs/change_log.md Normal file
View File

@ -0,0 +1,3 @@
```{include} ../CHANGES.md
```

View File

@ -12,8 +12,10 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
from pathlib import Path
import os
import string
from pathlib import Path
from pkg_resources import get_distribution
@ -29,6 +31,10 @@ def make_pypi_svg(version: str) -> None:
f.write(svg)
# Necessary so Click doesn't hit an encode error when called by
# sphinxcontrib-programoutput on Windows.
os.putenv("pythonioencoding", "utf-8")
# -- Project information -----------------------------------------------------
project = "Black"