Skip to content

Commit 51613d6

Browse files
committed
#365 python install fixed
1 parent 827d9f0 commit 51613d6

6 files changed

+72
-55
lines changed

DEPENDS.txt

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ hard babel-russian
66
hard bibcop
77
hard biber
88
hard biblatex
9+
hard booktabs
910
hard cancel
1011
hard catchfile
1112
hard changepage
@@ -20,6 +21,7 @@ hard datetime
2021
hard doi
2122
hard enumitem
2223
hard environ
24+
hard everyshi
2325
hard fdsymbol
2426
hard ffcode
2527
hard fmtcount

Dockerfile

+10-9
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,10 @@ RUN apt-get update -y --fix-missing \
8989
RUN add-apt-repository -y ppa:deadsnakes/ppa \
9090
&& apt-get update -y --fix-missing \
9191
&& apt-get -y install --no-install-recommends \
92-
python3.10=* \
92+
python3=* \
93+
python3-venv=* \
9394
python3-pip=* \
94-
python3.12-venv=* \
95-
python3.10-venv=* \
96-
python3.10-dev=* \
95+
python3-dev=* \
9796
&& apt-get clean \
9897
&& rm -rf /var/lib/apt/lists/*
9998

@@ -106,9 +105,6 @@ COPY help/* /cam/help/
106105

107106
ENV LOCAL=/cam
108107

109-
COPY installs/install-texlive.sh installs/
110-
RUN installs/install-texlive.sh
111-
112108
COPY installs/install-pmd.sh installs/
113109
RUN installs/install-pmd.sh
114110

@@ -124,10 +120,15 @@ COPY installs/install-jpeek.sh installs/
124120
ENV JPEEK=/opt/app/jpeek.jar
125121
RUN installs/install-jpeek.sh
126122

123+
COPY installs/install-poppler.sh installs/
124+
RUN installs/install-poppler.sh
125+
127126
COPY installs/install-pip.sh installs/
128127
RUN installs/install-pip.sh
129128

130-
COPY installs/install-poppler.sh installs/
131-
RUN installs/install-poppler.sh
129+
COPY installs/install-texlive.sh installs/
130+
RUN installs/install-texlive.sh
131+
COPY installs/install-texlive-depends.sh installs/
132+
RUN installs/install-texlive-depends.sh
132133

133134
COPY . /cam

installs/install-pip.sh

+3-8
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ set -o pipefail
2727
"${LOCAL}/help/assert-tool.sh" python3 --version
2828
"${LOCAL}/help/assert-tool.sh" pip3 --version
2929

30-
if [ ! -d "${LOCAL}/venv" ]; then
31-
"${LOCAL}/help/sudo.sh" python3 -m venv "${LOCAL}/venv"
32-
fi
30+
# see https://stackoverflow.com/a/76641565/187141
31+
rm /usr/lib/python3.*/EXTERNALLY-MANAGED
3332

34-
# shellcheck source=/dev/null
35-
source "${LOCAL}/venv/bin/activate"
36-
37-
"${LOCAL}/help/sudo.sh" python3 -m pip install --upgrade pip
38-
"${LOCAL}/help/sudo.sh" python3 -m pip install -r "${LOCAL}/requirements.txt"
33+
pip3 install -r "${LOCAL}/requirements.txt"

