Skip to content

Commit

Permalink
fixup versions
Browse files Browse the repository at this point in the history
  • Loading branch information
lacraig2 committed Apr 8, 2024
1 parent b179d79 commit f2a59cd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,22 @@ COPY .git /panda/
RUN git -C /panda submodule update --init dtc && \
git -C /panda rev-parse HEAD > /usr/local/panda_commit_hash && \
mkdir /panda/build && cd /panda/build && \
python3 -m pip install setuptools_scm && \
python3 -m setuptools_scm -r .. --strip-dev 2>/dev/null >/tmp/savedversion && \
/panda/configure \
--target-list="${TARGET_LIST}" \
--prefix=/usr/local \
--disable-numa \
--enable-llvm
--enable-llvm && \
rm -rf /panda/.git


RUN make -C /panda/build -j "$(nproc)"
RUN PRETEND_VERSION=$(cat /tmp/savedversion) make -C /panda/build -j "$(nproc)"

#### Develop setup: panda built + pypanda installed (in develop mode) - Stage 3
FROM builder as developer
RUN cd /panda/panda/python/core && \
python3 setup.py develop && \
PRETEND_VERSION=$(cat /tmp/savedversion) python3 setup.py develop && \
ldconfig && \
update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && \
cd /panda && \
Expand All @@ -89,12 +93,11 @@ RUN make -C /panda/build install && \

# Install pypanda
RUN cd /panda/panda/python/core && \
export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PANDARE=$(python -m setuptools_scm -r ../../.. --strip-dev 2>/dev/null) && \
python3 setup.py install
PRETEND_VERSION=$(cat /tmp/savedversion) python3 setup.py install
RUN python3 -m pip install --ignore-install pycparser && python3 -m pip install --force-reinstall --no-binary :all: cffi
# Build a whl too
RUN cd /panda/panda/python/core && \
python3 setup.py bdist_wheel
PRETEND_VERSION=$(cat /tmp/savedversion) python3 setup.py bdist_wheel

# BUG: PANDA sometimes fails to generate all the necessary files for PyPANDA. This is a temporary fix to detect and fail when this occurs
RUN ls -alt $(pip show pandare | grep Location: | awk '{print $2}')/pandare/autogen/
Expand Down
23 changes: 17 additions & 6 deletions panda/python/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,27 @@ def run(self):

with open("README.md", "r") as fh:
long_description = fh.read()


setup(name='pandare',
description='Python Interface to PANDA',
long_description=long_description,
setup_requires=['setuptools_scm'],
use_scm_version = {
version_options = {
"setup_requires": ['setuptools_scm'],
"use_scm_version": {
"root": "../../..",
"relative_to": __file__,
"fallback_version": "0.0.0.1",
'local_scheme': 'no-local-version',
},
}

if "PRETEND_VERSION" in os.environ:
version = os.environ["PRETEND_VERSION"]
version_options = {
"version":version,
}


setup(name='pandare',
description='Python Interface to PANDA',
long_description=long_description,
long_description_content_type="text/markdown",
author='Andrew Fasano, Luke Craig, and Tim Leek',
author_email='fasano@mit.edu',
Expand All @@ -145,4 +155,5 @@ def run(self):
install_requires=parse_requirements("requirements.txt"),
python_requires='>=3.6',
cmdclass={'install': custom_install, 'develop': custom_develop},
**version_options
)

0 comments on commit f2a59cd

Please sign in to comment.