niftools / pyffi

PyFFI is a Python library for processing block structured files.
http://www.niftools.org/pyffi
Other
47 stars 26 forks source link

Not able to import from pyffi.formats.nif import NifFormat in Python 3.8 #78

Closed bunyk closed 2 years ago

bunyk commented 2 years ago

@niftools/pyffi-reviewers

Issue Overview

[Provide high level overview of the issue and why it is relevant to this repository]

Version Information

Pyffi Version Info

pyffi-2.2.3

Platform information

Ubuntu Linux

Steps to Reproduce

  1. $ pip3 install pyffi
  2. $ python
  3. >>> from pyffi.formats.nif import NifFormat

Expected Result

NifFormat available in current scope

Actual Result

Traceback:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
    from pyffi.formats.nif import NifFormat
  File "/home/tbunyk/.local/lib/python3.8/site-packages/pyffi/formats/nif/__init__.py", line 361, in <module>
    import pyffi.formats.bsa
  File "/home/tbunyk/.local/lib/python3.8/site-packages/pyffi/formats/bsa/__init__.py", line 125, in <module>
    class BsaFormat(pyffi.object_models.xml.FileFormat):
  File "/home/tbunyk/.local/lib/python3.8/site-packages/pyffi/object_models/xml/__init__.py", line 104, in __init__
    start = time.clock()
AttributeError: module 'time' has no attribute 'clock'

Possible Fix

The function time.clock() has been removed, after having been deprecated since Python 3.3: use time.perf_counter() or time.process_time() instead. stackoverflow

bunyk commented 2 years ago

Oh, it's fake alert, I'm sorry. Turns out this was fixed 2 years ago: https://github.com/niftools/pyffi/commit/cf2d5c7a8be55e87e47af9659e03a3e9aba01584, but package on PyPI is older. Maybe It's time to release new version there?

neomonkeus commented 2 years ago

Yeah, technically the release here is newer but we opted to not push to pypi as there are issues with it. There is currently work ongoing to rework this.

bunyk commented 2 years ago

Ok, if there is no plans to support PyPi, maybe then remove section from Readme that advices to pip3 install PyFFI?

neomonkeus commented 2 years ago

Its not that there is no plans, it is just that there is no point in pushing the current version as it is more broken than the previous version. Python compatibility is the main issue here, but effectively we will be replacing pyffi with a different library which is more maintainable going forward.

Thats not to say that if you wanted to branch from the previously working tag and cherrypick the commit we couldn't publish a step release.