installs/install-texlive-depends.sh

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
# MIT License
3+
#
4+
# Copyright (c) 2021-2024 Yegor Bugayenko
5+
#
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to deal
8+
# in the Software without restriction, including without limitation the rights
9+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
# copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
#
13+
# The above copyright notice and this permission notice shall be included in all
14+
# copies or substantial portions of the Software.
15+
#
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
# SOFTWARE.
23+
24+
set -ex
25+
set -o pipefail
26+
27+
if ! tlmgr --version >/dev/null 2>&1; then
28+
PATH=$PATH:$("${LOCAL}/help/texlive-bin.sh")
29+
export PATH
30+
fi
31+
32+
if "${LOCAL}/help/is-macos.sh"; then
33+
if [ ! -e "${HOME}/Library/texmf" ] && [ ! -e "${HOME}/texmf/tlpkg/texlive.tlpdb" ]; then
34+
"${LOCAL}/help/sudo.sh" tlmgr init-usertree
35+
fi
36+
elif "${LOCAL}/help/is-linux.sh"; then
37+
if [ ! -e "${HOME}/texmf" ]; then
38+
"${LOCAL}/help/sudo.sh" tlmgr init-usertree
39+
fi
40+
fi
41+
"${LOCAL}/help/sudo.sh" tlmgr option repository ctan
42+
"${LOCAL}/help/sudo.sh" tlmgr --verify-repo=none update --self
43+
packages=()
44+
while IFS= read -r p; do
45+
packages+=( "${p}" )
46+
done < <( cut -d' ' -f2 "${LOCAL}/DEPENDS.txt" | uniq )
47+
"${LOCAL}/help/sudo.sh" tlmgr --verify-repo=none install "${packages[@]}"
48+
"${LOCAL}/help/sudo.sh" tlmgr --verify-repo=none update --no-auto-remove "${packages[@]}" || echo 'Failed to update'

installs/install-texlive.sh

-18
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,3 @@ fi
4646

4747
"${LOCAL}/help/sudo.sh" tlmgr install collection-latex
4848
pdflatex -v
49-
50-
if "${LOCAL}/help/is-macos.sh"; then
51-
if [ ! -e "${HOME}/Library/texmf" ] && [ ! -e "${HOME}/texmf/tlpkg/texlive.tlpdb" ]; then
52-
"${LOCAL}/help/sudo.sh" tlmgr init-usertree
53-
fi
54-
elif "${LOCAL}/help/is-linux.sh"; then
55-
if [ ! -e "${HOME}/texmf" ]; then
56-
"${LOCAL}/help/sudo.sh" tlmgr init-usertree
57-
fi
58-
fi
59-
"${LOCAL}/help/sudo.sh" tlmgr option repository ctan
60-
"${LOCAL}/help/sudo.sh" tlmgr --verify-repo=none update --self
61-
packages=()
62-
while IFS= read -r p; do
63-
packages+=( "${p}" )
64-
done < <( cut -d' ' -f2 "${LOCAL}/DEPENDS.txt" | uniq )
65-
"${LOCAL}/help/sudo.sh" tlmgr --verify-repo=none install "${packages[@]}"
66-
"${LOCAL}/help/sudo.sh" tlmgr --verify-repo=none update --no-auto-remove "${packages[@]}" || echo 'Failed to update'

steps/env.sh

+9-20
Original file line numberDiff line numberDiff line change
@@ -40,39 +40,33 @@ if [ "${bash_version}" -lt 5 ]; then
4040
fi
4141

4242
ruby -v
43+
rubocop -v
4344

4445
if [[ "$(python3 --version 2>&1 | cut -f2 -d' ')" =~ ^[1-2] ]]; then
4546
python3 --version
4647
echo "Python must be 3+"
4748
exit 1
4849
fi
49-
50+
flake8 --version
51+
pylint --version
5052

5153
if ! tlmgr --version >/dev/null 2>&1; then
5254
PATH=$PATH:$("${LOCAL}/help/texlive-bin.sh")
5355
export PATH
5456
fi
55-
56-
flake8 --version
57-
58-
pylint --version
57+
pdflatex --version
58+
pdftotext -v
59+
inkscape --version
60+
aspell --version
5961

6062
xmlstarlet --version
6163

6264
shellcheck --version
6365

64-
pdflatex --version
65-
66-
aspell --version
67-
6866
jq --version
6967

7068
multimetric --help > /dev/null
7169

72-
rubocop -v
73-
74-
inkscape --version
75-
7670
awk --version
7771

7872
parallel --version
@@ -83,12 +77,6 @@ cloc --version
8377

8478
pmd --version
8579

86-
gradle --version
87-
88-
mvn --version
89-
90-
pdftotext -v
91-
9280
nproc --version
9381

9482
# Part of coreutils (by GNU):
@@ -100,7 +88,8 @@ realpath --version
10088
bc -v
10189

10290
javac -version
103-
10491
java -jar "${JPEEK}" --help
92+
gradle --version
93+
mvn --version
10594

10695
locale

0 commit comments

Comments
 (0)