Home Website Youtube GitHub

Setting up a Development Environment

Ahh, ok.

I was wondering why is Qt.py downloaded on build, and not just copied into https://github.com/mgear-dev/mgear_dist/tree/master/framework/scripts/mgear/vendor?
Looks like it’ll just download the latest Qt.py, which could potentially break the build.

If I setup an environment where I point PYTHONPATH to the different repositories like https://github.com/mgear-dev/animbits/tree/master/scripts and https://github.com/mgear-dev/crank/tree/master/scripts, then Python will only pick up the first module found.

Hello @Toke_Stuart_Jepsen

Let me intervene on giving some fast clarifications. We have setup mgear python/repositories in order to have everything as separated as possible in order to have a more flexible development env but at the same time everything gets under the same python module on the releasing system.

You can actually append to your python path each individual script folder for each repository and this will work all together because we are using python pkgutil extend_path which makes all matching modules to exist under the same namespace.

What can you do with this? You can either create a dev env in which you are always pointing Maya’s Python path to the released version generated by scons. Or you can actually add into your python path each part of the actually framework repos script folder. On the second option you will need to setup the plugings path yourself as on the first option mGear gets released as a Maya Module but nothing prevents you to manually setup Maya’s python path, plugin path, script path on your own env of maya executable.

Hope this helps a little bit

1 Like

Ok, I think I’ve found where my issue was.

I have been using https://github.com/mgear-dev as a starting point for its https://github.com/mgear-dev/mgear_dist/blob/master/framework/scripts/userSetup.py (which isn’t anywhere else than there?), so its easier to manage contribution back to the community.
You can have https://github.com/mgear-dev/mgear_dist/blob/master/framework/scripts as a starting path in PYTHONPATH followed by the rest of the repositories’ scripts directories, or the https://github.com/mgear-dev/mgear_dist/blob/master/framework/scripts at the end of PYTHONPATH.

Start of PYTHONPATH
This results in this error:

// Error: ImportError: file C:\Users\admin\Desktop\mgear-environment\bin\mgear_dist\framework\scripts\userSetup.py line 15: No module named shifter.menu // 

