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

Self contained gitman app #180

Closed
daniel-brosche opened this issue Nov 14, 2018 · 7 comments
Closed

Self contained gitman app #180

daniel-brosche opened this issue Nov 14, 2018 · 7 comments

Comments

@daniel-brosche
Copy link
Collaborator

I see some benefit to provide a selfcontained gitman version. In this matter the gitman is a single executable file which can be stored next to the gitman.yml in the repository itself. Therefore the version of the gitman.yml and gitman match and also related scripts in the repository which may make usage of the gitman cli does not care about version mismatch resp. compatibility issues.
Furthermore regarding a reproducible development environment it would be nice not to rely on a global installed gitman version and instead to rely on the local self contained gitman app in the repository. Everything to resolve the dependencies is stored inside of the repository itself.
Questionable is what happens with recursive resolution of dependencies when each repository contains a gitman app in different versions which may differ in their cli.

Some helpful information about creating self contained applications can be found here.

@daniel-brosche daniel-brosche changed the title Selfcontained gitman app Self contained gitman app Nov 14, 2018
@jacebrowning
Copy link
Owner

Other possible options:

@daniel-brosche daniel-brosche self-assigned this Nov 30, 2018
@daniel-brosche
Copy link
Collaborator Author

Other possible options:

Add GitHub to local project requirements (e.g. pyproject.toml)
Add GitMan to system package managers: #4

I'm not sure how this listed options can be used to bundle gitman to a self contained executable. In my mind we need something that packages the gitman project + .venv folder to one single file that can executed without further installation.

Maybe you could clarify your options a little bit more detailed...

@jacebrowning
Copy link
Owner

jacebrowning commented Nov 30, 2018

If GitMan is specified as a dependency of your project (in pyproject.toml) then this will let you ensure "the version of the gitman.yml and gitman match".


All of my projects have support for PyInstaller ($ make exe), but getting your system Python configured correctly for that build to produce a valid executable is outside the scope of this project.

@daniel-brosche
Copy link
Collaborator Author

daniel-brosche commented Feb 1, 2019

I tried make exe to build gitman as single executeable.

The build succeeded but the executeable seems somehow broken:

osboxes@osboxes:~/Documents/gitman/dist$ ./GitMan --version
Traceback (most recent call last):
  File "gitman/__main__.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/home/osboxes/Documents/gitman/.venv/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "gitman/__init__.py", line 15, in <module>
  File "pkg_resources/__init__.py", line 479, in get_distribution
  File "pkg_resources/__init__.py", line 355, in get_provider
  File "pkg_resources/__init__.py", line 898, in require
  File "pkg_resources/__init__.py", line 784, in resolve
pkg_resources.DistributionNotFound: The 'gitman' distribution was not found and is required by the application
[10259] Failed to execute script __main__

Any ideas what's going wrong?

@jacebrowning
Copy link
Owner

No, but I might try to verify the PyInstaller build with a much simpler project first.

@daniel-brosche
Copy link
Collaborator Author

Is make exe building an executable self contained gitman app on your side. Could you check this?
I have tried a simple hello word application to bundle with pyinstaller and this is working.

@daniel-brosche
Copy link
Collaborator Author

I have located the issue. It is in gitman/__init__.py the function get_distribution does produce the error. When I replace the call with this then it works:

__version__ = '1.7a' #get_distribution('gitman').version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants