Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.buildout
Commits
264eab26
Commit
264eab26
authored
Nov 26, 2021
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: Circle CI job fails
Solution: install proper pip
parent
e16ea57b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
3 deletions
+38
-3
.circleci/config.yml
.circleci/config.yml
+8
-1
builds/bare_machines/ci_build.sh
builds/bare_machines/ci_build.sh
+3
-0
dev.py
dev.py
+27
-2
No files found.
.circleci/config.yml
View file @
264eab26
...
...
@@ -10,7 +10,7 @@ jobs:
python-version
:
type
:
string
machine
:
image
:
ubuntu-2004:2021
0
1-01
image
:
ubuntu-2004:2021
1
1-01
environment
:
BUILD_TYPE
:
<< parameters.build-type >>
PYTHON_VER
:
<< parameters.python-version >>
...
...
@@ -35,6 +35,13 @@ jobs:
command
:
sudo apt-get update
-
run
:
command
:
sudo apt install -y build-essential python${PYTHON_VER}-dev
-
when
:
condition
:
matches
:
pattern
:
^3\.10$
value
:
<< parameters.python-version >>
steps
:
-
run
:
sudo apt install -y python${PYTHON_VER}-distutils
-
checkout
-
run
:
command
:
./ci_build.sh
...
...
builds/bare_machines/ci_build.sh
View file @
264eab26
...
...
@@ -5,5 +5,8 @@ set -e
cd
../..
# Some machines come with preinstalled six
# which breaks test suite
pip
${
PYTHON_VER
}
uninstall
-y
six
||
true
python
${
PYTHON_VER
}
dev.py
bin/test
-c
-vvv
dev.py
View file @
264eab26
...
...
@@ -76,25 +76,50 @@ def install_pip():
try
:
import
pip
print
(
''
)
try
:
print
(
subprocess
.
check_output
(
[
sys
.
executable
]
+
[
'-m'
,
'pip'
,
'--version'
],
stderr
=
subprocess
.
STDOUT
,
).
decode
(
'utf8'
))
print
(
'is installed.'
)
except
subprocess
.
CalledProcessError
as
e
:
# some debian/ubuntu based machines
# have broken pip installs
# that cannot import distutils or html5lib
# thus try to install via get-pip
if
(
b"ImportError"
in
e
.
output
or
b"ModuleNotFoundError"
in
e
.
output
):
install_pip
()
raise
e
except
ImportError
:
install_pip
()
######################################################################
def
check_upgrade
(
package
):
print
(
''
)
print
(
'
Check
%s'
%
package
)
print
(
'
Try to upgrade
%s'
%
package
)
print
(
''
)
try
:
sys
.
stdout
.
flush
()
output
=
subprocess
.
check_output
(
[
sys
.
executable
]
+
[
'-m'
,
'pip'
,
'install'
,
'--upgrade'
,
package
],
stderr
=
subprocess
.
STDOUT
,
)
was_up_to_date
=
b"up-to-date"
in
output
or
b"already satisfied"
in
output
if
not
was_up_to_date
:
print
(
output
.
decode
(
'utf8'
))
return
not
was_up_to_date
except
subprocess
.
CalledProcessError
:
except
subprocess
.
CalledProcessError
as
e
:
# some debian/ubuntu based machines
# have broken pip installs
# that cannot import distutils or html5lib
# thus try to install via get-pip
if
(
b"ImportError"
in
e
.
output
or
b"ModuleNotFoundError"
in
e
.
output
)
:
install_pip
()
return
False
raise
RuntimeError
(
"Upgrade %s failed."
%
package
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment