-
Notifications
You must be signed in to change notification settings - Fork 17
feat: Add language-specific command aliases with auto-detection #59
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
Merged
SaadBazaz
merged 2 commits into
UniversalPython:main
from
sarr266:feature/language-specific-command-aliases
Feb 21, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| from setuptools import setup | ||
| import os | ||
| import yaml | ||
|
|
||
| LANGUAGES_DIR = os.path.join(os.path.dirname(__file__), 'universalpython', 'languages') | ||
|
|
||
| def get_aliases(): | ||
| aliases = [] | ||
| if not os.path.exists(LANGUAGES_DIR): | ||
| return aliases | ||
| for lang_dir in os.listdir(LANGUAGES_DIR): | ||
| yaml_path = os.path.join(LANGUAGES_DIR, lang_dir, 'default.yaml') | ||
| if not os.path.isfile(yaml_path): | ||
| continue | ||
| with open(yaml_path, encoding='utf-8') as f: | ||
| data = yaml.safe_load(f) | ||
| for alias in data.get('aliases', []): | ||
| aliases.append(f'{alias}=universalpython.universalpython:main') | ||
| return aliases | ||
|
|
||
| console_scripts = [ | ||
| 'universalpython=universalpython.universalpython:main', | ||
| 'unipy=universalpython.universalpython:main', | ||
| ] + get_aliases() | ||
|
|
||
| setup( | ||
| entry_points={ | ||
| 'console_scripts': console_scripts, | ||
| } | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| aliases: | ||
| - "univerzálnípython" | ||
| - "českýpython" | ||
|
|
||
| letters: | ||
| start : "A" | ||
| end : "Ž" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| aliases: | ||
| - "universellpython" | ||
| - "deutschpython" | ||
|
|
||
| letters: | ||
| start : "a" | ||
| end : "z" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| aliases: | ||
| - "emojipython" | ||
|
|
||
| letters: | ||
| start : "a" | ||
| end : "z" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| aliases: | ||
| - "pythonuniversel" | ||
| - "françaispython" | ||
|
|
||
| letters: | ||
| start : "a" | ||
| end : "z" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| aliases: | ||
| - "pythonuile" | ||
| - "gaeilgepython" | ||
|
|
||
| letters: | ||
| start : "a" | ||
| end : "z" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,8 @@ | ||
| aliases: | ||
| - "hindipython" | ||
| - "यूनिवर्सलपाइथन" | ||
| - "हिंदीपाइथन" | ||
|
|
||
| letters: | ||
| start : "अ" | ||
| end : "य़" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| aliases: | ||
| - "univerzálispython" | ||
| - "magyarpython" | ||
|
|
||
| letters: | ||
| start : "a" | ||
| end : "z" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| aliases: | ||
| - "유니버설파이썬" | ||
| - "한국어파이썬" | ||
|
|
||
| letters: | ||
| start : "가" | ||
| end : "힣" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| aliases: | ||
| - "universelepython" | ||
| - "nederlandsepython" | ||
|
|
||
| letters: | ||
| start : "a" | ||
| end : "z" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| aliases: | ||
| - "evrenselpython" | ||
| - "türkçepython" | ||
|
|
||
| letters: | ||
| start : "a" | ||
| end : "z" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| aliases: | ||
| - "універсальнийпітон" | ||
| - "українськапітон" | ||
|
|
||
| letters: | ||
| start : "Ж" | ||
| end : "і" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| aliases: | ||
| - "یونیورسلپایتھان" | ||
| - "اردوپایتھان" | ||
|
|
||
| letters: | ||
| start : "ا" | ||
| end : "ی" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this necessary, can you explain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To handle international characters.
The alias system was breaking on my system (Windows) otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, are you able to test this locally on Linux and macOS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry i don't have access to macOS, tested it on Linux, works perfectly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. I don't think this will cause issues on macOS then. Will merge soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool :)