Added some CI utils.

master
Sofus Albert Høgsbro Rose 2017-01-26 17:07:35 -05:00
parent da01b5e910
commit 345dda9020
Signed by: so-rose
GPG Key ID: 3D01BE95F3EFFEB9
7 changed files with 81 additions and 17 deletions

46
.gitlab-ci.yml 100644
View File

@ -0,0 +1,46 @@
# This file is a template, and might need editing before it works on your project.
# use the official gcc image, based on debian
# can use verions as well, like gcc:5.2
# see https://hub.docker.com/_/gcc/
image: sorose/graphics:v8
stages:
- build
- build-docs
- deploy-docs
- test
# - review
before_script:
- apt update && apt -y install python3-pip gcc libmagickwand-dev
- rm -rf dist build docs/build openlut.egg-info
build:
stage: build
script:
- python3 setup.py sdist #Build source distribution.
- python3 setup.py bdist_wheel #Build Linux wheel.
artifacts:
paths:
- dist/*
build-docs:
stage: build-docs
script:
- ./mkDocs.sh
artifacts:
paths:
- docs/build/html
deploy-docs:
stage: deploy-docs
environment:
name: Documentation
url: https://www.sofusrose.com/openlut
when: manual
# run tests using the binary built before.
test:
stage: test
script:
- python3 tests/suite.py

View File

@ -35,7 +35,6 @@ First: **Ensure you have dependencies!!!** The pip command will break without th
Simply use pip: `pip3 install openlut` (pip3 denotes that you must use a Python 3 version of pip). Keep in mind, there are some external dependencies:
* **Python 3.5**: This is Python; you need Python.
* **gcc**: This is needed to compile the C++ extensions.
* **pybind11**: This is a library needed to link the C++ extension into Python. pip version is being difficult...
* **imagemagick**: For all file IO. It's not like I was gonna write that myself :) .
*If it's breaking, try running `pip3 install -U pip setuptools`. Sometimes they are out of date.*
@ -45,13 +44,13 @@ Installing Dependencies
-----
Not Difficult, I promise!
On Debian/Ubuntu: `sudo apt-get install python3-pip gcc pybind11-dev libmagickwand-dev`
On Debian/Ubuntu: `sudo apt-get install python3-pip gcc libmagickwand-dev`
On Mac: `brew install python3 gcc pybind11 imagemagick`
On Mac: `brew install python3 gcc imagemagick`
* You will need Homebrew ( copy/paste a command from http://brew.sh/ to install ) and XCode Command Line Tools for gcc (it should prompt you to install this).
* If this doesn't install pip, run `brew install python3; curl https://bootstrap.pypa.io/get-pip.py | python3`
On Other: You need **python 3.5**, pip, a newer version (must support C++14) of **gcc**, and pybind11 in your `includes`.
On Other: You need **python 3.5**, pip, a newer version (must support C++14) of **gcc**.
Basic Library Usage

View File

@ -63,9 +63,9 @@ author = u'Sofus Rose'
# built documents.
#
# The short X.Y version.
version = u'0.2.1'
version = u'0.2.3'
# The full version, including alpha/beta/rc tags.
release = u'0.2.1'
release = u'0.2.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@ -2,11 +2,21 @@
REMOTE=sofus@wakingnexus
rsync -avzP build/html/* $REMOTE:~/openlut/
#Remove the old docs.
ssh $REMOTE 'bash -s' << 'ENDSSH'
#ssh $REMOTE 'bash -s' << 'ENDSSH'
#
#cd /var/www/openlut
#chown -R www-data:www-data *
#
#ENDSSH
rm -rf /var/www/openlut/*
ENDSSH
#Sync over the new docs.
rsync -avzP build/html/* $REMOTE:/var/www/openlut/
#Set strong permissions.
ssh $REMOTE 'bash -s' << 'ENDSSH'
chown -R sofus:www-data /var/www/openlut/*
find /var/www/openlut -type f -exec chmod 0640 {} \;
find /var/www/openlut -type d -exec chmod 2750 {} \;
ENDSSH

3
mkDocs.sh 100755
View File

@ -0,0 +1,3 @@
pandoc --from=markdown --to=rst --output=README.rst README.md
make -C doc html

View File

@ -1,2 +1,2 @@
[metadata]
description-file = README.md
description-file = README.rst

View File

@ -2,14 +2,18 @@
import sys, os
import os.path as path
from os.path import join
from setuptools import setup
from setuptools import Extension
from setuptools import find_packages
#pybind11, a dependency, can report its own includes!
#pybind11, a dep of openlut, can report its own includes for gcc compilation!
import pybind11
def read(fname):
return open(join(path.dirname(__file__), fname)).read()
#Make sure we're using gcc.
os.environ["CC"] = "g++"
os.environ["CXX"] = "g++"
@ -19,15 +23,17 @@ link_args = ['-fopenmp']
olOpt = Extension( 'openlut.lib.olOpt',
sources = ['openlut/lib/olOpt.cpp'],
include_dirs=[pybind11.get_include()], #Include pybind11.
include_dirs=[pybind11.get_include()], #Include pybind11 from its pip package.
language = 'c++',
extra_compile_args = cpp_args,
extra_link_args = cpp_args
)
setup( name = 'openlut',
version = '0.2.1',
version = '0.2.4',
description = 'OpenLUT is a practical color management library.',
long_description = read('README.rst'),
author = 'Sofus Rose',
author_email = 'sofus@sofusrose.com',
url = 'https://www.github.com/so-rose/openlut',