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

Migrate to entry_points #551 #559

Merged

Conversation

sakurai-youhei
Copy link
Member

Closes #551.

With this PR, eland_import_hub_model gets easier to find on Windows.

On windows: eland_import_hub_model is an executable file.

C:\Users\YouheiSakurai\git\myeland>where eland_import_hub_model
C:\Users\YouheiSakurai\AppData\Roaming\Python\Python311\Scripts\eland_import_hub_model.exe

On Linux: eland_import_hub_model is a simple auto-generated script file.

root@b16946fa4fe1:/# which eland_import_hub_model
/usr/local/bin/eland_import_hub_model

root@b16946fa4fe1:/# file `which eland_import_hub_model`
/usr/local/bin/eland_import_hub_model: Python script, ASCII text executable

root@b16946fa4fe1:/# head `which eland_import_hub_model`
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from eland.cli.eland_import_hub_model import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

Note: Because I come to think adding python -m eland would be too ambicious, I dropped it from the scope.

@sakurai-youhei
Copy link
Member Author

As response to #557 (review):

The following flake8 lint errors proves that noxfile covers eland/cli/eland_import_hub_model.py properly.
https://github.com/elastic/eland/actions/runs/5540963903/jobs/10113737631?pr=559

@davidkyle
Copy link
Member

I've tested this change on macOS and the script is installed into the exact same location as before, i.e. /Library/Frameworks/Python.framework/Versions/3.X/bin/eland_import_hub_model

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thank you for your contribution @sakurai-youhei this is a great improvement for Windows users

@davidkyle
Copy link
Member

@sakurai-youhei The build system is being migrated from Jenkins to Buildkite and there are problems which is why your PR is not passing CI. The PR did pass the CI checks previously, I've tested the change and it is good. The CI failure is nothing to do with your change so I will merge the PR and users can benefit from your change.

Thanks more making the eland_import_hub_model script easier to user.

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

Successfully merging this pull request may close these issues.

A bit hard to find and run eland_import_hub_model on Windows
2 participants