mozilla / bleach

Bleach is an allowed-list-based HTML sanitizing library that escapes or strips markup and attributes
https://bleach.readthedocs.io/en/latest/
Other
2.65k stars 253 forks source link

fix some CI issues (#636) #637

Closed willkg closed 2 years ago

willkg commented 2 years ago

Fix doctest linting issues with migrating chapter (#636)

This renames the file, adds it to the index, and reworks the doctest blocks which won't work in our docs build environment so they're code blocks instead. That does mean they're untested, but that's much easier to support for now.

Fix pip-tools problem and rework requirements (#636)

This fixes the problem with pip-tools < 6.5.0 and pip 22 by adding pip-tools to the dev requirements, setting it to 6.5.0, and installing that before checking the requirements.

This also moves requirements checking code to the scripts/run_tests.sh script so it's easier to do in a local dev environment.

This also rebuilds the dev requirements.

willkg commented 2 years ago

The 3.6 tests (3) are failing because we've got dependencies that don't work with that. I'm pretty sure #629 will fix that, so I'm not going to bother with those.

The 3.7 tests (3) are failing with this:

ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
    typed-ast>=1.4.2 from https://files.pythonhosted.org/packages/05/3f/c224ee002bd0f5a763c54004198c321b30cdd67b319a1d4d69b26fdc19c2/typed_ast-1.5.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl#sha256=f30ddd110634c2d7534b2d4e0e22967e88366b0d356b24de87419cc4410c41b7 (from black==22.1.0->-r requirements-dev.txt (line 19))

I think we can fix this by building requirements-dev.txt using Python 3.7 rather than Python 3.9.

The Windows checks (3) fail with this:

ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
    pywin32-ctypes!=0.1.0,!=0.1.1 from https://files.pythonhosted.org/packages/9e/4b/3ab2720f1fa4b4bc924ef1932b842edf10007e4547ea8157b0b9fc78599a/pywin32_ctypes-0.2.0-py2.py3-none-any.whl#sha256=9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98 (from keyring==23.5.0->-r requirements-dev.txt (line 193))

I'm not sure offhand how to fix that. Maybe a platform-specific requirements-dev.txt file? Ugh.

The pypy checks (3) fail with the same issue as the 3.6 tests:

ERROR: Could not find a version that satisfies the requirement filelock==3.4.2 (from versions: 0.2.0, 0.2.1, 0.2.2, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 2.0.0, 2.0.1, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.0.10, 2.0.11, 2.0.12, 2.0.13, 3.0.0, 3.0.2, 3.0.3, 3.0.4, 3.0.6, 3.0.8, 3.0.9, 3.0.10, 3.0.12, 3.1.0, 3.2.0, 3.2.1, 3.3.0, 3.3.1, 3.3.2, 3.4.0, 3.4.1)
ERROR: No matching distribution found for filelock==3.4.2

Stepping back a bit, I'm not sure we should be doing a requirements-dev.txt at all and instead should put the top-level requirements in setup.py. That's what I'm doing with all my other projects. It's generally easier to maintain. Issue #620 covers that.

I'll think more about this tomorrow and talk with @g-k about issue #620.

g-k commented 2 years ago

+1 on dropping 3.6 it'll make cleaner type syntax available to use too.

building requirements-dev.txt using Python 3.7 rather than Python 3.9

wfm

Maybe a platform-specific requirements-dev.txt file? Ugh.

Yeah, kinda gross. I've had to do this for other projects.

Commented 👍 on #620

willkg commented 2 years ago

This fixes a couple of issues. The rest of the issues will get fixed by work on issue #620 and landing PR #629.

@g-k Can you review this?

willkg commented 2 years ago

Thank you!