Bug 1584773

Summary: py3-lesscpy fails to build freeIPA UI code
Product: [Fedora] Fedora Reporter: Rob Crittenden <rcritten>
Component: python-lesscpyAssignee: Matthias Runge <mrunge>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: cheimes, mrunge
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-lesscpy-0.13.0-2.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1590234 (view as bug list) Environment:
Last Closed: 2018-06-15 15:50:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1590234    

Description Rob Crittenden 2018-05-31 15:38:42 UTC
Description of problem:

The python2-lesscpy package can successfully build the freeIPA web UI but the python3-lesscpy build fails.

This blocking the IPA project from moving to a python3 build environment.

Version-Release number of selected component (if applicable):

python2-lesscpy-0.10.1-13.fc28.noarch
python3-lesscpy-0.10.1-13.fc28.noarch

How reproducible:

Every time

Steps to Reproduce:
1. git clone https://github.com/freeipa/freeipa.git
2. cd freeipa/install/ui/css/
3. ../util/make-css.sh

[ should succeed as it is using /usr/bin/lesscpy ]

4. Edit ../util/make-css.sh and change lesscpy to py3-lesscpy
5. ../util/make-css.sh

Actual results:

$ ../util/make-css.sh 
Traceback (most recent call last):
  File "/usr/bin/py3-lesscpy", line 16, in <module>
    compiler.run()
  File "/usr/lib/python3.6/site-packages/lesscpy/scripts/compiler.py", line 177, in run
    p.parse(filename=args.target, debuglevel=args.debug)
  File "/usr/lib/python3.6/site-packages/lesscpy/lessc/parser.py", line 91, in parse
    filename, lexer=self.lex, debug=debuglevel)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 331, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/usr/lib/python3.6/site-packages/ply/yacc.py", line 1118, in parseopt_notrack
    p.callable(pslice)
  File "/usr/lib/python3.6/site-packages/lesscpy/lessc/parser.py", line 189, in p_statement_import
    recurse.parse(filename=filename, debuglevel=0)
  File "/usr/lib/python3.6/site-packages/lesscpy/lessc/parser.py", line 92, in parse
    self.post_parse()
  File "/usr/lib/python3.6/site-packages/lesscpy/lessc/parser.py", line 103, in post_parse
    out.append(pu.parse(self.scope))
  File "/usr/lib/python3.6/site-packages/lesscpy/plib/block.py", line 43, in parse
    inner = list(utility.flatten([p.parse(scope) for p in inner if p]))
  File "/usr/lib/python3.6/site-packages/lesscpy/plib/block.py", line 43, in <listcomp>
    inner = list(utility.flatten([p.parse(scope) for p in inner if p]))
  File "/usr/lib/python3.6/site-packages/lesscpy/plib/property.py", line 39, in parse
    self.parsed = self.process(style, scope)
  File "/usr/lib/python3.6/site-packages/lesscpy/plib/node.py", line 49, in process
    for t in tokens]
  File "/usr/lib/python3.6/site-packages/lesscpy/plib/node.py", line 49, in <listcomp>
    for t in tokens]
  File "/usr/lib/python3.6/site-packages/lesscpy/plib/call.py", line 57, in parse
    result = getattr(color, name)(*args)
  File "/usr/lib/python3.6/site-packages/lesscpy/lessc/color.py", line 256, in darken
    return self._ophsl(color, diff, 1, operator.sub)
  File "/usr/lib/python3.6/site-packages/lesscpy/lessc/color.py", line 432, in _ophsl
    return self._rgbatohex(color)
  File "/usr/lib/python3.6/site-packages/lesscpy/lessc/color.py", line 405, in _rgbatohex
    for h in rgba]
  File "/usr/lib/python3.6/site-packages/lesscpy/lessc/color.py", line 401, in <listcomp>
    return '#%s' % ''.join(["%02x" % v for v in
TypeError: %x format: an integer is required, not float

Comment 1 Christian Heimes 2018-06-11 10:04:44 UTC
lesscpy 0.13 works fine. The bug has been fixed in commit https://github.com/lesscpy/lesscpy/commit/b87fa0d3241139f8aff52ea79cff50bd12eadd7a .

Comment 2 Christian Heimes 2018-06-11 10:12:54 UTC
I have created PR https://src.fedoraproject.org/rpms/python-lesscpy/pull-request/2 to update the Fedora package to 0.13.0.

Comment 3 Christian Heimes 2018-06-12 09:24:45 UTC
Thanks Matthias for the quick fix.

Please update F28 as well. FreeIPA's build system requires the fix on F28, too.

Comment 4 Fedora Update System 2018-06-12 10:03:18 UTC
python-lesscpy-0.13.0-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-815553db09

Comment 5 Fedora Update System 2018-06-12 15:12:31 UTC
python-lesscpy-0.13.0-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-815553db09

Comment 6 Fedora Update System 2018-06-13 20:10:57 UTC
python-lesscpy-0.13.0-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-32125fc6b0

Comment 7 Fedora Update System 2018-06-14 20:22:37 UTC
python-lesscpy-0.13.0-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-32125fc6b0

Comment 8 Fedora Update System 2018-06-15 15:50:06 UTC
python-lesscpy-0.13.0-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.