Because the mgear module in mgear_dist (https://github.com/mgear-dev/mgear_dist/tree/master/framework/scripts/mgear), gets discovered first and no other mgear module is imported. Can see this when looking at:

print mgear.__path__
['C:\\Users\\admin\\Desktop\\mgear-environment\\bin\\mgear_dist\\framework\\scripts\\mgear']

Solution is to add pkgutil expand_path to this module (https://github.com/mgear-dev/mgear_dist/blob/master/framework/scripts/mgear/init.py). This seems to solve the issue throughout.

Ending of PYTHONPATH
This results in this error:

// Error: AttributeError: file C:\Users\admin\Desktop\mgear-environment\bin\mgear_dist\framework\scripts\userSetup.py line 12: 'module' object has no attribute 'install' // 

Seems like the method/attributes in https://github.com/mgear-dev/mgear_dist/blob/master/framework/scripts/mgear/init.py does not get evaluated.

I don’t know what the solution is to this.

@Toke_Stuart_Jepsen can you please share with me your full mgear PYTHONPATH env variable so that I can try to reproduce this?

Thanks

@Jerome

set PYTHONPATH=C:\Users\admin\Desktop\mgear-environment\bin\mgear_dist\framework\scripts;C:\Users\admin\Desktop\mgear-environment\bin\animbits\scripts;C:\Users\admin\Desktop\mgear-environment\bin\crank\scripts;C:\Users\admin\Desktop\mgear-environment\bin\flex\scripts;C:\Users\admin\Desktop\mgear-environment\bin\mgear_core\scripts;C:\Users\admin\Desktop\mgear-environment\bin\rigbits\scripts;C:\Users\admin\Desktop\mgear-environment\bin\shifter\scripts;C:\Users\admin\Desktop\mgear-environment\bin\shifter_classic_components\scripts;C:\Users\admin\Desktop\mgear-environment\bin\simpleRig\scripts;C:\Users\admin\Desktop\mgear-environment\bin\synoptic\scripts

What is the workflow for making PRs?

Do we merge back to the develop branches or master?

Good question. Right now Master is good. Since we are evaluating/thinking a better workflow with Develop branch.

I had a lot of merge conflicts in the last release with all the difference repos

If you have experience with this, any advice is welcome :slight_smile:

Could you elaborate on this?
Was it when you updated the submodules in mgear_dist?

I was not doing the things right . It was my fault
So I was wondering if there is a better way to manage the structure/repos/branchs

I’ve mostly only had experience with multiple repos from the Pyblish and Avalon project, but we haven’t really got a good way of distributing the whole framework.

We do have a release on each repository with every merge so people can be sure they are using the same version without needing to know the git commit hash.

We have done some experiments with Docker; https://github.com/getavalon/docker, https://github.com/getavalon/docker/pull/53

Dunno if this is any helpful.

Hey Miguel

Circling in from 2023 regarding excons. I am not a Python developer so all of this is new to me. I can do google search about python but that is about it. I do want to get the latest changes by building from source rather than wait for an official release though. So Python installed, along with pip and scons. However excons is not. There is no indication on how to install it either from the official repo or in google.

If I try pip install excons I get
ERROR: Could not find a version that satisfies the requirement excons (from versions: none) ERROR: No matching distribution found for excons

So any help with installing excons on windows?

ok, so excons needs to be downloaded and extracted at the root of the repo for it work. Side note, carry on.

Now I am getting the following errors:
scons: Reading SConscript files …
[excons] Read excons.cache: C:/src/mgear4/excons.cache
‘dict’ object has no attribute ‘iteritems’
Using msvc 14.2
AttributeError: ‘list’ object has no attribute ‘read’:
File “C:\src\mgear4\SConstruct”, line 9:
env = excons.MakeBaseEnv()
File “C:\src\mgear4\excons_init_.py”, line 920:
env = SCons.Script.Environment(ENV={“PATH”: os.environ[“PATH”], “TMP”: os.environ[“TEMP”]}, MSVC_VERSION=mscver, MSVS_VERSION=mscver, MSVS_ARCH=msvsarch, TARGET_ARCH=msvsarch)
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Environment.py”, line 1030:
apply_tools(self, tools, toolpath)
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Environment.py”, line 116:
_ = env.Tool(tool)
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Environment.py”, line 1906:
tool(self)
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Tool_init_.py”, line 265:
self.generate(env, *args, **kw)
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Tool\default.py”, line 40:
for t in SCons.Tool.tool_list(env[‘PLATFORM’], env):
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Tool_init_.py”, line 769:
c_compiler = FindTool(c_compilers, env) or c_compilers[0]
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Tool_init_.py”, line 672:
if t.exists(env):
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Tool\msvc.py”, line 325:
return msvc_setup_env_tool(env, tool=tool_name)
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Tool\MSCommon\vc.py”, line 1335:
MSVC.SetupEnvDefault.register_tool(env, tool, msvc_exists)
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Tool\MSCommon\MSVC\SetupEnvDefault.py”, line 77:
initialize(env, msvc_exists_func)
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Tool\MSCommon\MSVC\SetupEnvDefault.py”, line 72:
Data.msvc_installed = msvc_exists_func(env)
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Tool\MSCommon\vc.py”, line 1291:
vcs = get_installed_vcs(env)
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Tool\MSCommon\vc.py”, line 947:
VC_DIR = find_vc_pdir(env, ver)
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Tool\MSCommon\vc.py”, line 735:
comps = find_vc_pdir_vswhere(msvc_version, env)
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\SCons\Tool\MSCommon\vc.py”, line 686:
cp = subprocess.run(vswhere_cmd, stdout=PIPE, stderr=PIPE, check=True)
File "C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\run_init
.py", line 145:
process = cls.create_process(command, stdin, cwd=cwd, env=env, shell=shell)
File "C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\site-packages\run_init
.py", line 121:
shlex.split(command),
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\shlex.py”, line 315:
return list(lex)
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\shlex.py”, line 300:
token = self.get_token()
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\shlex.py”, line 109:
raw = self.read_token()
File “C:\Users\ironi\AppData\Local\Programs\Python\Python39\lib\shlex.py”, line 140:
nextchar = self.instream.read(1)

What am I missing?

Thank you