Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Sep 14, 2022

Conversation

ttaschke
Copy link
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
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
Owner

@allcontributors please add @ttaschke for code

@allcontributors
Copy link
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.

None yet

2 participants