Skip to content

Commit

Permalink
encoding?
Browse files Browse the repository at this point in the history
  • Loading branch information
UnravelSports [JB] committed Oct 18, 2024
1 parent dcb1838 commit 8e2c8cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ jobs:
if: runner.os == 'Windows' # Only run on Windows
env:
PYTHONIOENCODING: utf-8 # Ensure Python uses UTF-8 encoding
PYTHONUTF8: 1 # Force Python to use UTF-8 mode
run: |
chcp 65001 # Change code page to UTF-8
python -m pip install --upgrade pip
python -m pip install --upgrade pip setuptools
python -m pip install -e .[test]
shell: pwsh

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from setuptools import setup, find_packages
import os
import re
import codecs


# Read the version from the __init__.py file
def read_version():
version_file = os.path.join(os.path.dirname(__file__), "unravel", "__init__.py")
with open(version_file, "r") as f:
with codecs.open(version_file, "r", "utf-8") as f:
version_match = re.search(r'^__version__ = ["\']([^"\']*)["\']', f.read(), re.M)
if version_match:
return version_match.group(1)
Expand Down

0 comments on commit 8e2c8cc

Please sign in to comment.