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

ENH -- Bump Supported Python Versions to 3.9+ #101

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

it176131
Copy link

@it176131 it176131 commented Dec 5, 2024

Description

  • Issue this PR address?

#99

  • Any other information you think is relevant

modified: .github/workflows/python-package.yml

  • Removed 3.6, 3.7, and 3.8 from matrix.python-version and added 3.10, 3.11, 3.12, and 3.13.

modified: README.md

  • Changed supported Python versions from 3.6+ to 3.9+.

Checklist

  • Added and/or updated the test (not required for documentation changes)
  • My changes don't require a change to the documentation, or if they do, I've added all required information

@it176131
Copy link
Author

it176131 commented Dec 5, 2024

I recognize Python 3.13 is still relatively new and some packages, e.g., srsly (explosion/srsly#112), don't work with it yet. I would be willing to remove it from the build-pipeline until 3.13.1 is released, or the issue with srsly is resolved.

Edit


I removed Python 3.13 from the workflow.

	- Removed 3.6, 3.7, and 3.8 from `matrix.python-version` and added 3.10, 3.11, 3.12, and 3.13.

modified:   README.md
	- Changed supported Python versions from 3.6+ to 3.9+.
@it176131
Copy link
Author

it176131 commented Dec 8, 2024

@R1j1t

I'm running local tests to see if the package will build on the new versions. On Python 3.10, test_vocab_file fails with the following UnicodeDecodeError:

FAILED contextualSpellCheck/tests/test_contextualSpellCheck.py::test_vocab_file - UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 13373: character maps to <undefined>

I can get past the error by changing the following line, but this still results in a failed test.

- with open(orgDebugFilePath) as f1:
+ with open(orgDebugFilePath, encoding="latin1") as f1:

Taking a step back, what is the purpose of the following assert statement?

def test_vocab_file():
    ...
    with open(orgDebugFilePath) as f1:
        with open(debugPathFile) as f2:
            assert f1.read() == f2.read()

Edit

I understand now—you're checking that the ContextualSpellCheck correctly writes to the "debugFile.txt" when debug=True.

I was able to get the test (test_vocab_file) to pass by setting encoding="utf8". See 6f8bde1.

	- Set `encoding="utf8"` in :method:`ContextualSpellCheck.__init__` when `debug=True` to resolve failing unit test, :callable:`test_vocab_file`.

modified:   contextualSpellCheck/tests/test_contextualSpellCheck.py
	- Set `encoding="utf8"` in test :callable:`test_vocab_file` to match encoding in :method:`ContextualSpellCheck.__init__` when `debug=True` allowing test to pass.
@it176131 it176131 force-pushed the py3_workflow_updates branch from ef7f2bd to 6f8bde1 Compare December 8, 2024 23:50
	- Removed 3.13 as the spacy whl file cannot be built yet. See explosion/srsly#112 for details.
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.

1 participant