Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1718349 - python-passlib fails to build with Python 3.8
Summary: python-passlib fails to build with Python 3.8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-passlib
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Alan Pevec (Fedora)
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON38
TreeView+ depends on / blocked
 
Reported: 2019-06-07 14:21 UTC by Petr Viktorin
Modified: 2020-06-05 08:31 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-13 07:25:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
proposed fix in RPM TODO propose upstream (1.75 KB, patch)
2019-07-11 09:16 UTC, Alan Pevec (Fedora)
apevec: review? (besser82)
Details | Diff

Description Petr Viktorin 2019-06-07 14:21:45 UTC
python-passlib fails to build with Python 3.8.0b1.

The function time.clock(), used in passlib/utils/__init__.py, has been removed. It was deprecated since Python 3.3. Use time.perf_counter() or time.process_time() instead, depending on your requirements, to have a well defined behavior. 
More info:
https://docs.python.org/3.8/whatsnew/3.8.html#api-and-feature-removals

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.8/fedora-rawhide-x86_64/00926490-python-passlib/

For all our attempts to build python-passlib with Python 3.8, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.8/package/python-passlib/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.8:
https://copr.fedorainfracloud.org/coprs/g/python/python3.8/

Let us know here if you have any questions.

Comment 1 Miro Hrončok 2019-07-08 15:09:54 UTC
This blocks the rebuild of ansible and that might be important for some. Any news, Alan? Could you please prioritize this?

Comment 2 Miro Hrončok 2019-07-08 15:11:12 UTC
Aurelien?

Comment 3 Miro Hrončok 2019-07-10 15:07:12 UTC
Alan, Aurelien, are you responsive?

Comment 4 Alan Pevec (Fedora) 2019-07-11 08:42:16 UTC
This should be fixed upstream, in the meantime since upstream seems stagnant (no commits for 2 years: https://bitbucket.org/ecollins/passlib/commits/all )
we can patch this in RPM.

Comment 5 Alan Pevec (Fedora) 2019-07-11 09:16:25 UTC
Created attachment 1589359 [details]
proposed fix in RPM TODO propose upstream

Comment 6 Alan Pevec (Fedora) 2019-07-11 09:17:09 UTC
Petr, please review proposed patch.

Comment 7 Miro Hrončok 2019-07-11 09:28:36 UTC
Thanks. Petr is on EuroPython, I'll have a look.

Comment 8 Miro Hrončok 2019-07-11 09:49:31 UTC
The patch subject is a bit cryptic: Replace code lifted from timeit with using timeit

Python 2.7 %check failed:

======================================================================
ERROR: Failure: ImportError (cannot import name timer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_apps.py", line 10, in <module>
    from passlib import apps, hash as hashmod
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/apps.py", line 11, in <module>
    from passlib.context import LazyCryptContext
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/context.py", line 16, in <module>
    from passlib.utils import (handlers as uh, to_bytes,
ImportError: cannot import name timer

======================================================================
ERROR: Failure: ImportError (cannot import name timer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_context.py", line 20, in <module>
    from passlib.context import CryptContext, LazyCryptContext
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/context.py", line 16, in <module>
    from passlib.utils import (handlers as uh, to_bytes,
ImportError: cannot import name timer

======================================================================
ERROR: Failure: ImportError (cannot import name timer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_context_deprecated.py", line 23, in <module>
    from passlib.context import CryptContext, CryptPolicy, LazyCryptContext
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/context.py", line 16, in <module>
    from passlib.utils import (handlers as uh, to_bytes,
ImportError: cannot import name timer

======================================================================
ERROR: Failure: ImportError (cannot import name timer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_ext_django.py", line 11, in <module>
    from passlib import apps as _apps, exc, registry
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/apps.py", line 11, in <module>
    from passlib.context import LazyCryptContext
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/context.py", line 16, in <module>
    from passlib.utils import (handlers as uh, to_bytes,
ImportError: cannot import name timer

======================================================================
ERROR: Failure: ImportError (cannot import name timer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_ext_django_source.py", line 13, in <module>
    from passlib.ext.django.utils import DJANGO_VERSION, DjangoTranslator, _PasslibHasherWrapper
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/ext/django/utils.py", line 20, in <module>
    from passlib.context import CryptContext
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/context.py", line 16, in <module>
    from passlib.utils import (handlers as uh, to_bytes,
ImportError: cannot import name timer

======================================================================
ERROR: Failure: ImportError (cannot import name timer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_handlers_django.py", line 16, in <module>
    from passlib.tests.test_ext_django import DJANGO_VERSION, MIN_DJANGO_VERSION
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_ext_django.py", line 11, in <module>
    from passlib import apps as _apps, exc, registry
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/apps.py", line 11, in <module>
    from passlib.context import LazyCryptContext
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/context.py", line 16, in <module>
    from passlib.utils import (handlers as uh, to_bytes,
ImportError: cannot import name timer

======================================================================
ERROR: scram: test handling of 'algs' in context object
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_handlers_pbkdf2.py", line 420, in test_95_context_algs
    from passlib.context import CryptContext
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/context.py", line 16, in <module>
    from passlib.utils import (handlers as uh, to_bytes,
ImportError: cannot import name timer

======================================================================
ERROR: Failure: ImportError (cannot import name timer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_hosts.py", line 10, in <module>
    from passlib import hosts, hash as hashmod
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/hosts.py", line 8, in <module>
    from passlib.context import LazyCryptContext
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/context.py", line 16, in <module>
    from passlib.utils import (handlers as uh, to_bytes,
ImportError: cannot import name timer

======================================================================
ERROR: passlib.registry: verify we have tests for all builtin handlers
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_registry.py", line 221, in test_handlers
    self.assertTrue(get_handler_case(name))
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_handlers.py", line 57, in get_handler_case
    __import__(modname)
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_handlers_django.py", line 16, in <module>
    from passlib.tests.test_ext_django import DJANGO_VERSION, MIN_DJANGO_VERSION
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_ext_django.py", line 11, in <module>
    from passlib import apps as _apps, exc, registry
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/apps.py", line 11, in <module>
    from passlib.context import LazyCryptContext
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/context.py", line 16, in <module>
    from passlib.utils import (handlers as uh, to_bytes,
ImportError: cannot import name timer

======================================================================
ERROR: test is_crypt_context()
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/tests/test_utils.py", line 150, in test_is_crypt_context
    from passlib.context import CryptContext
  File "/builddir/build/BUILD/passlib-1.7.1/passlib/context.py", line 16, in <module>
    from passlib.utils import (handlers as uh, to_bytes,
ImportError: cannot import name timer

----------------------------------------------------------------------
Ran 2636 tests in 155.391s

FAILED (SKIP=1137, errors=11)

Comment 9 Alan Pevec (Fedora) 2019-07-11 09:59:33 UTC
yeah it would help to run tests before posting a patch
BTW running tests on 3.7 produces one more deprecation warning which needs to handled:
passlib/utils/__init__.py:276: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  if isinstance(source, collections.Sequence):

Comment 10 Alan Pevec (Fedora) 2019-07-11 12:39:26 UTC
https://bitbucket.org/apevec/passlib/commits/58f3efd111e930baf39ff50df27ed7f2d24f759d is passing tests on py2 and py3
TODO fix collections ABC usage

Comment 12 Miro Hrončok 2019-07-13 07:25:56 UTC
Thanks for the fix!


Note You need to log in before you can comment on or make changes to this bug.