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

Fix binaries import for intl languages #216

Merged
merged 5 commits into from
Sep 2, 2021
Merged

Fix binaries import for intl languages #216

merged 5 commits into from
Sep 2, 2021

Conversation

CarlBeek
Copy link
Collaborator

The binaries in dev do not contain the json language files from \intl\, this is not detected in the current tests either as they have access to the .\intl\ files via the python path from which the binaries are run.

Changes

  • intl files are imported via a check for sys._MEIPASS which means they are now loaded for both the binaries and natively running the python deposit.py
  • CI tests for binaries are now conduced from a sub-folder so the python path doesn't contain the root directory which contained the intl files

@CarlBeek CarlBeek added bug Something isn't working testing labels Aug 30, 2021
@CarlBeek CarlBeek requested a review from hwwhww August 30, 2021 09:37
@hwwhww
Copy link
Contributor

hwwhww commented Sep 1, 2021

I'm testing the macOS binary:

./deposit --help
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/existing_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/existing_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/existing_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/existing_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/existing_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/existing_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/new_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/new_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/new_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIYnrETB eth2deposit/intl/en/cli/new_mnemonic.json
Usage: deposit [OPTIONS] COMMAND [ARGS]...

Options:
  --language TEXT  The language you wish to use the CLI in.
  --help           Show this message and exit.

Commands:
  existing-mnemonic  Generate (or recover) keys from an existing mnemonic
  new-mnemonic       Generate a new mnemonic and keys

and

./deposit new-mnemonic --num_validators 1 --chain mainnet

/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/existing_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/existing_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/existing_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/existing_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/existing_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/existing_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/new_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/generate_keys.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/new_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/new_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/en/cli/new_mnemonic.json
Please choose your language ['1. العربية', '2. ελληνικά', '3. English', '4. Français', '5. Bahasa melayu', '6. Italiano', '7. 日本語', '8. 한국어', '9. Português do Brasil', '10. român', '11. 简体中文']:  [English]: 7
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/ja/cli/new_mnemonic.json
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/ja/cli/new_mnemonic.json
ニーモニックの言語を選択してください ['1. 简体中文', '2. 繁體中文', '3. čeština', '4. English', '5. Italiano', '6. 한국어', '7. Português', '8. Español']:  [english]: 2
/var/folders/l2/cr5gmc3j7qjf8lx63s4lys400000gn/T/_MEIHKeDWd eth2deposit/intl/ja/cli/generate_keys.json
キーストアを保護するパスワード。eth2 バリデーターをセットアップする際に復号化するためにこれを再入力する必要があります。:

Is it possible to not stdout (or stderr?) the JSON files names?

Copy link
Contributor

@hwwhww hwwhww left a comment

Choose a reason for hiding this comment

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

lgtm

eth2deposit/utils/intl.py Outdated Show resolved Hide resolved
@CarlBeek CarlBeek merged commit 65de454 into dev Sep 2, 2021
@CarlBeek CarlBeek deleted the binary_import_fix branch September 2, 2021 13:46
everhusk pushed a commit to earthwallet/earth-wallet-cli that referenced this pull request Aug 3, 2023
Fix binaries import for intl languages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants