Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
uv.lock

# Installer logs
pip-log.txt
Expand Down Expand Up @@ -56,4 +57,4 @@ docs/_build/

# virtualenv
/.ve

/.venv
30 changes: 1 addition & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
36 changes: 36 additions & 0 deletions pyproject.toml
Comment thread
woswos marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[project]
name = "mujinwebstackclient"
dependencies = [
"six~=1.16",
"requests~=2.32.2",
"typing_extensions~=4.2",
"websockets~=15.0",
]
license = "Apache-2.0"
readme = "README.md"
dynamic = ["version"]

[project.optional-dependencies]
graphql = [
"graphql-core~=3.2.0",
]

[tool.setuptools]
include-package-data = false
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__"}
31 changes: 2 additions & 29 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,16 @@
# -*- 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

version = {}
exec(open('python/mujinwebstackclient/version.py').read(), version)
from setuptools.dist import Distribution

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(),
# flake8 compliance configuration
enable_flake8=True, # Enable checks
fail_on_flake=True, # Fail builds when checks fail
install_requires=[
'websockets==15.0.1',
],
)
Loading