93d22d82988ee781feddf84535d65adf44472379
Commit Graph

80 Commits

Author SHA1 Message Date
Zuul
80758e6932 Merge "Always install python3 and its dev package" 2020年02月15日 16:01:08 +00:00
Radosław Piliszek
29bf852396 Do not try finding pip for python2 when not required
[1] stopped installing pip for py2 when py3 is being used.
This patch makes sure we check only for py3 pip then.
Also removed some no-longer-relevant comment and
made uninstall behave the same.
Check for pip>=6 removed too.
See also [2].
[1] 279a7589b0
[2] http://lists.openstack.org/pipermail/openstack-discuss/2020-January/012182.html
Change-Id: I36ee53e57e468d760b80a7e621b90899867a8efd
2020年01月24日 12:55:21 +01:00
Terry Wilson
78cf6f642a Always install python3 and its dev package
Some distros do not install python3/python3-devel with the minimal
install. F29 doesn't install -devel, and neither Centos 7 or 8
install either. This patch ensures that these packages get installed.
Ideally, PYTHON3_VERSION would be set *after* ensuring that python3
was installed, but it gets a little tricky with all of the includes.
This sets it to 3.6 as nothing uses 3.5 anymore.
Change-Id: I7bdfc408b7c18273639ec26eade475856ac43593
2020年01月22日 20:03:29 -06:00
Stephen Finucane
6b6bdc7111 inc/python: Remove ability to mark packages as non-Python3
Everything in OpenStack *must* be Python 3 supporting now, which means
it's time to remove the functionality that allows us to blacklist
packages that didn't support Python 3.
Change-Id: I7c8cf538ec88bd4056b0109f19671e3d65f5da3a
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020年01月17日 11:19:16 +00:00
Ian Wienand
bcb2c30c31 Remove TRACK_DEPENDS
This was added in 2012 with I89677fd54635e82b10ab674ddeb9ffb3f1a755f0,
but I can not see it being used anywhere currently.
It's use of virtualenv's has become problematic in a python2
deprecated world, but since it is not used, remove it to avoid further
confusion.
Change-Id: I65d44d24f449436ca6229928eee2c5a021793055
2020年01月13日 16:31:20 +11:00
Peter Penchev
16bccbcea4 Revert "install LIBS_FROM_GIT using python 2 and 3 where appropriate"
All the OpenStack projects should be able to run under Python 3 now so
the fallback installation of the Python 2 libraries should not be
needed any longer. This also avoids the problem of script files
installed by the libraries sometimes being overwritten by the Python 2
version leading to incorrect execution later, as discussed in
http://lists.openstack.org/pipermail/openstack-discuss/2019-September/009226.html
This reverts commit a2eb89417f.
Change-Id: I1cdb7e4a209872f1620be556b7278879a4b86df5
2019年09月09日 15:14:11 +03:00
Matt Riedemann
9b6d2f20b4 Update (git|review).openstack.org links to opendev
This updates links going to git.openstack.org and review.openstack.org
to go to their respective opendev locations to avoid redirects.
Change-Id: I78e3bb5303718962f591117f9c0ee11f2314b128
Closes-Bug: #1833256 
2019年06月21日 14:35:16 +10:00
Tom Barron
4db9d567d1 Safety check for python version in get_pip_command
We know empirically that some legacy gate jobs pass and appear
to be running with python3 but actually pip was invoked with
PYTHON3_VERSION unset so that they are actually ran with python2
packages.
As a followup to this discussion [1], add a safety check in the
get_pip_command function to ensure that a python version has been
set when it is invoked.
[1] https://review.openstack.org/#/c/622415/4/inc/python@283
Change-Id: I3a08406fb7d68282c6b98abb33a625821510046a
2019年05月20日 06:01:35 +00:00
Matt Riedemann
e03bcb2c8b Remove crusty old python 3 package version logic
If we are running with python3, just assume that any
package that is not blacklisted is available for py3
and just attempt to install it and let pip sort it out
whether it gets installed from a local or remote package.
Change-Id: Ic05d183e489320f6dfc721575d47e7e4d661f87c
Closes-Bug: #1820892 
2019年04月02日 10:13:13 +00:00
Zuul
8ca63acff8 Merge "Fixed support python 2 on Fedora 27" 2019年03月30日 00:45:27 +00:00
Lenny Verkhovsky
a30dd1cc96 Fixed support python 2 on Fedora 27
I7d16194d6ba1391ca31251d5b50cbb8de033fc38 added wrong behavour
on Fedora > 26 and Centos 7 when python3 disabled
pip should install packages in /usr/bin
Closes-Bug: #1820070
Change-Id: I3a8efbc8eb6e311db9c7347577c5d2047ba523a9
2019年03月24日 11:46:45 +02:00
Matt Riedemann
ddb6179b04 Ease python 3 classifier check in check_python3_support_for_package_local
This makes the grep match in check_python3_support_for_package_local
the same as check_python3_support_for_package_remote.
Change I0349de2026c49279ba7f262d5e86d37018d66326 in grenade started
setting the PYTHON3_VERSION variable, and then we recently started
using bionic nodes everywhere which means we're running python 3.6.
The etcd3gw package has a python 3 and 3.5 classifier, but not 3.6:
https://pypi.org/project/etcd3gw/
The pip_install function code that is dealing with installing py3
packages is hitting a problem installing etcd3gw if the package is
local because of the more restrictive grep in the
check_python3_support_for_package_local function, and since
PYTHON3_VERSION=3.6 now, we don't install from py3 and install
etcd3gw on python 2.7 which makes services like cinder-volume and
cinder-backup, which use etcd3gw, fail when they are running under
python 3 (they get module import errors).
This simply removes the $ restriction on the grep. Looking at the
change that added those local/remote functions:
 I243ea4b76f0d5ef57a03b5b0798a05468ee6de9b
