Skip to content

Instantly share code, notes, and snippets.

@asherf
asherf / python-package-aduit.yaml
Created October 10, 2022 14:25
Run pip audit on pants lock file
name: Audit reqs
on:
schedule:
# 10am PST/ 1pm EST / 5pm UTC Monday & Thursday
- cron: 0 17 * * MON,THU
jobs:
audit-python:
name: Audit python packages
runs-on: ubuntu-20.04
strategy:
@asherf
asherf / Dockerfile
Created July 29, 2022 17:06
pants docker container bootrap bootstrap script
FROM python:3.9.12-slim-buster@sha256:62ed2b347a385102d33f5e82530862359f8dc60464674d78cef844b02d150a50
ARG PANTS_VERSION=2.12.0
RUN apt-get update && \
apt-get install --no-install-recommends -y \
curl git unzip gcc libssl-dev bash && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
groupadd --gid 99 kramer && useradd -m --no-log-init --uid 99 --gid 99 kramer
USER kramer:kramer
@asherf
asherf / setup_plugin.py
Created February 12, 2021 19:06
pants setup_py plugin that reads long description from a file.
class ToolchainSetupKwargsRequest(SetupKwargsRequest):
@classmethod
def is_applicable(cls, _: Target) -> bool:
return True
@rule
async def toolchain_setup_plugin(request: ToolchainSetupKwargsRequest) -> SetupKwargs:
explicit_kwargs = request.explicit_kwargs