From 109fa349063216ccee4198bdb4e4728c8b02cf17 Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Fri, 1 May 2026 14:47:15 +0900 Subject: [PATCH 01/10] Use setuptools --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f7231b4..9da4eea 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # Copyright (C) 2012-2014 MUJIN Inc -from distutils.core import setup +from setuptools import setup try: from mujincommon.setuptools import Distribution except (ImportError, SyntaxError): - from distutils.dist import Distribution + from setuptools.dist import Distribution version = {} exec(open('python/mujinwebstackclient/version.py').read(), version) From c8712041118d224cf9498e365e17179cedbd2b0f Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Fri, 1 May 2026 16:57:49 +0900 Subject: [PATCH 02/10] Setup pyproject.toml --- pyproject.toml | 26 ++++++++++++++++++++++++++ setup.py | 25 +------------------------ 2 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ab5641a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,26 @@ +[project] +name = "mujinwebstackclient" +dependencies = [ + "websockets==15.0.1", +] +dynamic = ["version"] + +[tool.setuptools] +packages = ["mujinwebstackclient"] + +[tool.setuptools.package-dir] +mujinwebstackclient = "python/mujinwebstackclient" + +[tool.setuptools.package-data] +mujinwebstackclient = ["py.typed"] + +[tool.setuptools.data-files] +bin = [ + "bin/mujin_webstackclientpy_applyconfig.py", + "bin/mujin_webstackclientpy_runshell.py", + "bin/mujin_webstackclientpy_downloaddata.py", +] + +[tool.setuptools.dynamic] +version = {attr = "python.mujinwebstackclient.version.__version__"} +readme = {file = ["README.md"], content-type = "text/markdown"} diff --git a/setup.py b/setup.py index 9da4eea..3d7bd30 100644 --- a/setup.py +++ b/setup.py @@ -12,32 +12,9 @@ setup( distclass=Distribution, - name='mujinwebstackclient', - version=version['__version__'], - packages=['mujinwebstackclient'], - package_dir={'mujinwebstackclient': 'python/mujinwebstackclient'}, - package_data={ - 'mujinwebstackclient': ['py.typed'], - }, - data_files=[ - # using scripts= will cause the first line of the script being modified for python2 or python3 - # put the scripts in data_files will copy them as-is - ( - 'bin', - [ - 'bin/mujin_webstackclientpy_applyconfig.py', - 'bin/mujin_webstackclientpy_runshell.py', - 'bin/mujin_webstackclientpy_downloaddata.py', - ], - ), - ], locale_dir='locale', - license='Apache License, Version 2.0', - long_description=open('README.md').read(), + license='Apache License, Version 2.0', # license must be kept in setup.py unless packaging>=24.2 is adopted # flake8 compliance configuration enable_flake8=True, # Enable checks fail_on_flake=True, # Fail builds when checks fail - install_requires=[ - 'websockets==15.0.1', - ], ) From f6ef19621c1e8e45ae1c20b51b3c956bf27807ad Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Fri, 1 May 2026 16:58:22 +0900 Subject: [PATCH 03/10] remove exec --- setup.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.py b/setup.py index 3d7bd30..d4bbc50 100644 --- a/setup.py +++ b/setup.py @@ -7,9 +7,6 @@ except (ImportError, SyntaxError): from setuptools.dist import Distribution -version = {} -exec(open('python/mujinwebstackclient/version.py').read(), version) - setup( distclass=Distribution, locale_dir='locale', From c9198dba4d382fa45822fb4ae0c4e0840cbbb77e Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Fri, 1 May 2026 17:07:22 +0900 Subject: [PATCH 04/10] Fill dependencies properly --- pyproject.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ab5641a..b8e1f66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,18 @@ [project] name = "mujinwebstackclient" dependencies = [ - "websockets==15.0.1", + "six~=1.16", + "requests~=2.32.2", + "typing_extensions~=4.2", + "websockets~=15.0", ] dynamic = ["version"] +[project.optional-dependencies] +graphql = [ + "graphql-core~=3.2.0", +] + [tool.setuptools] packages = ["mujinwebstackclient"] From 996aba88865462e7dcc8d62cd7c4d116f610e416 Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Fri, 1 May 2026 17:12:33 +0900 Subject: [PATCH 05/10] readme is also dynamic --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b8e1f66..dd2bafa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ dependencies = [ "typing_extensions~=4.2", "websockets~=15.0", ] -dynamic = ["version"] +dynamic = ["version", "readme"] [project.optional-dependencies] graphql = [ From 612c0b126e523e08d811ede67f8b69d35b25a406 Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Fri, 1 May 2026 17:13:54 +0900 Subject: [PATCH 06/10] ignore uv.lock --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c1504c9..284c008 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ var/ *.egg-info/ .installed.cfg *.egg +uv.lock # Installer logs pip-log.txt @@ -56,4 +57,4 @@ docs/_build/ # virtualenv /.ve - +/.venv From 0a6912c0e54a3d91552dc500bb9f40f426bea2ba Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Thu, 7 May 2026 15:12:06 +0900 Subject: [PATCH 07/10] readme not need to be dynamic --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dd2bafa..e26a145 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,8 @@ dependencies = [ "typing_extensions~=4.2", "websockets~=15.0", ] -dynamic = ["version", "readme"] +readme = "README.md" +dynamic = ["version"] [project.optional-dependencies] graphql = [ @@ -31,4 +32,3 @@ bin = [ [tool.setuptools.dynamic] version = {attr = "python.mujinwebstackclient.version.__version__"} -readme = {file = ["README.md"], content-type = "text/markdown"} From 2521f06f490e3cc0157af84d77fdb0289c3007d3 Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Wed, 13 May 2026 01:44:55 +0900 Subject: [PATCH 08/10] include-packade-data=false just in case --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index e26a145..1586471 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,7 @@ graphql = [ ] [tool.setuptools] +include-package-data = false packages = ["mujinwebstackclient"] [tool.setuptools.package-dir] From 73ae4be60ebdc97441f8584aa0e475e6852d2160 Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Tue, 28 Apr 2026 11:07:31 +0900 Subject: [PATCH 09/10] Use UV to run generategraphclient --- README.md | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/README.md b/README.md index 8741c42..bb4216e 100644 --- a/README.md +++ b/README.md @@ -30,34 +30,6 @@ Mujin Controller Python Client is Licensed under the Apache License, Version 2.0 ### How to re-generate `webstackgraphclient.py` -First, set up a virtualenv to install required pip packages: - -```bash -# create a new virtualenv, you can also delete it afterwards -virtualenv .venv - -# install required packages -./.venv/bin/pip install six==1.16.0 requests==2.27.1 graphql-core==3.2.0 typing_extensions==4.2.0 - -# install mujinwebstackclient -./.venv/bin/pip install . -``` - -Then, use `mujin_webstackclientpy_generategraphclient.py` to generate the content of the `webstackgraphclient.py` file. - -```bash -./.venv/bin/python devbin/mujin_webstackclientpy_generategraphclient.py --url http://controller123 > python/mujinwebstackclient/webstackgraphclient.py -``` - -## Troubleshooting - -### Jhbuild fails due to flake8 - -If Jhbuild fails on building mujinwebstackclientpy due to a flake8 violation (most likely with a several hundred errors and warnings), this could be happening due to flake8 running a default configuration within a virtual environment. - -If this seems to be the case, you can delete the virtual environment. - ```bash -# delete the virtual environment -rm -rf ./.venv +PYTHONPATH=python uv run --extra graphql devbin/mujin_webstackclientpy_generategraphclient.py --url http://controller123 > python/mujinwebstackclient/webstackgraphclient.py ``` From eed839d02bb5e0d10f0496a06266138753835382 Mon Sep 17 00:00:00 2001 From: Taiju Yamada Date: Fri, 15 May 2026 15:14:11 +0900 Subject: [PATCH 10/10] set license in pyproject.toml --- pyproject.toml | 1 + setup.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1586471..da573f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,7 @@ dependencies = [ "typing_extensions~=4.2", "websockets~=15.0", ] +license = "Apache-2.0" readme = "README.md" dynamic = ["version"] diff --git a/setup.py b/setup.py index d4bbc50..5b759fb 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,6 @@ setup( distclass=Distribution, locale_dir='locale', - license='Apache License, Version 2.0', # license must be kept in setup.py unless packaging>=24.2 is adopted # flake8 compliance configuration enable_flake8=True, # Enable checks fail_on_flake=True, # Fail builds when checks fail