Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mailbagit.py and mailbagit-gui.py manually created shims unnecessary for docker #206

Open
pobocks opened this issue Jun 13, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@pobocks
Copy link
Collaborator

pobocks commented Jun 13, 2022

Describe the bug
When getting the app to work in docker, scripts were added to the top level mailbag directory that replicate the entry-point functionality given by setuptools for an installed version of mailbag. On the surface, this works fine, and we might not hit problems, but those shims actually do substantial work to make sure imports and other things work as expected, and it's I think not good practice to add them when instead we can just install the package as intended.

To wit, I would argue that the manually created shims should be deleted, and then rather than just copying the directory in the dockerfile, copy the directory and then:

pip install .

from the setup directory. This will create the mailbagit and mailbagit-gui shims.

@gwiedeman

@pobocks pobocks added the bug Something isn't working label Jun 13, 2022
@gwiedeman
Copy link
Collaborator

Thanks for this! I was expecting users to use the mailbagit command in the docker instance. The mailbagit.py and mailbagit-gui.py files end up there in the dev docker image because they are in the repo and used to build the executables during the release workflow with pyinstaller --onefile mailbagit.py.

Definitely open to feedback on this if there's a better way! Maybe just more in the Docker docs saying to use `mailbagit' entry point?

@gwiedeman
Copy link
Collaborator

@gwiedeman gwiedeman added this to the MVP milestone Jun 28, 2022
@gwiedeman
Copy link
Collaborator

This did not work when I tried it;

Traceback (most recent call last):
    return _run_code(code, main_globals, None,
  File "C:\Users\gw234478\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\gw234478\.virtualenvs\projects-mTKVb1Jc\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "C:\Users\gw234478\.virtualenvs\projects-mTKVb1Jc\lib\site-packages\PyInstaller\__main__.py", line 178, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "C:\Users\gw234478\.virtualenvs\projects-mTKVb1Jc\lib\site-packages\PyInstaller\__main__.py", line 59, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "C:\Users\gw234478\.virtualenvs\projects-mTKVb1Jc\lib\site-packages\PyInstaller\building\build_main.py", line 845, in main
    build(specfile, distpath, workpath, clean_build)
  File "C:\Users\gw234478\.virtualenvs\projects-mTKVb1Jc\lib\site-packages\PyInstaller\building\build_main.py", line 767, in build
    exec(code, spec_namespace)
  File "mailbagit-guided.spec", line 42, in <module>
    a = Entrypoint(
  File "mailbagit-guided.spec", line 27, in Entrypoint
    kwargs['pathex'] = [ep.dist.location] + kwargs['pathex']
AttributeError: 'NoneType' object has no attribute 'dist'

I tried it by adding def Entrypoint to mailbagit-guided.spec and replaced Analysis() with:

a = Entrypoint('mailbagit', 'console_scripts', 'mailbagit-guided')

The example is not giving Entrypoint() any kwargs so I think its just broken?

@gwiedeman gwiedeman reopened this Jun 28, 2022
@gwiedeman gwiedeman removed this from the MVP milestone Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants