Skip to content

fix: remove python version constraint for typing_extensions to prevent import errors for >=3.8#21

Merged
demberto merged 1 commit intodemberto:masterfrom
ttaschke:fix-typing-extensions-dependency
Sep 14, 2022
Merged

fix: remove python version constraint for typing_extensions to prevent import errors for >=3.8#21
demberto merged 1 commit intodemberto:masterfrom
ttaschke:fix-typing-extensions-dependency

Conversation

@ttaschke
Copy link
Copy Markdown
Contributor

Importing pyflp after installation with pip install -e . on newer Python version (>=3.8) throws a ModuleNotFoundError, because typing_extensions is imported, but not installed for newer Python versions.

Example:

Python 3.10.7 (main, Sep  7 2022, 22:40:42) [GCC 11.2.1 20220219] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyflp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/python_project/pyflp/__init__.py", line 53, in <module>
    from .project import VALID_PPQS, FileFormat, Project, ProjectID
  File "/python_project/pyflp/project.py", line 31, in <module>
    from typing_extensions import Unpack
ModuleNotFoundError: No module named 'typing_extensions'

After applying this fix importing pyflp works without throwing an error.
(Parsing example is just to show that pyflp was imported correctly, the error thrown is unrelated to the typing_extension problem)

Python 3.10.7 (main, Sep  7 2022, 22:40:42) [GCC 11.2.1 20220219] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyflp
>>> project = pyflp.parse("../test_data/melody.flp")
/python_project/pyflp/pyflp/__init__.py:151: RuntimeWarning: Event 212 not parsed entirely; parsed 18, found 52 bytes
  events.append(event_type(id, value))
/python_project/pyflp/pyflp/__init__.py:151: RuntimeWarning: Event 215 not parsed entirely; parsed 158, found 168 bytes
  events.append(event_type(id, value))

@demberto
Copy link
Copy Markdown
Owner

Hmm yea, I kinda just overlooked the constraint. Thanks.

@demberto demberto merged commit 29bdd21 into demberto:master Sep 14, 2022
@ttaschke ttaschke deleted the fix-typing-extensions-dependency branch September 14, 2022 07:51
@demberto
Copy link
Copy Markdown
Owner

@allcontributors please add @ttaschke for code

@allcontributors
Copy link
Copy Markdown
Contributor

@demberto

I've updated the pull request to add @ttaschke! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants