Commit b64738a0 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Add PyPI packaging, including automated builds.

parent b471cf83
Loading
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
build/
bin/
*.cmake
src/cython/prrt.c
*.cbp
*.pyc
CMakeCache.txt
.vagrant/
build/
bin/
CMakeFiles/
Makefile
cython_debug/
prrt.cpython*.so
dist/
prrt.egg-info/
tests/__pycache__/
CMakeCache.txt
Makefile
MANIFEST
prrt.cpython*.so
prrt.so
src/cython/prrt.c
 No newline at end of file
+47 −14
Original line number Diff line number Diff line
before_script:
variables:
  PYPI_USER: SECURE
  PYPI_PASSWORD: SECURE

stages:
  - build
  - test
  - deploy
  - clean

build_prrt:
  stage: build
  artifacts:
    name: "$CI_BUILD_REF_NAME$"
    untracked: true
    expire_in: "1h"
  script:
    - which cmake
    - which gcc
    - which g++
  - which valgrind
    - pip3 list | grep Cython
    - pip3 list | grep numpy
    - CC=gcc-5 CXX=g++-5 cmake .
    - make

memcheck:
test_prrt_mem:
  stage: test
  script:
    - which valgrind
    - export prrtResult=0
    - valgrind --tool=memcheck --track-origins=yes --leak-check=full --error-exitcode=1 ./bin/receiver 5000 & export prrtReceiverProcessID=$!
    - valgrind --tool=memcheck --track-origins=yes --leak-check=full --error-exitcode=1 ./bin/sender 100 || prrtResult=$?; kill -INT $prrtReceiverProcessID; wait $prrtReceiverProcessID || prrtResult=$?
@@ -20,10 +37,26 @@ memcheck:
#    - python3 setup.py build_ext --inplace
#    - make perftest

pythonbindings:
test_prrt_functional:
  stage: test
  script:
    - python3 setup.py build_ext --inplace
    - ./bin/prrtTests

tests:
package_pypi:
  stage: deploy
  script:
    - ./bin/prrtTests
    - echo "[distutils]" >> ~/.pypirc
    - echo "index-servers =" >> ~/.pypirc
    - echo "  on" >> ~/.pypirc
    - echo " " >> ~/.pypirc
    - echo "[on]" >> ~/.pypirc
    - echo "repository=http://git.nt.uni-saarland.de:5678" >> ~/.pypirc
    - echo "username=$PYPI_USER" >> ~/.pypirc
    - echo "password=$PYPI_PASSWORD" >> ~/.pypirc
    - python3 setup.py check sdist bdist upload -r on

clean_pypirc:
  stage: clean
  when: always
  script:
    - rm -vf ~/.pypirc

MANIFEST.in

0 → 100644
+2 −0
Original line number Diff line number Diff line
include requirements.txt
recursive-include src *
 No newline at end of file

Vagrantfile

0 → 100644
+20 −0
Original line number Diff line number Diff line
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/xenial64"
  config.vm.box_check_update = false

  config.vm.provider "virtualbox" do |v|
      v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
      v.name = "prrt"
      v.memory = "2048"
      v.cpus = "2"
  end

  config.vm.provision "shell", inline: <<-SHELL
     sudo sed -i 's@http://archive.ubuntu.com/ubuntu@http://ftp.uni-kl.de/pub/linux/ubuntu/@' /etc/apt/sources.list
     sudo apt-get update
     sudo apt-get install -y python-dev python-pip
  SHELL
end

setup.cfg

0 → 100644
+3 −0
Original line number Diff line number Diff line
[bdist_wheel]
# This code is written to work with both Python 2 and Python 3
universal=1
Loading