Skip to content
This repository was archived by the owner on Nov 24, 2024. It is now read-only.

Commit 62201b4

Browse files
committed
Overhaul build process and implement support for "Colour 0.3.14".
1 parent cc90fe7 commit 62201b4

File tree

11 files changed

+1085
-1150
lines changed

11 files changed

+1085
-1150
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
.idea
55
.vscode
66
__pycache__
7+
colour_analysis.egg-info
78
node_modules
89
poetry.lock

Dockerfile

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,11 @@
1-
FROM continuumio/miniconda
1+
FROM python:3.6
22

3-
RUN apt-get update && \
4-
apt install -y \
5-
build-essential \
6-
cmake \
7-
libboost-all-dev \
8-
libbz2-dev \
9-
libgif-dev \
10-
libgl1-mesa-glx \
11-
libfreetype6-dev \
12-
libilmbase-dev \
13-
libjpeg-dev \
14-
libopenexr-dev \
15-
libpng-dev \
16-
libraw-dev \
17-
libtiff5-dev \
18-
libwebp-dev \
19-
qtbase5-dev && \
20-
apt-get clean
21-
22-
RUN cd /tmp && \
23-
wget https://github.com/OpenImageIO/oiio/archive/Release-1.8.13.tar.gz -O OpenImageIO-1.8.13.tar.gz && \
24-
tar -xvf OpenImageIO-1.8.13.tar.gz && \
25-
cd oiio-Release-1.8.13 && \
26-
make && \
27-
cp -r /tmp/oiio-Release-1.8.13/dist/linux64/bin/* /usr/local/bin/ && \
28-
cp -r /tmp/oiio-Release-1.8.13/dist/linux64/lib/* /usr/local/lib/ && \
29-
cp /tmp/oiio-Release-1.8.13/dist/linux64/lib/python2.7/site-packages/OpenImageIO.so /opt/conda/lib/python2.7/site-packages/
30-
31-
RUN /opt/conda/bin/conda install -y \
32-
flask \
33-
numpy \
34-
matplotlib \
35-
scipy \
36-
six
3+
WORKDIR /tmp
4+
COPY ./requirements.txt /tmp
5+
RUN pip install -r requirements.txt
376

387
ARG CACHE_DATE
398

40-
RUN pip install \
41-
gunicorn \
42-
Flask-Caching \
43-
git+git://github.com/colour-science/colour@develop \
44-
git+git://github.com/colour-science/flask-compress@feature/cache
45-
469
RUN mkdir -p /home/colour-analysis
4710
WORKDIR /home/colour-analysis
4811
COPY . /home/colour-analysis

README.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,8 @@ Development
3737

3838
.. code-block:: bash
3939
40-
$ conda create -y -n python-colour-analysis
41-
$ source activate python-colour-analysis
42-
$ conda install -y -c conda-forge colour-science
43-
$ conda install flask invoke matplotlib
44-
$ pip install git+git://github.com/colour-science/flask-compress@feature/cache
45-
$ npm run build
46-
$ python app.py
40+
$ poetry install
41+
$ poetry run invoke docker-run
4742
4843
Code of Conduct
4944
---------------

app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
COLOURSPACE_MODEL, IMAGE_COLOURSPACE, IMAGE_DECODING_CCTF,
2020
PRIMARY_COLOURSPACE, RGB_colourspaces, RGB_colourspace_volume_visual,
2121
RGB_image_scatter_visual, SECONDARY_COLOURSPACE, colourspace_models,
22-
decoding_cctfs, image_data, pointer_gamut_visual, spectral_locus_visual,
22+
cctf_decodings, image_data, pointer_gamut_visual, spectral_locus_visual,
2323
visible_spectrum_visual)
2424

2525
__author__ = 'Colour Developers'
@@ -42,7 +42,7 @@
4242

4343
__all__ = [
4444
'APP', 'CACHE', 'CACHE_DEFAULT_TIMEOUT', 'IMAGES_DIRECTORY',
45-
'images_response', 'decoding_cctfs_response',
45+
'images_response', 'cctf_decodings_response',
4646
'colourspace_models_response', 'RGB_colourspaces_response',
4747
'image_data_response', 'RGB_colourspace_volume_visual_response',
4848
'RGB_image_scatter_visual_response', 'spectral_locus_visual_response',
@@ -157,7 +157,7 @@ def images_response():
157157

158158
@APP.route('/decoding-cctfs')
159159
@CACHE.cached(timeout=CACHE_DEFAULT_TIMEOUT, query_string=True)
160-
def decoding_cctfs_response():
160+
def cctf_decodings_response():
161161
"""
162162
Returns the decoding colour component transfer functions response.
163163
@@ -167,7 +167,7 @@ def decoding_cctfs_response():
167167
Decoding colour component transfer functions response.
168168
"""
169169

170-
json_data = decoding_cctfs()
170+
json_data = cctf_decodings()
171171

172172
response = Response(json_data, status=200, mimetype='application/json')
173173
response.headers['X-Content-Length'] = len(json_data)

0 commit comments

Comments
 (0)