Skip to content

Commit d244dcc

Browse files
committed
Add dotfile dependency for local testing and update script
1 parent 792eb5d commit d244dcc

4 files changed

Lines changed: 21 additions & 18 deletions

File tree

.github/workflows/deploy_website.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ jobs:
3939
- name: Install python and dependencies
4040
uses: actions/setup-python@v5
4141
with:
42-
python-version: 'pypy3.13'
43-
- run: |
44-
python -m pip install --upgrade pip
45-
python -m pip install crowdin-api-client pygithub
42+
python-version: '3.13'
4643

4744
- name: Build with Hugo
4845
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
public/
33
resources/_gen/
44
.DS_Store
5+
.env

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ themes: themes/scientific-python-hugo-theme
2323

2424
html: ## Build site in `./public`
2525
html: themes content/shortcodes.md
26+
python -m pip install --upgrade pip
27+
python -m pip install crowdin-api-client pygithub python-dotenv
2628
python scripts/update_dashboard.py
2729
hugo
2830

scripts/update_dashboard.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,20 @@
99

1010
from crowdin_api import CrowdinClient # type: ignore
1111
from github import Github, Auth
12+
from dotenv import load_dotenv
1213

1314

15+
load_dotenv() # take environment variables
16+
1417

1518
def parse_input() -> dict:
1619
gh_input = {
1720
# Automations Bot account
1821
"username": "scientificpythontranslations",
1922
"crowdin_token": os.environ["CROWDIN_TOKEN"],
2023
# Provided by gpg action based on organization secrets
21-
"name": os.environ["GPG_NAME"],
22-
"email": os.environ["GPG_EMAIL"],
24+
# "name": os.environ["GPG_NAME"],
25+
# "email": os.environ["GPG_EMAIL"],
2326
}
2427
return gh_input
2528

@@ -146,18 +149,18 @@ def main() -> None:
146149
"""Main function to run the script."""
147150
try:
148151
gh_input = parse_input()
149-
crowdin_project = gh_input["crowdin_project"]
150-
client = ScientificCrowdinClient(
151-
token=gh_input["crowdin_token"], organization="Scientific-python"
152-
)
153-
valid_languages = client.get_valid_languages(
154-
crowdin_project,
155-
int(gh_input["translation_percentage"]),
156-
int(gh_input["approval_percentage"]),
157-
)
158-
translators = client.get_project_translators(
159-
crowdin_project,
160-
)
152+
# crowdin_project = gh_input["crowdin_project"]
153+
# client = ScientificCrowdinClient(
154+
# token=gh_input["crowdin_token"], organization="Scientific-python"
155+
# )
156+
# valid_languages = client.get_valid_languages(
157+
# crowdin_project,
158+
# int(gh_input["translation_percentage"]),
159+
# int(gh_input["approval_percentage"]),
160+
# )
161+
# translators = client.get_project_translators(
162+
# crowdin_project,
163+
# )
161164
except Exception as e:
162165
print(f"Error: {e}")
163166
traceback.print_exc()

0 commit comments

Comments
 (0)