Skip to content

Instantly share code, notes, and snippets.

View NodeJSmith's full-sized avatar

Jessica Smith NodeJSmith

  • 07:51 (UTC -06:00)
View GitHub Profile
@NodeJSmith
NodeJSmith / ado-pre-commit-cache-all-example.yaml
Last active September 6, 2024 20:08
Cache pre-commit, both pre-commit and virtualenv
- job: precommit
pool:
vmImage: ubuntu-latest
variables:
PYTHON_VERSION: 3.11
VENV_ENV_NAME: .venv
PRE_COMMIT_HOME: $(Pipeline.Workspace)/pre-commit-cache
steps:
- task: UsePythonVersion@0
@NodeJSmith
NodeJSmith / UnicodeEncodeError.md
Last active August 30, 2024 14:33
UnicodeEncodeError in Windows agent CI pipelines

Background

Running Python scripts in CI pipelines on Windows agents can sometimes cause UnicodeEncodeErrors that don't seem to make any sense. For example, running a simple command with a tool built in click or running dbx build or prefect build may run fine on your local Windows machine, but fail when running in a CI pipeline.

For example, running the below code:

# example.py
import click