pylint & black
This commit is contained in:
parent
43580bc790
commit
24a0a263ae
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
venv/
|
||||||
|
.tox/
|
||||||
|
minecraft_libs/__pycache__/
|
||||||
|
version.json
|
@ -1,2 +1,2 @@
|
|||||||
* `make_libs_list.py` - parse `version.json` file and return libs
|
## minecraft_libs
|
||||||
Moved to [iiiypuk/minecraft-libs-parser](https://github.com/iiiypuk/minecraft-libs-parser).
|
Parse `version.json` file and return libs
|
||||||
|
4
dev_requiments.txt
Normal file
4
dev_requiments.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
black==21.7b0
|
||||||
|
click==8.0.1
|
||||||
|
flit==3.2.0
|
||||||
|
pylint==2.9.5
|
3
minecraft_libs/__init__.py
Normal file
3
minecraft_libs/__init__.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
"""Parse version.json file and return libs"""
|
||||||
|
|
||||||
|
__version__ = "1.0.3"
|
@ -1,19 +1,15 @@
|
|||||||
#!/usr/bin/env python3
|
"""Parse version.json file and return libs"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import json
|
import json
|
||||||
import click
|
import click
|
||||||
|
|
||||||
__author__ = "Alexander Popov"
|
|
||||||
__version__ = "1.0.2"
|
|
||||||
__license__ = "Unlicense"
|
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
@click.option("--platform", default=sys.platform, help="Output platform (win32, linux, darwin).")
|
@click.option("--platform", default=sys.platform, help="Output platform (win32, linux, darwin).")
|
||||||
@click.option("--output", default="tty", help="Output option (tty, txt).")
|
@click.option("--output", default="tty", help="Output option (tty, txt).")
|
||||||
def make_output(platform, output):
|
def make_output(platform, output):
|
||||||
""" Return libraries list """
|
"""Return libraries list"""
|
||||||
|
|
||||||
libraries = parse_libs()
|
libraries = parse_libs()
|
||||||
|
|
||||||
@ -38,7 +34,7 @@ def make_output(platform, output):
|
|||||||
|
|
||||||
if platform == "win32":
|
if platform == "win32":
|
||||||
print("\nWindows generate libraries list complete!")
|
print("\nWindows generate libraries list complete!")
|
||||||
elif platform == "linux" or platform == "darwin":
|
elif ("linux", "darwin") in platform:
|
||||||
print("\nUnix generate libraries list complete!")
|
print("\nUnix generate libraries list complete!")
|
||||||
elif output == "txt":
|
elif output == "txt":
|
||||||
with open("./libs.txt", "w", encoding="utf-8") as f:
|
with open("./libs.txt", "w", encoding="utf-8") as f:
|
||||||
@ -46,23 +42,27 @@ def make_output(platform, output):
|
|||||||
|
|
||||||
if platform == "win32":
|
if platform == "win32":
|
||||||
print("\nWindows generate libraries list complete!\n" "See libs.txt file.")
|
print("\nWindows generate libraries list complete!\n" "See libs.txt file.")
|
||||||
elif platform == "linux" or platform == "darwin":
|
elif ("linux", "darwin") in platform:
|
||||||
print("\nUnix generate libraries list complete!\n" "See libs.txt file.")
|
print("\nUnix generate libraries list complete!\n" "See libs.txt file.")
|
||||||
|
|
||||||
|
|
||||||
def parse_libs():
|
def parse_libs():
|
||||||
""" Make libraries list from version.json file """
|
"""Make libraries list from version.json file"""
|
||||||
|
|
||||||
_ = []
|
_ = []
|
||||||
|
|
||||||
with open("./version.json", "r", encoding="utf-8") as f:
|
try:
|
||||||
file_data = json.loads(f.read())
|
with open("./version.json", "r", encoding="utf-8") as f:
|
||||||
|
file_data = json.loads(f.read())
|
||||||
|
|
||||||
for lib in file_data["libraries"]:
|
for lib in file_data["libraries"]:
|
||||||
_.append(lib["downloads"]["artifact"]["path"])
|
_.append(lib["downloads"]["artifact"]["path"])
|
||||||
|
except FileNotFoundError:
|
||||||
|
print("ERROR: File version.json not found.")
|
||||||
|
sys.exit(-1)
|
||||||
|
|
||||||
return _
|
return _
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
make_output()
|
make_output(platform=sys.platform, output="tty")
|
25
pyproject.toml
Normal file
25
pyproject.toml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["flit_core >=2,<4"]
|
||||||
|
build-backend = "flit_core.buildapi"
|
||||||
|
|
||||||
|
[tool.flit.metadata]
|
||||||
|
module = "minecraft_libs"
|
||||||
|
author = "Alexander Popov"
|
||||||
|
author-email = "iiiypuk@iiiypuk.me"
|
||||||
|
requires = [ "click==7.1.2" ]
|
||||||
|
description-file = "DESC.md"
|
||||||
|
classifiers = [
|
||||||
|
'License :: Public Domain',
|
||||||
|
'Programming Language :: Python :: 3',
|
||||||
|
'Programming Language :: Python :: 3.7',
|
||||||
|
'Programming Language :: Python :: 3.8',
|
||||||
|
'Programming Language :: Python :: 3.9',
|
||||||
|
]
|
||||||
|
requires-python = ">=3"
|
||||||
|
keywords = "iOS,splashscreen,splash-screen"
|
||||||
|
|
||||||
|
[tool.flit.metadata.requires-extra]
|
||||||
|
dev = ["pylint == 2.7.1", "black == 20.8b1"]
|
||||||
|
|
||||||
|
[tool.black]
|
||||||
|
line-length = 99
|
Reference in New Issue
Block a user