Skip to content

Commit 60e0198

Browse files
authored
Merge pull request #369 from nai1ka/master
Fixed make pipeline for Linux
2 parents 648f459 + 4c457b0 commit 60e0198

File tree

7 files changed

+27
-7
lines changed

7 files changed

+27
-7
lines changed

.rubocop.yml

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
AllCops:
2424
SuggestExtensions: false
2525
NewCops: enable
26+
Exclude:
27+
- 'venv/**/*'
2628

2729
Layout/EmptyLineAfterGuardClause:
2830
Enabled: false

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ define step
6363
set -e
6464
start=$$(date +%s%N)
6565
echo -e "\n\n\n+++ $(1) +++\n"
66+
if [ -d "$(LOCAL)/venv" ]; then
67+
source "$(LOCAL)/venv/bin/activate"
68+
fi
6669
@bash $(LOCAL)/steps/$(1).sh
6770
echo "Finished$$("$${LOCAL}/help/tdiff.sh" "$${start}")"
6871
endef

installs/install-pip.sh

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

30-
# see https://stackoverflow.com/a/76641565/187141
31-
rm -f /usr/lib/python3.*/EXTERNALLY-MANAGED
30+
if [ ! -d "venv" ]; then
31+
python3 -m venv venv
32+
fi
33+
34+
# shellcheck source=/dev/null
35+
source venv/bin/activate
3236

3337
pip3 install -r "${LOCAL}/requirements.txt"
File renamed without changes.

steps/env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ env
3333

3434
bash_version=${BASH_VERSINFO:-0}
3535
if [ "${bash_version}" -lt 5 ]; then
36-
"${SHELL}" -version
36+
"${SHELL}" --version
3737
ps -p $$
3838
echo "${SHELL} version is older than five: ${bash_version}"
3939
exit 1

steps/install.sh

+10
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@ if ! inkscape --version >/dev/null 2>&1; then
8585
fi
8686
fi
8787

88+
if ! xmllint --version >/dev/null 2>&1; then
89+
if "${LOCAL}/help/is-linux.sh"; then
90+
"${LOCAL}/help/sudo.sh" apt-get install -y libxml2-utils
91+
elif "${LOCAL}/help/is-macos.sh"; then
92+
"${LOCAL}/help/sudo.sh" --as-user brew install libxml2
93+
else
94+
"${LOCAL}/help/assert-tool.sh" xmllint --version
95+
fi
96+
fi
97+
8898
find "${LOCAL}/installs" -name 'install-*' | sort | while IFS= read -r i; do
8999
"${i}"
90100
done

steps/lint.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ cffconvert --validate
2727

2828
mypy --strict "${LOCAL}/"
2929

30-
flake8 --max-line-length=140 "${LOCAL}/"
30+
flake8 --max-line-length=140 --exclude venv "${LOCAL}/"
3131

3232
export PYTHONPATH="${PYTHONPATH}:${LOCAL}/pylint_plugins/"
3333

34-
find "${LOCAL}" -type f -name '*.py' -print0 | xargs -0 -n1 pylint --enable-all-extensions --load-plugins=custom_checkers \
34+
find "${LOCAL}" -type f -name '*.py' -not -path "${LOCAL}/venv/**" -print0 | xargs -0 -n1 pylint --enable-all-extensions --load-plugins=custom_checkers \
3535
--disable=empty-comment \
3636
--disable=missing-module-docstring \
3737
--disable=invalid-name \
@@ -53,7 +53,7 @@ bibcop tex/report.bib
5353

5454
while IFS= read -r sh; do
5555
shellcheck --shell=bash --severity=style "${sh}"
56-
done < <(find "$(realpath "${LOCAL}")" -name '*.sh' -type f -not -path "$(realpath "${TARGET}")/**")
56+
done < <(find "$(realpath "${LOCAL}")" -name '*.sh' -type f -not -path "$(realpath "${TARGET}")/**" -not -path "$(realpath "${LOCAL}")/venv/**")
5757

5858
header="Copyright (c) 2021-$(date +%Y) Yegor Bugayenko"
5959
failed="false"
@@ -66,6 +66,7 @@ for mask in *.sh *.py *.rb *.yml *.java Makefile; do
6666
done < <(find "$(realpath "${LOCAL}")" -type f -name "${mask}" \
6767
-not -path "$(realpath "${TARGET}")/**" \
6868
-not -path "$(realpath "${LOCAL}")/fixtures/filters/unparseable/**" \
69-
-not -path "$(realpath "${LOCAL}")/test-zone/**")
69+
-not -path "$(realpath "${LOCAL}")/test-zone/**" \
70+
-not -path "$(realpath "${LOCAL}")/venv/**")
7071
done
7172
if [[ "${failed}" = "true" ]]; then exit; fi

0 commit comments

Comments
 (0)