There is no explanation for the difference, it just said:
 Also, since not many packages are classified correctly, fallback
 to looking for just "Programming Language :: Python :: 3" and
 log a message for the package to highlight the problem.
So that's what this change does.
Note that alternatives would be:
1. Update the etcd3gw package to add the 3.6 classifier and do
 a release (this should probably happen anyway).
2. Add etcd3gw to ENABLED_PYTHON3_PACKAGES but that would be a
 short-term hack workaround.
Change-Id: Icd3768870ba0f1659bb2e6f002043d975047b73e
Closes-Bug: #1820892 
2019年03月19日 15:04:12 -04:00
Sean Mooney
c759706686 support python 3 on centos 7
when installing with python 3.6 on centos7 pip installs
packages to /usr/local/bin as it does on new versions
of fedora.
this change updates the check to include centos
Change-Id: I7d16194d6ba1391ca31251d5b50cbb8de033fc38
2019年02月28日 11:24:05 +00:00
Zuul
f3302dcee3 Merge "Add options for development bindep install" 2019年02月06日 16:34:57 +00:00
Ian Wienand
58243f6203 Add options for development bindep install
This adds a -bindep option to the key development library install
functions. With this option the bindep.txt file will be referenced
and the relevant packages installed.
Change-Id: I856f1f59fca49b6020920d8f859b797f3b904300
2019年01月14日 16:35:12 +11:00
Doug Hellmann
36377f63e3 install under python3 by default when enabled
Remove the requirement that services explicitly enable python3 support
in order to be tested under python3 when running with python3
enabled. Keep the enable_python3_package() function for backwards
compatibility, for now, since it is called in some devstack plugins.
Explicitly add swift to the set of packages that should not be installed
using python3 by default until full support is available.
Change-Id: I8ab0a7c242bbf5bf3f091f5a85a98e2f4543f856
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2019年01月09日 09:05:36 -05:00
Andreas Jaeger
67394b0241 Remove is_in_projects_txt
This function is nowhere used as confirmed by codesearch:
http://codesearch.openstack.org/?q=is_in_projects_txt&i=nope&files=&repos=
We can remove the function.
Note that usage of this function was removed in change
I843208e2e982eb04931b76f5cb4bd219fbcd70de in 2015.
This came up in context of https://review.openstack.org/619089 where
requirements/projects.txt is getting removed.
Change-Id: I487d3f9e340bd45e83245b9ca91e8e3b5ac3ae02
2018年11月24日 10:18:07 +01:00
imacdonn
e991f7da45 Use bash-style test for Fedora version
Old-style test fails on Ubuntu when python3 enabled, with:
.../devstack/inc/python: line 52: [: 16.04: integer expression expected
Use bash-style test, which doesn't attempt to evaluate the RHS if the
LHS evaluates to false
Change-Id: If18031ab98c9060e5825c3a8d3c647bd3705cd9c
Closes-Bug: #1796174 
2018年10月04日 19:42:21 +00:00
Zuul
a0f319fc6d Merge "Automatically set LIBS_FROM_GIT based on required projects" 2018年04月19日 12:44:31 +00:00
James E. Blair
e1edde38ed Automatically set LIBS_FROM_GIT based on required projects
If a project shows up in zuul's required-projects list, add it
to LIBS_FROM_GIT automatically. This way, when a user specifies
that a job requires a zuul-project, it gets used in testing, but
otherwise, it doesn't (pypi is used instead).
Also add information about what happens behind the scenes for both
LIBS_FROM_GIT and plugin dependencies.
This moves the check performed in check_libs_from_git to
a helper function which is installed for most kinds of
installations. This means that if someone sets LIBS_FROM_GIT to
"foobar", devstack won't error anymore, as nothing is going to
try to install foobar, therefore the check won't run on that.
However, as we move to automated generation of the local config,
that error is not likely to happen. This check was originally
added due to an error in the upper-constraints file (where a
constraint name did not match a package name). This location of
the check would still catch that type of error.
Change-Id: Ifcf3ad008cf42d3d4762cfb3b6c31c93cfeb40db
2018年04月17日 13:48:37 -07:00
Monty Taylor
236250f1c3 Rename python-openstacksdk to openstacksdk
Change-Id: Ia77163f330f674146b369dfebea56bd97820057e
Depends-On: https://review.openstack.org/554662 
2018年03月23日 08:27:57 -05:00
Victor Stinner
b9891eea1f Fix Python3 get_python_exec_prefix on Fedora 27
On Fedora 27, the default Pytho 3 install prefix changed from /usr
to /usr/local:
https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
Closes-Bug: #1741901
Change-Id: Id40620efdf173189df053b5d380a801092933f83
2018年01月09日 11:22:39 +01:00
Monty Taylor
e46f22db7f Add workaround for openstacksdk in check_libs_from_git
python-openstacksdk does not match its pip name which is openstacksdk.
So setting python-openstacksdk in LIBS_FROM_GIT leads to devstack
thinking there is a problem.
Put in a workaround for now. It would be better to either:
 a) rename python-openstacksdk repo to openstacksdk
 b) rename the pip name for openstacksdk back to python-openstacksdk
 c) add general support in the various GIT hashes for a pip name
