Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distribute Python Packages #179

Closed
wants to merge 1 commit into from
Closed
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
18 changes: 17 additions & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,28 @@ jobs:
container:
image: docker://ghcr.io/n3pdf/maturin:0.2.1
steps:
- name: Set Path
run: |
echo "PATH=${HOME}/local/bin:${HOME}/.cargo/bin:${PATH}" >> $GITHUB_ENV
- name: Clone repository
run: |
cd ${HOME}
# clone pineappl code
git clone https://github.com/N3PDF/pineappl.git
- name: Compile and Publish CLI wheels
working-directory: /home/pineappl
env:
HOME: /home/pineappl
run: |
cd ${HOME}/pineappl/pineappl_cli
maturin publish --skip-existing --username __token__ --password ${{ secrets.PYPI_TOKEN }} -F fktable --no-sdist
- name: Compile and Publish wheels
working-directory: /home/pineappl
env:
HOME: /home/pineappl
run: |
~/maturin publish --skip-existing --username __token__ --password ${{ secrets.PYPI_TOKEN }} --interpreter 3.7 3.8 3.9 3.10 pypy3.7
cd ${HOME}/pineappl/pineappl_py
maturin publish --skip-existing --username __token__ --password ${{ secrets.PYPI_TOKEN }} --interpreter 3.7 3.8 3.9 3.10 3.11 pypy3.7 pypy3.8 pypy 3.9

deploy-other:
strategy:
Expand Down
19 changes: 11 additions & 8 deletions pineappl_py/package/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ FROM quay.io/pypa/manylinux2014_x86_64

ARG MATURIN_TAR='maturin-x86_64-unknown-linux-musl.tar.gz'
ARG MATURIN_TAG='v0.13.0-beta.9'
ARG LHAPDF_URL='https://lhapdf.hepforge.org/downloads/?f='
ARG LHAPDF_TAG='LHAPDF-6.5.3'

# install c compiler
# and create a dedicated user
RUN /bin/bash -c "yum install gcc -y; \
useradd -m pineappl;\
su - pineappl"

USER pineappl
ARG USER=pineappl
USER ${USER}
ENV PATH=/home/${USER}/local/bin:/home/${USER}/.cargo/bin:${PATH}
ENV PKG_CONFIG_PATH=/home/${USER}/local/lib/pkgconfig:PKG_CONFIG_PATH
ENV LD_LIBRARY_PATH=/home/${USER}/local/lib:LD_LIBRARY_PATH

# install dependencies
# - rust
Expand All @@ -18,10 +24,7 @@ RUN /bin/bash -c "cd ${HOME}; \
mkdir -p local/bin; \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; \
curl --remote-name -L https://github.com/PyO3/maturin/releases/download/${MATURIN_TAG}/${MATURIN_TAR}; \
tar -xvzf ${MATURIN_TAR} --directory=local/bin/"

COPY maturin /home/pineappl

ENTRYPOINT ["/home/pineappl/maturin"]
# To minimize the size of the wheel use '--strip'
CMD ["build --release --interpreter 3.7 3.8 3.9 3.10 pypy3.7"]
tar -xvzf ${MATURIN_TAR} --directory=local/bin/; \
curl -L ${LHAPDF_URL}${LHAPDF_TAG}.tar.gz > LHAPDF.tar.gz; \
tar xvzf LHAPDF.tar.gz; \
cd ${LHAPDF_TAG}; ./configure --disable-python --prefix=${HOME}/local; make && make install"
8 changes: 0 additions & 8 deletions pineappl_py/package/maturin

This file was deleted.