-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython_env.sh
55 lines (44 loc) · 1.26 KB
/
python_env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# https://jacobian.org/2019/nov/11/python-environment-2020/#atom-entries
sudo yum install \
zlib-devel \
bzip2 \
bzip2-devel \
readline-devel \
sqlite \
sqlite-devel \
openssl-devel \
xz \
xz-devel \
libffi-devel
# install pyenv
PROJ=pyenv-installer
SCRIPT_URL=https://github.com/pyenv/$PROJ/raw/master/bin/$PROJ
curl -L $SCRIPT_URL | bash# setup
export PATH="~/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv install 3.8.0
# make it global
pyenv global 3.8.0
# install pipx
python -m pip install pipx
pipx install visidata
pipx inject visidata pandas
pipx install poetry==1.0.0b4
## DEPLOYMENT
FROM python:3.7
WORKDIR /code
RUN pip install -U pip && \
pip install poetry
COPY poetry.lock pyproject.toml ./
COPY src/ ./src/
# Install poetry globally - with the current version of
# poetry, there is a known issue where poetry config will
# not create config.toml: https://github.com/sdispater/poetry/issues/1179
# As such, we create it ourselves.
RUN mkdir -p ${HOME}/.config/pypoetry/ && \
touch ${HOME}/.config/pypoetry/config.toml && \
poetry config settings.virtualenvs.create false && \
# Set PRODUCTION to anything to invoke installation with --no-dev
ARG PRODUCTION
RUN poetry install ${PRODUCTION:+--no-dev}