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

[compat] Allow for local install on Windows #3

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

tomaarsen
Copy link
Contributor

Hello!

Pull Request overview

  • Allow for local install on Windows

Details

Currently, the open("README.md") in setup.py is complaining on Windows with:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 344: character maps to <undefined>

due to some unexpected character somewhere. Specifying the encoding as UTF-8 is a standard way to allow Windows users to open files safely.

Unrelated

Another thing, perhaps you can just do:

from bm25s.version import __version__ as version

rather than

version = {}
with open(f"{package_name}/version.py", encoding="utf8") as fp:
    exec(fp.read(), version)

...

version["__version__"]

Also because I don't like using exec, but it's personal preference.

  • Tom Aarsen

@xhluca
Copy link
Owner

xhluca commented Jun 19, 2024

version = {}
with open(f"{package_name}/version.py", encoding="utf8") as fp:
exec(fp.read(), version)
version["version"]

Thanks! You are right that exec is not great. I believe import would fail due to how setup.py is designed, but would need to look into it.

@xhluca xhluca merged commit 7449342 into xhluca:main Jun 19, 2024
1 check passed
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