Skip to content

Commit

Permalink
packages
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime-desroches committed Jul 11, 2024
1 parent 59b7353 commit e835fff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install --break-system-packages --no-cache-dir pyyaml Cython scons pycapnp pre-commit ruff parameterized coverage numpy pytest

WORKDIR /project/msgq/
RUN cd /tmp/ && \
git clone -b v2.x --depth 1 https://github.com/catchorg/Catch2.git && \
Expand All @@ -51,4 +49,5 @@ ENV PYTHONPATH=/project

COPY . .
RUN ls && rm -rf .git && \
scons -c && scons -j$(nproc)
SCONS_EXTRAS=1 pip3 install --break-system-packages --no-cache-dir .[dev]

6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from setuptools import Command, setup
from setuptools.command.build import build
import subprocess
import os

class SconsBuild(Command):
def initialize_options(self) -> None:
Expand All @@ -10,12 +11,15 @@ def finalize_options(self) -> None:
pass

def run(self) -> None:
subprocess.run(["scons --minimal -j$(nproc)"], shell=True)
scons_flags = '--minimal' if 'SCONS_EXTRAS' not in os.environ else ''
subprocess.run([f"scons {scons_flags} -j$(nproc)"], shell=True).check_returncode()

class CustomBuild(build):
sub_commands = [('scons_build', None)] + build.sub_commands

setup(
packages = ["msgq", "msgq.visionipc"],
package_data={'msgq': ['**/*.cc', '**/*.h', '**/*.pxd', '**/*.pyx', '**/*.so']},
include_package_data=True,
cmdclass={'build': CustomBuild, 'scons_build': SconsBuild}
)

0 comments on commit e835fff

Please sign in to comment.