marzer / poxy

Documentation generator for C++
https://pypi.org/project/poxy
MIT License
135 stars 5 forks source link

Poxy doesn't update submodule(s) #12

Closed wroyca closed 1 year ago

wroyca commented 1 year ago

We should consider adding git submodule update --recursive --init to setup.py otherwise users might get an unexpected surprise

Traceback (most recent call last):
  File "C:\Users\wroy\AppData\Local\Programs\Python\Python38\lib\site-packages\poxy-0.7.1-py3.8.egg\poxy\main.py", line 160, in main
    run(
  File "C:\Users\wroy\AppData\Local\Programs\Python\Python38\lib\site-packages\poxy-0.7.1-py3.8.egg\poxy\run.py", line 1146, in run
    with project.Context(
  File "C:\Users\wroy\AppData\Local\Programs\Python\Python38\lib\site-packages\poxy-0.7.1-py3.8.egg\poxy\project.py", line 1264, in __init__
    mcss_dir = find_mcss_dir()
  File "C:\Users\wroy\AppData\Local\Programs\Python\Python38\lib\site-packages\poxy-0.7.1-py3.8.egg\poxy\utils.py", line 149, in find_mcss_dir
    assert_existing_directory(_mcss_dir)
  File "C:\Users\wroy\AppData\Local\Programs\Python\Python38\lib\site-packages\misk\functions.py", line 150, in assert_existing_directory
    raise Exception(f'{path} did not exist or was not a directory')
Exception: C:\Users\wroy\AppData\Local\Programs\Python\Python38\Lib\site-packages\poxy-0.7.1-py3.8.egg\poxy\data\m.css did not exist or was not a directory
marzer commented 1 year ago

This is a good point. Though, since I first set poxy up I have soured on submodules somewhat (because of shit like this) - I think a more robust solution ultimately is to just vendor m.css directly

wroyca commented 1 year ago

This is a good point. Though, since I first set poxy up I have soured on submodules somewhat (because of shit like this) - I think a more robust solution ultimately is to just vendor m.css directly

One solution would be to replace the submodule with a subtree; I think this would work well in this case since we just want to "vendor" m.css

Something like:

git subtree add --prefix poxy/data https://github.com/mosra/m.css.git main --squash
marzer commented 1 year ago

Oh hey, that's a good alternative! TIL about git subtrees

marzer commented 1 year ago

Oh @wroyca I've just realized that for people who install poxy the conventional way (i.e. as a non-editable install), the submodule thing isn't a factor; setup.py bundles the local m.css submodule into the python package in that scenario so git never even enters into the equation.

Having said that, it's still annoying for developing and iterating, so I'll replace the submodule all the same, methinks.

wroyca commented 1 year ago

Oh @wroyca I've just realized that for people who install poxy the conventional way (i.e. as a non-editable install), the submodule thing isn't a factor; setup.py bundles the local m.css submodule into the python package in that scenario so git never even enters into the equation.

Having said that, it's still annoying for developing and iterating, so I'll replace the submodule all the same, methinks.

Do you want me to replace it with a subtree? I'm comfortable with them, although it's only one command, so that shouldn't be a problem

marzer commented 1 year ago

Nah it's alright, I'm currently working on a much more kill-a-fly-with-a-sledgehammer solution :)

marzer commented 1 year ago

So the solution I went with was to add another 'hidden' developer command --update_mcss <path>, the idea being that instead of the copying and file fitering happening during setup.py every release, it's done as necessary when iterating on anything m.css related. I'll write up some better notes at some point soon (the elusive CONTRIBUTING.md)

wroyca commented 1 year ago

LGTM