Skip to main content

Use python package to manage LUA plugin, so that the plugin can be published to private pypi server and used internally. A temporary solution for PYTHONER using kong.

Project description

luaproject

Use python package to manage lua&kong plugin, so that the plugin can be published to pypi server. A temporary solution for PYTHONER using lua&kong.

Install

pip install luaproject

Installed Command Utils

  • luaproject

command usage

C:\Workspace>luaproject
Usage: luaproject [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  init  Init lua project.

Example

example files

.
./example
./example/src
./example/src/.rockspec
./example/src/lua
./example/src/lua/handler.lua
./example/src/lua/schema.lua
./example/__init__.py
./LICENSE
./manage_example.py
./MANIFEST.in
./README.md
./requirements.txt
./setup.py

content of .rockspec

package = "example"
version = "0.1.0-1"
source = {
    url = "example-0.1.0-1.zip"
}
description = {
    summary = "lua plugin example",
}
dependencies = {
    "lua >= 5.1, < 5.4",
}
build = {
    type = "builtin",
    modules = {
        ["kong.plugins.example.handler"] = "lua/handler.lua",
        ["kong.plugins.example.schema"] = "lua/schema.lua",
    }
}

content of example_manager.py

import os
from luaproject import LuaProjectManager
import example

application_root = os.path.abspath(os.path.dirname(example.__file__))
manager = LuaProjectManager(application_root).get_manager()

if __name__ == "__main__":
    manager()

content of setup.py

setup(
    ...
    entry_points={
        "console_scripts": [
            "manage-example = manage_example:manager",
        ]
    },
)

usage of manage-example

Usage: manage-example [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  install  Create a lua package and then install it.
  pack     Create a lua package.

Releases

v0.3.1 2020/08/27

  • Fix setup.py, add py_module parameter to fix luaproject not installed problem.

v0.3.0 2020/08/26

  • Rename from kong-plugin-local-manager to luaproject.
  • manage-example.pack command add username parameter to create a rockspec file that can use in uploading to https://luarocks.org/.
  • Auto calc sdist version from .rockspec file.

v0.2.0 2020/07/31

  • Add kong-plugin-local-manager command tools.

v0.1.0 2020/07/30

  • First release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

luaproject-0.3.1.tar.gz (6.0 kB view details)

Uploaded Source

File details

Details for the file luaproject-0.3.1.tar.gz.

File metadata

  • Download URL: luaproject-0.3.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.8

File hashes

Hashes for luaproject-0.3.1.tar.gz
Algorithm Hash digest
SHA256 a10d8ac3e2916d73bf8463f1e18992517330c6f219502eeaad687e25d71244ed
MD5 d35ea123bac04d7837c92eb8c6b97623
BLAKE2b-256 06f1bcf34dac1f4ec5fe4c58abe911240ff395be007049005eaea7cc5094fb39

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page