diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 879f3c9..4a24d33 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,9 +31,8 @@ jobs: - name: Install dependencies run: | pip install --upgrade pip - pip install setuptools==57.5.0 - pip install -r dev-requirement.txt - pip install . + pip install setuptools -U + pip install .[dev] - name: Lint with flake8 run: | diff --git a/dev-requirement.txt b/dev-requirement.txt deleted file mode 100644 index 1d76b9a..0000000 --- a/dev-requirement.txt +++ /dev/null @@ -1,6 +0,0 @@ --r requirement.txt -isort==5.10.1 -black==22.8.0 -pytest==6.2.5 -ipython==7.16.3 -flake8==4.0.1 \ No newline at end of file diff --git a/pyencrypt/cli.py b/pyencrypt/cli.py index 3cb0275..3dd182b 100644 --- a/pyencrypt/cli.py +++ b/pyencrypt/cli.py @@ -25,7 +25,7 @@ {__description__} VERSION {__version__} -""" +""" # noqa: E221,E222 KEY_OPTION_HELP = """ Your encryption key.If you don't specify key, @@ -52,8 +52,8 @@ Encryption completed {SUCCESS_ANSI}. Please copy {LOADER_FILE_NAME} into your encrypted directory. And then remove `encrypted` directory. -Finally, add `import loader` at the top of your entry file.\ -""" +Finally, add `import loader` at the top of your entry file.\n +""" # noqa: W604 FINISH_DECRYPT_MSG = f""" Decryption completed {SUCCESS_ANSI}. Your origin source code has be put: {{work_dir}} diff --git a/pyencrypt/license.py b/pyencrypt/license.py index 9a31aed..67d326a 100644 --- a/pyencrypt/license.py +++ b/pyencrypt/license.py @@ -35,7 +35,7 @@ def get_signature(data: bytes) -> str: def _combine_data(data: dict) -> bytes: - return "*".join(map(lambda x: f"{x}:{data[x]}", FIELDS)).encode() + return "*".join(map(lambda x: f"{x}:{data[x]}", FIELDS)).encode() # noqa: E231 def generate_license_file( diff --git a/pyencrypt/loader.py b/pyencrypt/loader.py index 4d28cb1..069010e 100644 --- a/pyencrypt/loader.py +++ b/pyencrypt/loader.py @@ -78,9 +78,9 @@ def find_spec( ) -> ModuleSpec: if path: if isinstance(path, _NamespacePath): - file_path = Path(path._path[0]) / f'{fullname.rsplit(".",1)[-1]}.pye' + file_path = Path(path._path[0]) / f'{fullname.rsplit(".", 1)[-1]}.pye' else: - file_path = Path(path[0]) / f'{fullname.rsplit(".",1)[-1]}.pye' + file_path = Path(path[0]) / f'{fullname.rsplit(".", 1)[-1]}.pye' else: for p in sys.path: file_path = Path(p) / f"{fullname}.pye" diff --git a/requirement.txt b/requirement.txt deleted file mode 100644 index 112162c..0000000 --- a/requirement.txt +++ /dev/null @@ -1,4 +0,0 @@ -click==8.0.3 -Cython==0.29.24 -pycryptodome==3.14.1 -python-minifier==2.9.0 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index e3432b2..aecc818 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,6 +40,14 @@ packages = find: # package_dir = # = src +[options.extras_require] +dev: + isort + black + pytest + ipython + flake8 + [options.packages.find] # where = src exclude =