From b8399c2de5903b269090442a7a892545d46203f1 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Fri, 30 Jun 2023 11:07:31 +0400 Subject: [PATCH] Upd: setup.py (extra deps), makefile, check.sh; fixed deps versions (`==`) --- Makefile | 6 +++--- check.sh | 19 ++++++++----------- python_aternos/atwss.py | 2 +- requirements.txt | 10 +++++----- setup.py | 30 ++++++++++++++++++++++++------ 5 files changed, 41 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index be71d5a..3f28daf 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ doc: python3 -m mkdocs build clean: - rm -rf dist python_aternos.egg-info + rm -rf dist build python_aternos.egg-info rm -rf python_aternos/__pycache__ rm -rf examples/__pycache__ rm -rf tests/__pycache__ @@ -18,11 +18,11 @@ test: python3 -m unittest discover -v ./tests check: - python3 -m mypy . + python3 -m mypy ./python_aternos python3 -m pylint ./python_aternos fullcheck: chmod +x check.sh; bash check.sh format: - python3 -m autopep8 -r --in-place . + python3 -m autopep8 -r --in-place ./python_aternos diff --git a/check.sh b/check.sh index 1700990..2dbf00e 100755 --- a/check.sh +++ b/check.sh @@ -8,7 +8,7 @@ title () { COLOR='\033[1;36m' echo - echo -e "$COLOR[#] $1$RESET" + echo -e "${COLOR}[#] $1$RESET" } error_msg () { @@ -19,9 +19,9 @@ error_msg () { if (( $1 )); then failed+="$2, " - echo -e "$ERR[X] Found errors$RESET" + echo -e "${ERR}[X] Found errors$RESET" else - echo -e "$OK[V] Passed successfully$RESET" + echo -e "${OK}[V] Passed successfully$RESET" fi } @@ -32,26 +32,23 @@ display_failed() { SUCCESS='\033[1;32m' if [[ $failed != '' ]]; then - joined=`echo -n "$failed" | sed 's/, $//'` - echo -e "$FAILED[!] View output of: $joined$RESET" + joined=$(echo -n "$failed" | sed 's/, $//') + echo -e "${FAILED}[!] See output of: $joined$RESET" else - echo -e "$SUCCESS[V] All checks were passed successfully$RESET" + echo -e "${SUCCESS}[V] All checks were passed successfully$RESET" fi } -title 'Checking needed modules...' -python3 -m pip install pycodestyle mypy pylint - title 'Running unit tests...' python3 -m unittest discover -v ./tests error_msg $? 'unittest' title 'Running pep8 checker...' -python3 -m pycodestyle . +python3 -m pycodestyle ./python_aternos error_msg $? 'pep8' title 'Running mypy checker...' -python3 -m mypy . +python3 -m mypy ./python_aternos error_msg $? 'mypy' title 'Running pylint checker...' diff --git a/python_aternos/atwss.py b/python_aternos/atwss.py index 4fb6238..56dfd85 100644 --- a/python_aternos/atwss.py +++ b/python_aternos/atwss.py @@ -22,7 +22,7 @@ if TYPE_CHECKING: OneArgT = Callable[[Any], Coroutine[Any, Any, None]] TwoArgT = Callable[[Any, Tuple[Any, ...]], Coroutine[Any, Any, None]] -FunctionT = Union[OneArgT, TwoArgT] +FunctionT = Union[OneArgT, TwoArgT] # pylint: disable=invalid-name ArgsTuple = Tuple[FunctionT, Tuple[Any, ...]] diff --git a/requirements.txt b/requirements.txt index 1eefdaa..0952ca9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -lxml>=4.8.0 -cloudscraper>=1.2.60 -js2py>=0.71 -websockets>=10.1 -regex>=2022.3.15 +cloudscraper==1.2.71 +Js2Py==0.74 +lxml==4.9.2 +regex==2023.6.3 +websockets==11.0.3 diff --git a/setup.py b/setup.py index 8bef209..5f47317 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open('README.md', 'rt') as readme: setuptools.setup( name='python-aternos', - version='3.0.0', + version='3.0.1', author='Chechkenev Andrey (@DarkCat09)', author_email='aacd0709@mail.ru', description='An unofficial Aternos API', @@ -34,12 +34,30 @@ setuptools.setup( 'Typing :: Typed', ], install_requires=[ - 'lxml>=4.8.0', - 'cloudscraper>=1.2.60', - 'js2py>=0.71', - 'websockets>=10.1', - 'regex>=2022.3.15', + 'cloudscraper==1.2.71', + 'Js2Py==0.74', + 'lxml==4.9.2', + 'regex==2023.6.3', + 'websockets==11.0.3', ], + extras_require={ + 'dev': [ + 'autopep8==2.0.2', + 'pycodestyle==2.10.0', + 'mypy==1.4.1', + 'pylint==2.17.4', + 'requests-mock==1.11.0', + 'types-requests==2.31.0.1', + ], + 'pypi': [ + 'build==0.10.0', + 'twine==4.0.2', + ], + 'docs': [ + 'mkdocs==1.4.3', + 'mkdocstrings[python]==0.22.0', + ] + }, packages=['python_aternos'], python_requires=">=3.7", include_package_data=True,