Change-Id: I57cf95763d54ad2060a4ce2af91c3ba18ca04db0
2017年12月03日 10:21:26 -06:00
DamonLi
007f588f27 Convert to safe name in lib_installed_from_git
The 'pip list' command prints the "safe name" which converts _'s to
-'s amongst other things; e.g. glance_store becomes
 "glance-store 0.21.1.dev22 /opt/stack/glance_store"
Because people may use these more familiar "file system" names in
LIBS_FROM_GIT automatically convert names when checking if libraries
are installed.
Change-Id: I30524f80a341f38dfa794a8f629d859e85a4a448
2017年11月28日 07:34:49 +11:00
rabi
b5fb7fd627 Fix lib_installed_from_git
In commit f0cd9a8b08 we changed to
use column format, but it checks for zero length string and
check_libs_from_git fails.
Change-Id: I97b52b80efb33749647229a55147a08afa112dd2
2017年11月22日 10:09:30 +05:30
Zuul
ec31a52560 Merge "Update lib_install_from_git to use column format" 2017年11月21日 20:04:33 +00:00
Clark Boylan
065779517f Properly get pip version
The old code was strip()ing the version string instead of split()ing the
version string so we always got the first character of the version
string. This worked fine as long as the pip version was single digit but
as soon as it rolls over to '10.stuff' we will compare:
 pip version 1 (instead of 10) > 6
