Skip to content

Commit e22c4ea

Browse files
committed
Simplify and fix Neural build for running tests
1 parent fbb6d5d commit e22c4ea

File tree

5 files changed

+45
-47
lines changed

5 files changed

+45
-47
lines changed

Dockerfile

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,46 @@
1-
FROM testbed/vim:24
1+
FROM testbed/vim:24 AS build-vim
22

3-
# Add packages we need.
4-
#
5-
# We need most packages for installing Python.
6-
# We need nodejs for pyright.
3+
# Install tools for Vim testing.
4+
# We have a layer here so we rebuild Vim and Neovim less frequently.
5+
# Installing the Vim versions is the slowest build step.
6+
RUN install_vim -tag v8.0.0027 -build \
7+
-tag v9.0.0297 -build \
8+
-tag neovim:v0.8.0 -build
9+
10+
RUN apk --update add git \
11+
&& git clone https://github.com/junegunn/vader.vim /vader \
12+
&& cd /vader \
13+
&& git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
14+
15+
FROM python:3.10-alpine
16+
17+
# Copy shared libraries needed for Neovim.
18+
COPY --from=build-vim /usr/lib/libluv.so.* /usr/lib/
19+
COPY --from=build-vim /usr/lib/libuv.so.* /usr/lib/
20+
COPY --from=build-vim /usr/lib/libmsgpackc.so.* /usr/lib/
21+
COPY --from=build-vim /usr/lib/libtermkey.so.* /usr/lib/
22+
COPY --from=build-vim /usr/lib/libunibilium.so.* /usr/lib/
23+
COPY --from=build-vim /usr/lib/libluajit-5.1.so.* /usr/lib/
24+
COPY --from=build-vim /usr/lib/lua /usr/lib/lua
25+
COPY --from=build-vim /vim-build /vim-build
26+
COPY --from=build-vim /vader /vader
27+
28+
# Install scripting tools for test scripts.
29+
# We need nodejs for running pyright.
730
ENV PACKAGES="\
831
bash \
9-
curl \
10-
git \
11-
build-base \
12-
patch \
13-
zlib-dev \
14-
libffi-dev \
15-
linux-headers \
16-
readline-dev \
17-
openssl \
18-
nodejs \
19-
openssl-dev \
20-
sqlite-dev \
21-
bzip2-dev \
22-
python3 \
23-
py3-pip \
2432
grep \
2533
sed \
34+
nodejs \
2635
"
2736
RUN apk --update add $PACKAGES && \
2837
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
2938

30-
# Install tools for Python testing.
31-
ENV PATH=/root/.pyenv/shims:/root/.pyenv/bin:$PATH
32-
33-
# Switch to the /root dir copy the .python-version from the project.
39+
# Switch to the /root dir for setting up the project.
3440
WORKDIR /root
3541

36-
# Install tools for Vim testing.
37-
# We have a layer here so we rebuild Vim and Neovim less frequently.
38-
# Installing the Vim versions is the slowest build step.
39-
RUN install_vim -tag v8.0.0027 -build \
40-
-tag v9.0.0297 -build \
41-
-tag neovim:v0.8.0 -build
42-
RUN git clone https://github.com/junegunn/vader.vim vader && \
43-
cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
44-
45-
# Copy project files into the project for dependencies and such.
46-
COPY .python-version /root/
47-
48-
# Install the Python version we need with uv.
49-
# We have a layer here so we rebuild Python and install uv less frequently.
50-
# Installing Python with uv is slower than updating dependencies, but much
51-
# faster than installing the Vim and Neovim versions.
52-
RUN curl https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash \
53-
&& eval "$(pyenv init -)" \
54-
&& eval "$(pyenv virtualenv-init -)" \
55-
&& pyenv install \
56-
&& pip install uv
42+
# Install setuptools and uv for Python
43+
RUN pip install uv
5744

5845
# Sync dependencies and install the Python dependencies we need.
5946
# vim-vint is included here for running the Vim lint steps.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dependencies = [
2828

2929
[dependency-groups]
3030
dev = [
31+
"setuptools",
3132
"pyright==1.1.402",
3233
"pytest>=8.4.1",
3334
"ruff==0.10.0",

test/script/run-python

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ echo 'Running ruff'
4343
echo '========================================'
4444
echo 'ruff warnings/errors follow:'
4545
echo
46+
4647
docker run -a stdout "${docker_flags[@]}" ruff check -q || exit_code=$?
4748

4849
exit $exit_code

test/script/run-vader-tests

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ done
4848
vim="$1"
4949
tests="$2"
5050

51-
echo "$vim"
52-
5351
case $vim in
5452
# Neovim 0.6+ requires headless argument to load Vader tests.
5553
neovim*)

uv.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)