Skip to content

Commit

Permalink
workaroud to skip validation on Windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor Korovin committed Aug 19, 2022
1 parent 3d43b98 commit f51b120
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="yappa",
version="0.4.27",
version="0.4.28",
url="https://github.com/turokg/yappa",
description="Easy serverless deploy of python web applications",
long_description_content_type="text/markdown",
Expand Down
5 changes: 4 additions & 1 deletion yappa/packaging/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
from click import ClickException

REQUIRED_PACKAGES = ("httpx", "PyYAML")
ENCODING = "cp1252" if any(platform.win32_ver()) else "utf-8"
ENCODING = "utf-8"
IS_WINDOWS = any(platform.win32_ver())


def validate_requirements_file(requirements_filename):
if IS_WINDOWS:
return
try:
with open(requirements_filename, encoding=ENCODING) as f:
requirements = f.read()
Expand Down
5 changes: 4 additions & 1 deletion yappa/packaging/direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from click import ClickException

from yappa.handlers.common import DEFAULT_CONFIG_FILENAME
from yappa.packaging.common import validate_requirements_file, ENCODING
from yappa.packaging.common import validate_requirements_file, ENCODING, \
IS_WINDOWS
from yappa.settings import (
DEFAULT_IGNORED_FILES,
DEFAULT_PACKAGE_DIR,
Expand All @@ -30,6 +31,8 @@ def clear_requirements(requirements_file):
"""
removes Yappa package from requirements
"""
if IS_WINDOWS:
return
buffer = []
with open(requirements_file, "r", encoding=ENCODING) as f:
for line in f.readlines():
Expand Down

0 comments on commit f51b120

Please # to comment.