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
Copy file name to clipboardExpand all lines: README.md
+55-1Lines changed: 55 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,8 @@ if __name__ == '__main__':
108
108
print(f"API request error: {re}")
109
109
except Exception as e:
110
110
print(f"An unexpected error occurred: {e}")
111
-
```
111
+
112
+
### How to Run the Example Script
112
113
113
114
To run the example script (e.g., if it's `src/examples/basic.py`), ensure your virtual environment is activated and you are in the project root directory:
114
115
@@ -121,6 +122,59 @@ python src/examples/basic.py
121
122
For more details on the API endpoints and responses, refer to the unofficial Gist:
This section outlines tools and practices for developing `furthermore-py`.
128
+
129
+
### Linting and Formatting
130
+
131
+
This project uses [Ruff](https://github.com/astral-sh/ruff) for linting and code formatting to ensure code quality and consistency.
132
+
133
+
**Installation:**
134
+
135
+
Ruff is included as a development dependency in`pyproject.toml`. If you followed the main installation steps using `uv pip install .` or `uv sync`, and it included development dependencies (e.g., via an extras group like `dev`if configured, or by default if not specified otherwise), Ruff should already be installed.
136
+
137
+
To ensure you have all development dependencies, you can explicitly install them. If your `pyproject.toml` defines a `dev` extras group like this:
138
+
139
+
```toml
140
+
[project.optional-dependencies]
141
+
dev = [
142
+
"ruff>=0.11.8",
143
+
# ... other dev tools
144
+
]
145
+
```
146
+
147
+
Then install with:
148
+
```bash
149
+
uv pip install .[dev]
150
+
```
151
+
152
+
If development dependencies are listed directly under `[project.dependencies]` or there isn't a specific `dev` group for them, the standard `uv pip install .` or `uv sync` should suffice.
153
+
154
+
**Configuration:**
155
+
156
+
Ruff is configured in the `pyproject.toml` file under the `[tool.ruff]` section. This includes settings for line length, selected rules, and formatting preferences.
157
+
158
+
**Usage:**
159
+
160
+
Make sure your virtual environment is activated (`source .venv/bin/activate`).
161
+
162
+
- **To check for linting issues:**
163
+
```bash
164
+
uv run ruff check .
165
+
```
166
+
167
+
- **To automatically fix linting issues (where possible) and format the code:**
168
+
First, apply formatting:
169
+
```bash
170
+
uv run ruff format .
171
+
```
172
+
Then, apply lint fixes:
173
+
```bash
174
+
uv run ruff check . --fix
175
+
```
176
+
Ruff's formatter will handle most style issues, and `check --fix` will address other auto-fixable linting errors.
177
+
124
178
## Contributing
125
179
126
180
(Details on how to contribute to this project, if applicable.)
0 commit comments