Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -qq update -y && \
apt-get -qq install -y git >/dev/null

RUN pip install uv

### Install requirements
FROM python AS requirements

Expand Down
16 changes: 2 additions & 14 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,9 @@ set -e
set -o pipefail

PROJECT_ROOT=$(dirname $(dirname $(realpath $0)))
PROJECT_NAME=$(basename ${PROJECT_ROOT})

pushd ${PROJECT_ROOT} > /dev/null

# Installation defaults to using a local virtualenv (`.env`) but may use other tooling
# (e.g. `virtualenvwrapper`) to externalize the installation location.

if [ -z "${VIRTUAL_ENV}" ]; then
# Create a local virtualenv if one does not exist
test -d .venv || python3 -m venv .venv --prompt ${PROJECT_NAME}
source .venv/bin/activate
fi

# We need wheel to install any binary packagess
pip3 install --disable-pip-version-check wheel

# Install dependencies in editable mode
pip3 install --disable-pip-version-check --editable '.[dist,style,test,types]'
uv venv --allow-existing
uv pip install --editable '.[dist,style,test,types]'
17 changes: 17 additions & 0 deletions bin/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash -eo pipefail

PROJECT_ROOT=$(dirname $(dirname $(realpath $0)))

pushd ${PROJECT_ROOT} > /dev/null

if which uv >/dev/null 2>&1; then
uv pip compile pyproject.toml --no-annotate --no-header -o requirements.txt
else
WORKDIR=$(mktemp -d)

trap "rm -rf ${WORKDIR}" EXIT

python3 -m venv ${WORKDIR}
${WORKDIR}/bin/pip install --disable-pip-version-check --quiet --editable .
${WORKDIR}/bin/pip freeze --disable-pip-version-check --quiet --exclude-editable > requirements.txt
fi
13 changes: 0 additions & 13 deletions bin/update-requirements

This file was deleted.

40 changes: 4 additions & 36 deletions bin/verify-style
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,12 @@ set -e
set -o pipefail

PROJECT_ROOT=$(dirname $(dirname $(realpath $0)))

pushd ${PROJECT_ROOT} > /dev/null

if [ -z "${VIRTUAL_ENV}" ] && [ -r .venv ]; then
source .venv/bin/activate
fi

# Remove unused imports and variables.
#
# We run `autoflake` *first* so unused values are not used in further formatting.
if [ -n "$CI" ]; then
autoflake --check-diff --recursive --remove-unused-variables src
else
autoflake --recursive --remove-unused-variables --quiet --in-place src
fi


# Enforce import ordering.
#
# We run `isort` *before* `flake8` so that it doesn't complain about import ordering.
if [ -n "$CI" ]; then
isort --check --diff --color src
uv run ruff check
uv run ruff format --check --diff
else
isort --quiet --color src
uv run ruff check --fix
uv run ruff format
fi


# Enforce opinionated formatting.
#
# We run `black` *after* all other tools that edit code format.
if [ -n "$CI" ]; then
black --check --diff --color src
else
black --quiet --color src
fi


# Validate style.
#
# We run `flake8` *last* to validate style left over after automatic formatting.
flake8 src
8 changes: 1 addition & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ dist = [
]

style = [
"autoflake==2.3.1",
"black==25.9.0",
"flake8==7.3.0",
"flake8-isort==6.1.2",
"flake8-print==5.0.0",
"flake8-pyproject==1.2.3",
"isort[colors]==6.1.0",
"ruff==0.14.0",
]

test = [
Expand Down
14 changes: 5 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ cffi==2.0.0
charset-normalizer==3.4.4
click==8.3.0
cryptography==46.0.3
Deprecated==1.2.18
gitdb==4.0.12
GitPython==3.1.45
gitpython==3.1.45
idna==3.11
pycparser==2.23
PyGithub==2.8.1
PyJWT==2.10.1
PyNaCl==1.6.0
python-dateutil==2.9.0.post0
pygithub==2.8.1
pyjwt==2.10.1
pynacl==1.6.0
requests==2.32.5
six==1.17.0
smmap==5.0.2
typing_extensions==4.15.0
typing-extensions==4.15.0
urllib3==2.2.1
wrapt==1.17.3
2 changes: 1 addition & 1 deletion src/bot/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def extract_repo_name(repo: Repo, remote: str = "origin") -> str:

def iter_blobs(item: Diff) -> Generator[BlobDTO, None, None]:
"""Iterate through diff items and produce blobs."""
match (item.change_type):
match item.change_type:
case "A":
# File added
assert item.b_path is not None
Expand Down
787 changes: 787 additions & 0 deletions uv.lock

Large diffs are not rendered by default.