Which fails bceause 1 is less than six. Instaed we really do want to
compare 10 > 6 so use split on '.' instead.
Change-Id: Ic7d0c04d7fa77774ab2d70fb9d11f182becec553
2017年10月20日 12:16:32 -07:00
Monty Taylor
f0cd9a8b08 Update lib_install_from_git to use column format
The pip list command supports a --format=columns option which outputs
things in space delimited columns. Switch to using that.
Change-Id: I5140a7d83bf567b1c3c67516112eb4c57074fa53
2017年10月19日 15:35:38 +11:00
Zane Bitter
9e7ead9ac2 Calculate package directory correctly in pip_install
Strip the [<extras>] string from a <package_dir>[<extras>] argument
when looking for the package directory. Explain what the heck is
going on.
Change-Id: I79beb5c3e9e7c35c91cdd0d5a1d91532bebc4b6d
Closes-Bug: #1721638 
2017年10月06日 22:19:05 +11:00
Ian Wienand
ae9c6ab759 Use "pip list" in check_libs_from_git
As described in the change, "pip freeze" has issues with the way
zuulv3 clones repos without a remote. This is an attempt to use "pip
list" to check for local install
Change-Id: I33d25f86b6afcadb4b190a0f6c53311111c64521
2017年09月29日 12:55:45 +10:00
Sampath Priyankara
87d2396d22 Don't uninstall pip packages if OFFLINE=True
lib/nova does a pip re-install of libvirt-python to rebuild the python
library incase the underlying libvirt version changed during package
installs. In offline mode, the underlying version of libvirt can't
have changed; so we have the situation that we've removed the libvirt
python bindings but can't reinstall them (because we're offline).
This fixes that particular situation, but skipping uninstalls in
offline mode seems generically OK.
Change-Id: I2b75d45d94d82f87d996c7570c125d46f5f99f6a
Closes-Bug: #1708369 
2017年08月14日 16:03:41 +10:00
Takashi NATSUME
fa0077707e Update URLs
Some URLs are broken, so fix them.
The others are redirect to new URLs,
so replace them with new ones.
The config options of nova serial console proxy
have been gathered in nova/conf/serial_console.py.
So the description in doc/source/guides/nova.rst
is fixed.
Change-Id: Ifd81cc09969341fbf8f135a913fc6003b94e0acc
2017年07月22日 09:12:59 +09:00
Clark Boylan
f266a2dc81 Install test-requirements with main install
To reduce the total number of invocations necessary for pip which isn't
the quickest thing ever (due to needing to evaluate constraints and deps
lists and what is currently installed) combine the main installation of
software with its test-requirements.txt file which should roughly halve
our pip invocations.
Change-Id: Ibcc3264136e66d34a879ad1c90a62e1bb6a84243
2017年06月12日 14:57:59 -07:00
Brian Haley
954fd1b729 Use -y with 'pip uninstall'
'pip uninstall' will hang running stack.sh if it has to
prompt the user for input, use -y.
Change-Id: Ic94639e444b87fd3538463d5a51c01a0208a2ab2
Closes-bug: #1691172 
2017年05月16日 12:24:45 -04:00
Sean Dague
f28e7ef6ba uninstall libvirt-python and reinstall
libvirt-python compiles against the currently installed libvirt. If
you upgrade that, it needs to rebuild, however it won't change
versions, so pip install just noops. Force an uninstall / reinstall of
it every time to handle potential upgrades of libvirt.
Change-Id: If34541b34aa6d55eedaf6c603fd1fe92eb887308
2017年05月08日 07:30:20 -04:00
Armando Migliaccio
bacfb94390 Enable openSUSE to work in Python 3.x environments
Add packages required to run devstack with USE_PYTHON3=True.
Change-Id: Iee43c9335bd82c10cfaeffb02d1d99290c34bb83
2017年03月20日 22:33:56 -07:00
Jenkins
6523d6e097 Merge "Make declared variables global" 2017年03月08日 13:31:57 +00:00
Sean Dague
afef8bf097 Make declared variables global
When variables use the 'declare' directive, it is by default a local
variable. While other variables have global scope.
For example:
 declare -A AN_ARRAY # local in scope
 foo=1 # global in scope
