diff --git a/protoc.sh b/protoc.sh new file mode 100644 index 0000000..e2bb311 --- /dev/null +++ b/protoc.sh @@ -0,0 +1,5 @@ +protoc \ + --proto_path . \ + --proto_path nrpc \ + --python_out . \ + nrpc/nrpc.proto diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..1df2832 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,52 @@ +[project] +name = "python-nrpc" +version = "0.0.7" +authors = [ + { name="Example Author", email="author@example.com" }, +] +description = "A python code generator and lib for Nats RPC" +readme = "README.md" +requires-python = ">=3.9" +classifiers = [ + "Programming Language :: Python :: 3", + "Operating System :: OS Independent", +] +license = "MIT" +license-files = [ + "LICENSE", +] + +dependencies=["protobuf", "mako", "nats-py>=2.7"] + +[project.scripts] +proto-gen-pynrpc = "nrpc.gen:main" + +[project.urls] +Homepage = "https://github.com/nats-rpc/python-nrpc" +Issues = "https://github.com/nats-rpc/python-nrpc/issues" + +[build-system] +requires = ["setuptools >= 77.0.3"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.package-data] +nrpc = ["*.mako"] + +[tool.black] +line-length = 79 +exclude = ''' +/( + \.git + | \.hg + | \.mypy_cache + | \.tox + | \.venv + | \.eggs + | venv + | _build + | buck-out + | build + | dist + | migrations +)/ +''' diff --git a/requirements-build.txt b/requirements-build.txt index 6f798a7..1898833 100644 --- a/requirements-build.txt +++ b/requirements-build.txt @@ -1,3 +1,3 @@ -pip==23.3 +pip==25.3 setuptools==70.0.0 wheel==0.43.0 diff --git a/setup.py b/setup.py deleted file mode 100644 index fd57fb3..0000000 --- a/setup.py +++ /dev/null @@ -1,45 +0,0 @@ -import setuptools -import subprocess - -from setuptools import setup - -with open("README.md", "r") as fh: - long_description = fh.read() - - -class protoc(setuptools.Command): - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - subprocess.check_call( - [ - "protoc", - "--proto_path", - ".", - "--proto_path", - "nrpc", - "--python_out", - ".", - "nrpc/nrpc.proto", - ] - ) - - -setup( - name="python-nrpc", - version="0.0.7", - description="A python code generator and lib for Nats RPC", - long_description=long_description, - long_description_content_type="text/markdown", - packages=["nrpc"], - package_data={"nrpc": ["*.mako"]}, - cmdclass={"protoc": protoc}, - entry_points={"console_scripts": ["protoc-gen-pynrpc=nrpc.gen:main"]}, - install_requires=["protobuf", "mako", "nats-py>=2.7"], -) diff --git a/nrpc/__init__.py b/src/nrpc/__init__.py similarity index 100% rename from nrpc/__init__.py rename to src/nrpc/__init__.py diff --git a/nrpc/exc.py b/src/nrpc/exc.py similarity index 100% rename from nrpc/exc.py rename to src/nrpc/exc.py diff --git a/nrpc/gen.py b/src/nrpc/gen.py similarity index 100% rename from nrpc/gen.py rename to src/nrpc/gen.py diff --git a/nrpc/lib.py b/src/nrpc/lib.py similarity index 100% rename from nrpc/lib.py rename to src/nrpc/lib.py diff --git a/nrpc/nrpc.proto b/src/nrpc/nrpc.proto similarity index 100% rename from nrpc/nrpc.proto rename to src/nrpc/nrpc.proto diff --git a/nrpc/nrpc_pb2.py b/src/nrpc/nrpc_pb2.py similarity index 100% rename from nrpc/nrpc_pb2.py rename to src/nrpc/nrpc_pb2.py diff --git a/nrpc/tmpl.mako b/src/nrpc/tmpl.mako similarity index 100% rename from nrpc/tmpl.mako rename to src/nrpc/tmpl.mako diff --git a/nrpc/tmpl.py b/src/nrpc/tmpl.py similarity index 100% rename from nrpc/tmpl.py rename to src/nrpc/tmpl.py