Simplify and fix Neural build for running tests
This commit is contained in:
+34
-47
@@ -1,37 +1,4 @@
|
||||
FROM testbed/vim:24
|
||||
|
||||
# Add packages we need.
|
||||
#
|
||||
# We need most packages for installing Python.
|
||||
# We need nodejs for pyright.
|
||||
ENV PACKAGES="\
|
||||
bash \
|
||||
curl \
|
||||
git \
|
||||
build-base \
|
||||
patch \
|
||||
zlib-dev \
|
||||
libffi-dev \
|
||||
linux-headers \
|
||||
readline-dev \
|
||||
openssl \
|
||||
nodejs \
|
||||
openssl-dev \
|
||||
sqlite-dev \
|
||||
bzip2-dev \
|
||||
python3 \
|
||||
py3-pip \
|
||||
grep \
|
||||
sed \
|
||||
"
|
||||
RUN apk --update add $PACKAGES && \
|
||||
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
|
||||
|
||||
# Install tools for Python testing.
|
||||
ENV PATH=/root/.pyenv/shims:/root/.pyenv/bin:$PATH
|
||||
|
||||
# Switch to the /root dir copy the .python-version from the project.
|
||||
WORKDIR /root
|
||||
FROM testbed/vim:24 AS build-vim
|
||||
|
||||
# Install tools for Vim testing.
|
||||
# We have a layer here so we rebuild Vim and Neovim less frequently.
|
||||
@@ -39,21 +6,41 @@ WORKDIR /root
|
||||
RUN install_vim -tag v8.0.0027 -build \
|
||||
-tag v9.0.0297 -build \
|
||||
-tag neovim:v0.8.0 -build
|
||||
RUN git clone https://github.com/junegunn/vader.vim vader && \
|
||||
cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
|
||||
|
||||
# Copy project files into the project for dependencies and such.
|
||||
COPY .python-version /root/
|
||||
RUN apk --update add git \
|
||||
&& git clone https://github.com/junegunn/vader.vim /vader \
|
||||
&& cd /vader \
|
||||
&& git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
|
||||
|
||||
# Install the Python version we need with uv.
|
||||
# We have a layer here so we rebuild Python and install uv less frequently.
|
||||
# Installing Python with uv is slower than updating dependencies, but much
|
||||
# faster than installing the Vim and Neovim versions.
|
||||
RUN curl https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash \
|
||||
&& eval "$(pyenv init -)" \
|
||||
&& eval "$(pyenv virtualenv-init -)" \
|
||||
&& pyenv install \
|
||||
&& pip install uv
|
||||
FROM python:3.10-alpine
|
||||
|
||||
# Copy shared libraries needed for Neovim.
|
||||
COPY --from=build-vim /usr/lib/libluv.so.* /usr/lib/
|
||||
COPY --from=build-vim /usr/lib/libuv.so.* /usr/lib/
|
||||
COPY --from=build-vim /usr/lib/libmsgpackc.so.* /usr/lib/
|
||||
COPY --from=build-vim /usr/lib/libtermkey.so.* /usr/lib/
|
||||
COPY --from=build-vim /usr/lib/libunibilium.so.* /usr/lib/
|
||||
COPY --from=build-vim /usr/lib/libluajit-5.1.so.* /usr/lib/
|
||||
COPY --from=build-vim /usr/lib/lua /usr/lib/lua
|
||||
COPY --from=build-vim /vim-build /vim-build
|
||||
COPY --from=build-vim /vader /vader
|
||||
|
||||
# Install scripting tools for test scripts.
|
||||
# We need nodejs for running pyright.
|
||||
ENV PACKAGES="\
|
||||
bash \
|
||||
grep \
|
||||
sed \
|
||||
nodejs \
|
||||
"
|
||||
RUN apk --update add $PACKAGES && \
|
||||
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
|
||||
|
||||
# Switch to the /root dir for setting up the project.
|
||||
WORKDIR /root
|
||||
|
||||
# Install setuptools and uv for Python
|
||||
RUN pip install uv
|
||||
|
||||
# Sync dependencies and install the Python dependencies we need.
|
||||
# vim-vint is included here for running the Vim lint steps.
|
||||
|
||||
@@ -28,6 +28,7 @@ dependencies = [
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"setuptools",
|
||||
"pyright==1.1.402",
|
||||
"pytest>=8.4.1",
|
||||
"ruff==0.10.0",
|
||||
|
||||
@@ -43,6 +43,7 @@ echo 'Running ruff'
|
||||
echo '========================================'
|
||||
echo 'ruff warnings/errors follow:'
|
||||
echo
|
||||
|
||||
docker run -a stdout "${docker_flags[@]}" ruff check -q || exit_code=$?
|
||||
|
||||
exit $exit_code
|
||||
|
||||
@@ -48,8 +48,6 @@ done
|
||||
vim="$1"
|
||||
tests="$2"
|
||||
|
||||
echo "$vim"
|
||||
|
||||
case $vim in
|
||||
# Neovim 0.6+ requires headless argument to load Vader tests.
|
||||
neovim*)
|
||||
|
||||
@@ -60,6 +60,7 @@ dev = [
|
||||
{ name = "pyright" },
|
||||
{ name = "pytest" },
|
||||
{ name = "ruff" },
|
||||
{ name = "setuptools" },
|
||||
{ name = "vim-vint" },
|
||||
]
|
||||
|
||||
@@ -70,6 +71,7 @@ dev = [
|
||||
{ name = "pyright", specifier = "==1.1.402" },
|
||||
{ name = "pytest", specifier = ">=8.4.1" },
|
||||
{ name = "ruff", specifier = "==0.10.0" },
|
||||
{ name = "setuptools" },
|
||||
{ name = "vim-vint", specifier = "===0.3.21" },
|
||||
]
|
||||
|
||||
@@ -209,6 +211,15 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/82/ed/5c59941634c9026ceeccc7c119f23f4356f09aafd28c15c1bc734ac66b01/ruff-0.10.0-py3-none-win_arm64.whl", hash = "sha256:935a943bdbd9ff0685acd80d484ea91088e27617537b5f7ef8907187d19d28d0", size = 10510133, upload-time = "2025-03-13T18:38:02.91Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "setuptools"
|
||||
version = "80.9.0"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/18/5d/3bf57dcd21979b887f014ea83c24ae194cfcd12b9e0fda66b957c69d1fca/setuptools-80.9.0.tar.gz", hash = "sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c", size = 1319958, upload-time = "2025-05-27T00:56:51.443Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/a3/dc/17031897dae0efacfea57dfd3a82fdd2a2aeb58e0ff71b77b87e44edc772/setuptools-80.9.0-py3-none-any.whl", hash = "sha256:062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922", size = 1201486, upload-time = "2025-05-27T00:56:49.664Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tomli"
|
||||
version = "2.2.1"
|
||||
|
||||
Reference in New Issue
Block a user