From e4f4e630ce0f2ee7f486484c186e1e34dc94fa35 Mon Sep 17 00:00:00 2001
From: squidfunk <martin.donath@squidfunk.com>
Date: Thu, 30 Mar 2017 23:34:21 +0200
Subject: [PATCH] Added requirements as explicit dependencies in setup.py

---
 Dockerfile       | 17 ++++++-----------
 requirements.txt |  4 ++--
 setup.py         |  8 ++++++++
 3 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index fa120100..55838366 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -24,21 +24,16 @@ MAINTAINER Martin Donath <martin.donath@squidfunk.com>
 # Set build directory
 WORKDIR /tmp
 
-# Install dependencies
-COPY requirements.txt .
-RUN \
-  pip install -r requirements.txt && \
-  rm requirements.txt
-
 # Copy files necessary for build
-COPY material material
-COPY MANIFEST.in MANIFEST.in
-COPY package.json package.json
-COPY setup.py setup.py
+COPY material .
+COPY MANIFEST.in .
+COPY package.json .
+COPY requirements.txt .
+COPY setup.py .
 
 # Perform build and cleanup artifacts
 RUN \
-  python setup.py install && \
+  python setup.py install 2>/dev/null && \
   rm -rf /tmp/*
 
 # Set working directory
diff --git a/requirements.txt b/requirements.txt
index 2109c3ed..600ff7e8 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -19,5 +19,5 @@
 # IN THE SOFTWARE.
 
 mkdocs>=0.16
-pygments
-pymdown-extensions>=1.2
+pygments>=2.2
+pymdown-extensions>=2.0
diff --git a/setup.py b/setup.py
index 6acaf1ac..b2816a04 100644
--- a/setup.py
+++ b/setup.py
@@ -25,6 +25,13 @@ from setuptools import setup, find_packages
 with open("package.json") as data:
     package = json.load(data)
 
+# Load list of dependencies
+with open("requirements.txt") as data:
+    install_requires = [
+        line for line in data.read().split("\n")
+            if line and not line.startswith("#")
+    ]
+
 # Package description
 setup(
     name = package["name"],
@@ -37,6 +44,7 @@ setup(
     keywords = package["keywords"],
     packages = find_packages(),
     include_package_data = True,
+    install_requires = install_requires,
     entry_points = {
         "mkdocs.themes": [
             "material = material",
-- 
GitLab