diff --git a/nginxfmt.py b/nginxfmt.py index c59b36e..5bafe32 100755 --- a/nginxfmt.py +++ b/nginxfmt.py @@ -18,7 +18,7 @@ __author__ = "Michał Słomkowski" __license__ = "Apache 2.0" -__version__ = "1.2.0-SNAPSHOT" +__version__ = "1.2.1" class FormatterOptions: @@ -360,5 +360,9 @@ def _standalone_run(program_arguments): formatter.format_file(config_file_path, backup_file_path) -if __name__ == "__main__": +def main(): _standalone_run(sys.argv[1:]) + + +if __name__ == "__main__": + main() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a693d58 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,26 @@ +[tool.poetry] +name = "nginxfmt" +version = "1.2.1" +description = "nginx config file formatter with no additional dependencies." +authors = ["Michał Słomkowski"] +license = "Apache 2.0" +readme = "README.md" +homepage = "https://github.com/slomkowski/nginx-config-formatter" +repository = "https://github.com/slomkowski/nginx-config-formatter" +keywords = ["nginx", "formatter"] +include = [ + "LICENSE", +] + + +[tool.poetry.dependencies] +python = ">=3.4" + +[tool.poetry.dev-dependencies] + +[tool.poetry.scripts] +nginxfmt = "nginxfmt:main" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api"