This causes errors to occur as some of the variables will be local only
and others will be global.
Update the code, as appropriate, so that variables using the 'declare'
directive also include the '-g' flag to have them also be global. Not
every instance of a declared variable has been updated.
Closes-Bug: #1669509
Co-Authored-By: John L. Villalovos <john.l.villalovos@intel.com>
Change-Id: I2180b68fe861ad19c6d4ec0df0f9f8a528347862
2017年03月07日 22:07:29 -08:00
Jenkins
0e1e78117e Merge "install LIBS_FROM_GIT using python 2 and 3 where appropriate" 2017年02月28日 16:37:49 +00:00
Jenkins
259c5e19a7 Merge "allow config to manage python3 use explicitly" 2017年02月28日 16:37:20 +00:00
Sean Dague
f80e2cfee8 add install_devstack_tools
An initial install for devstack-tools, this will need to use all the
fun pip extra variables for installation, however the current
pip_install always prefers python2, and we only want to do python3
here.
Change-Id: I3dcdb35130f76fad81cb7b0d4001b7e96efbbd84
2017年01月18日 15:42:53 -05:00
Doug Hellmann
a2eb89417f install LIBS_FROM_GIT using python 2 and 3 where appropriate
When installing a library from source and python 3 is enabled, first run
the installation process with python 2 enabled to ensure the library is
also installed under python 2 for any services not yet running under
3. The python 3 version is installed second so that command line tools
installed with libraries are installed under python 3 when python 3 is
enabled.
Change-Id: Ibb0f7a68d21081bf7652a0c1515080c0c54888ca
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017年01月10日 16:08:43 +00:00
Doug Hellmann
94129c7d02 allow config to manage python3 use explicitly
Add variables ENABLED_PYTHON3_PACKAGES and DISABLED_PYTHON3_PACKAGES to
work like ENABLED_SERVICES and DISABLED_SERVICES and to manage which
packages are installed using Python 3. Move the list of whitelisted
packages in pip_install to the default for ENABLED_PYTHON3_PACKAGES,
except swift which is not enabled by default for now.
Add enable_python3_package and disable_python3_package functions to make
editing the variables from local.conf easier.
Add python3_enabled_for and python3_disabled_for functions to check the
settings against packages being installed by pip.
Update pip_install to check if python3 is disabled for a service, then
see if it is explicitly enabled, and only then fall back to looking at
the classifiers in the packaging metadata.
Update pip_install messages to give more detail about why the choice
between python 2 and 3 is being made for a given package.
Change-Id: I69857d4e11f4767928614a3b637c894bcd03491f
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017年01月10日 16:08:14 +00:00
Mehdi Abaakouk
52b1074615 cinder: configure dlm when this one is zookeeper
Previous this was set the zake, but that was revert to missing
dependencies issue and because zake is a test fixture and not somthing
to deploy.
This change configures the Cinder dlm with this one is zookeeper.
And it installs tooz and the extra dependencies needed for the
zookeeper driver.
To do it, this commit have to introduce a new method for package
installation: 'pip_install_gr_extras package extra1,extra2'.
Change-Id: Idca310c08e345db59840eb31434c6cb1f849fa70
2017年01月04日 10:21:29 +01:00
Davanum Srinivas
0c0d848b8c Add swift and uwsgi to py35 whitelist
Really close to getting swift and keystone under uwsgi working, so
let's white list them. Won't affect any existing jobs, so we should
be good.
Change-Id: I51d56d16a5b175bd45dee09edc0b2748d72a5d06
2017年01月03日 08:52:28 -05:00
Davanum Srinivas
afa8a00c14 Switch to python 3.5
Use trueorfalse to normalize the values for USE_PYTHON3
Install 3.5 instead of 3.4 When USE_PYTHON3 is specified.
Also, since not many packages are classified correctly, fallback
to looking for just "Programming Language :: Python :: 3" and
log a message for the package to highlight the problem.
Also special case some services that are *almost* ready
Depends-On: Id48e1b328230fcdf97ed1cb4b97f4c3f9cf6eb8a
Depends-On: Ib7d9aa0e0b74a936002e0eea0b3af05102b06a62
Change-Id: I243ea4b76f0d5ef57a03b5b0798a05468ee6de9b
2016年12月23日 13:15:03 -05:00
Lubosz "diltram" Kosnik
0a099763b0 Change python version to 3.5
On Ubuntu Xenial there is no way to install python3.4
Use value specified in PYTHON3_VERSION
Change-Id: Ibc69b1c8270bdd240c82cf2acfdfd0730ef0f182
2016年08月03日 10:21:41 -05:00
Spyros Trigazis
88ccd47c88 Keep old behavior of setuptools for editable installs
In the 25.0.0 release [1] of setuptools during any install
operation the package in not overwritten. If a package is
installed from another requirement via pip and then it is
installed again from git, it is not updated causing
check_libs_from_git to fail.
[1] https://setuptools.readthedocs.io/en/latest/history.html#v25-0-0
Change-Id: Ibaa1d4157816ea649f4452756fbde25951347001
Closes-Bug: #1605998 
2016年07月25日 14:31:51 +02:00
Marc Koderer
46f8cb7f20 Add option to download all libs from git
For client debugging that invokes multiple libs it can be useful
to have all libs directly in git and not listing all of them
in LIBS_FROM_GIT.
TrivialFix
Change-Id: Ie631cc4045231ebbe8177d2d113e47e4bf83f61c
2016年05月17日 08:57:39 +02:00
YAMAMOTO Takashi
c8c1c615f2 Normalize path for upper-constraints
It seems pip distinguishes paths with .. or extra / for constraints.
For example, the following directories are considered different.
 /path/to/dir
 /path/to//dir
 /path/to/dir/subdir/..
This commit tries to normalize the given directory name to avoid
"Could not satisfy constraints for 'xxxx': installation from path
or url cannot be constrained to a version" error due to directory
name mismatch.
Reference: https://github.com/pypa/pip/pull/3582
Closes-Bug: #1542545
Change-Id: Iae9d58c27d3b10bca16e4a471507c4d5c16439a0
2016年03月22日 21:23:23 +09:00