Skip to content

Commit

Permalink
Use setup.cfg in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
earlbread committed Nov 5, 2018
1 parent ae89adb commit a8a87c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Expand Up @@ -18,7 +18,8 @@ WORKDIR /app

# Cache dependencies if possible
COPY setup.py /app
RUN python -c 'from setup import *; print("\n".join(install_requires))' \
COPY setup.cfg /app
RUN python -c 'from setup import *; print_install_requires()' \
> /tmp/requirements.txt && \
pip install -r /tmp/requirements.txt && \
rm /tmp/requirements.txt
Expand Down
6 changes: 6 additions & 0 deletions setup.py
@@ -1,4 +1,10 @@
from setuptools import setup

def print_install_requires():
import configparser;
c = configparser.ConfigParser();
c.read('setup.cfg');
print(c['options']['install_requires'])

if __name__ == '__main__':
setup()

0 comments on commit a8a87c7

Please sign in to comment.