Skip to content

Commit

Permalink
CI: Unbreak linting (#95)
Browse files Browse the repository at this point in the history
The doit command would trigger _poetry_install, which runs poetry
without the `-E docs` extra. Recent poetry versions now uninstall everything
related to the extras not explicitly listed, breaking any docs linting
steps. Explicitly ignoring the task is easiest.

At the same time, upgrade black to a version that doesn't break rely on
private internals of click that have since been removed.
  • Loading branch information
mjpieters authored Oct 22, 2022
1 parent f2d9170 commit 6697d2e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .azure-pipelines/stage-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ stages:
- bash: poetry install -E docs
displayName: Install dependencies

- bash: poetry run doit -v2 docs
- bash: |
poetry run doit ignore _poetry_install # don't uninstall the docs extra
poetry run doit -v2 docs
displayName: "Run docs checker"
- job: "twine"
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:
minimum_pre_commit_version: 1.14.0
repos:
- repo: https://github.com/psf/black
rev: 21.9b0
rev: 22.10.0
hooks:
- id: black
language_version: python3.7
Expand Down
2 changes: 2 additions & 0 deletions changelog.d/95.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Updated the version of black in the CI and pre-commit, and adjusted CI steps to
account for recent versions of poetry.
3 changes: 1 addition & 2 deletions dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,9 @@ def with_poetry(*actions):
def task_poetry_install():
# in case we have doit installed outside of poetry
# and there is no lock file, run poetry first.
extras = ["--extras", "docs"] if not ON_CI else []
return {
"basename": "_install_poetry",
"actions": [["poetry", "install", *extras]],
"actions": [["poetry", "install", "--extras", "docs"]],
"targets": ["poetry.lock"],
"uptodate": [run_once],
}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ twine = "^4.0.0"
towncrier = "^22.8.0"

[tool.poetry.dev-dependencies.black]
version = "^20.8b0"
version = "^22.10.0"
markers = "platform_python_implementation != 'PyPy'"

[tool.poetry.dev-dependencies.mypy]
Expand Down

0 comments on commit 6697d2e

Please sign in to comment.