You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Running Scripts that Require Client Credentials
57
+
### Running scripts that require client cedentials
52
58
53
-
To successfully run scripts that require client credentials, you will need to follow these steps:
54
-
1. Copy the contents of the `env.example` file in the script's directory to `.env`:
55
-
```
56
-
cp env.example .env
57
-
```
58
-
2. Uncomment the variables in the `.env` file and assign values as needed. See [`sources.md`](sources.md) on how to get credentials:
59
-
```
60
-
GOOGLE_API_KEYS=your_api_key
61
-
PSE_KEY=your_pse_key
62
-
```
63
-
3. Save the changes to the `.env` file.
59
+
To successfully run scripts that require client credentials, you will need to
60
+
follow these steps:
61
+
1. Copy the contents of the `env.example` file in the script's directory to
62
+
`.env`:
63
+
```shell
64
+
cp env.example .env
65
+
```
66
+
2. Uncomment the variables in the `.env` file and assign values as needed. See
67
+
[`sources.md`](sources.md) on how to get credentials:
68
+
```
69
+
GOOGLE_API_KEYS=your_api_key
70
+
PSE_KEY=your_pse_key
71
+
```
72
+
3. Save the changes to the `.env` file.
73
+
4. You should now be able to run scripts that require client credentials
74
+
without any issues.
75
+
76
+
77
+
### Static analysis
64
78
65
-
4. You should now be able to run scripts that require client credentials without any issues.
79
+
The [`dev/tools.sh`][tools-sh] helper script runs the static analysis tools
80
+
(`black`, `flake8`, and `isort`):
81
+
```shell
82
+
./dev/tools.sh
83
+
```
66
84
85
+
It can also accept command-line arguments to specify specific files or
86
+
directories to check:
87
+
```shell
88
+
./dev/tools.sh PATH/TO/MY/FILE.PY
89
+
```
67
90
68
-
### Tooling
91
+
[tools-sh]: /dev/tools.sh
92
+
93
+
94
+
### Resources
69
95
70
96
- **[Python Guidelines — Creative Commons Open Source][ccospyguide]**
71
-
- [Black][black]: the uncompromising Python code formatter
72
-
- [flake8][flake8]: a python tool that glues together pep8, pyflakes, mccabe,
73
-
and third-party plugins to check the style and quality of some python code.
74
-
- [isort][isort]: A Python utility / library to sort imports.
75
-
- **Helper Scripts:**
76
-
- [`/dev/tools.sh`][tools.sh]: A script that runs `isort`, `black`, and `flake8` to automatically format and check the codebase for style issues.
77
-
78
-
To use the script, simply run the following command.
79
-
```
80
-
./dev/tools.sh
81
-
```
82
-
It can also accept command-line arguments to specify specific files or directories to check.
83
-
84
-
For example:
85
-
```
86
-
./dev/tools.sh path/to/my/file.py
87
-
```
88
-
- **GitHub Actions:**
89
-
- [`.github/workflows/python_static_analysis.yml`][python_static_analysis.yml]: A github workflow that checks the quality and style of code also using `isort`, `black`, and `flake8`.
90
-
91
-
The workflow is triggered automatically when you push changes to the main branch or open a pull request.
92
-
93
-
Once it's completed, review the results and fix any issues reported by the tools.
0 commit comments