cms-gem-daq-project / gem-plotting-tools

Repository for GEM commissioning plotting tools
GNU General Public License v3.0
1 stars 26 forks source link

Bug Report: gemplotting rpm built with restriction on tabulate in python2.7 #140

Closed bdorney closed 5 years ago

bdorney commented 6 years ago

Brief summary of issue

The rpm of gemplotting seems to be restricting the tabulate requirement for python 2.7 which should not occur.

Types of issue

Expected Behavior

When built with python 2.7.5 I would have expected the upper limit of tabulate in

https://github.com/cms-gem-daq-project/gem-plotting-tools/blob/7e938ab763bc4a4e38183a9cbf1e9e4a55ba3918/requirements.txt#L8-L11

To be ignored, e.g. line 11 should be used.

Current Behavior

Package was built on gem904qc8daq outside of a virtualenv which has correct version of python:

% python --version
Python 2.7.5

So based on this I would expect the upper limit on tabulate is ignored:

https://github.com/cms-gem-daq-project/gem-plotting-tools/blob/7e938ab763bc4a4e38183a9cbf1e9e4a55ba3918/requirements.txt#L8-L11

However when trying to install it:

[root@ctp7-pc rpms]# yum install gempython_gemplotting-1.0.0-centos7.python2.7.x86_64.rpm
Failed to set locale, defaulting to C
Loaded plugins: changelog, fastestmirror, kernel-module, langpacks, protectbase, tsflags, versionlock
Examining gempython_gemplotting-1.0.0-centos7.python2.7.x86_64.rpm: gempython_gemplotting-1.0.0-centos7.python2.7.x86_64
Marking gempython_gemplotting-1.0.0-centos7.python2.7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package gempython_gemplotting.x86_64 0:1.0.0-centos7.python2.7 will be installed
--> Processing Dependency: tabulate < 0.8 for package: gempython_gemplotting-1.0.0-centos7.python2.7.x86_64
Loading mirror speeds from cached hostfile
794 packages excluded due to repository protections
--> Finished Dependency Resolution
Beginning Kernel Module Plugin
Finished Kernel Module Plugin
Error: Package: gempython_gemplotting-1.0.0-centos7.python2.7.x86_64 (/gempython_gemplotting-1.0.0-centos7.python2.7.x86_64)
           Requires: tabulate < 0.8
           Installed: tabulate-0.8.2-1.noarch (installed)
               tabulate = 0.8.2-1
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

The machine being installed on is cc7 with python2.7.5.

Is there an actual reason for restricting the upper limit on tabulate here? The version of gem904qc8daq is:

% yum info tabulate
Loaded plugins: changelog, fastestmirror, kernel-module, langpacks, protectbase, tsflags, versionlock
Determining fastest mirrors
epel                                                                                                                                                                                                                        12611/12611
236 packages excluded due to repository protections
Installed Packages
Name        : tabulate
Arch        : noarch
Version     : 0.8.2

But this of course uses python 2.7.5

Steps to Reproduce (for bugs)

  1. Build gemplotting from 7e938ab on a cc7 python 2.7.5 machine
  2. Install rpm

Possible Solution (for bugs)

Drop support for python2.6 (I think only gem904daq03 is using it...?) and remove line 10 of:

https://github.com/cms-gem-daq-project/gem-plotting-tools/blob/7e938ab763bc4a4e38183a9cbf1e9e4a55ba3918/requirements.txt#L8-L11

Context (for feature requests)

Fails to install.

Your Environment

bdorney commented 6 years ago

@jsturdy correctly pointed out that it is this file that is referenced:

https://github.com/cms-gem-daq-project/gem-plotting-tools/blob/7e938ab763bc4a4e38183a9cbf1e9e4a55ba3918/pkg/setup.cfg#L54-L62

What is the specific reason for the restriction on tabulate @lmoureaux

lmoureaux commented 6 years ago

What is the specific reason for the restriction on tabulate @lmoureaux

Support both Python 2.6 and 2.7 with the same rpm (see the restrictions in requirements.txt).

bdorney commented 6 years ago

Support both Python 2.6 and 2.7 with the same rpm (see the restrictions in requirements.txt).

This is poor reasoning, as it specifically breaks the rpm installation on a machine that does not need this restriction. Case and point, the working machine gem904qc8daq.

jsturdy commented 6 years ago

Yes, the proper solution will be to figure out how to specify the correct requirement in the bdist_rpm section based on the python version, or somehow parse it from the requirements file.

When @lmoureaux initially added this dependency, I didn't quickly see any clean way to make it work so didn't bother with it, but just rebuilt RPMs for cc7 machines based on the tabulate version I was able to download, and turn into an RPM (some earlier versions of tabulate weren't building an RPM due to packaging I think)

lmoureaux commented 6 years ago

Just checked the requires syntax didn't allow complex dependencies before rpm 4.13 (have to support 4.8).

bdorney commented 6 years ago

Alternatively dropping support for python 2.6 would be equally advantageous; there is only one machine at CERN which is still slc6 (native py2.6) and it is in 904, not running any test stands...

bdorney commented 5 years ago

Closing as irrelevant, with the move from slc6 to cc7 python2.6 is no longer used.