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
* Install mypy environment externally
* readme.md: Add instructions to install development dependencies in venv
* pyproject.toml: By default, run mypy only on the `bapctools` package
---------
Co-authored-by: Maarten Sijm <[email protected]>
You can also use the [Docker image](#Docker) or install [via Pip (experimental)](#Experimental-Pip-installation).
28
+
If you're interested in developing BAPCtools itself, see the installation instructions [at the end of this file](#Developing--Contributing-to-BAPCtools).
28
29
29
30
Otherwise, clone this repository and install the required dependencies manually.
30
31
(If you know how to make a Debian package, feel free to help out.)
@@ -227,17 +228,18 @@ and any hyphens should be replaced with an underscore (e.g., `no_bar: True` rath
227
228
These personal config files also allow to set the key `local_time_multiplier` to adjust hardcoded time limits intended for different hardware.
228
229
This might be useful for the CI or if your hadware is much faster or slower than the contest hardware.
229
230
230
-
## Contributing / Style guide
231
+
## Developing / Contributing to BAPCtools
231
232
232
-
- The python code in the repository is formatted using [Ruff](https://github.com/astral-sh/ruff)
233
-
and type-checked using [mypy](https://mypy-lang.org/).
234
-
To enable the pre-commit hook, install [pre-commit](https://pre-commit.com/)
235
-
with `pip` or your package manager (Arch: `python-pre-commit`) and run
236
-
`pre-commit install` from the repository root.
237
-
All python code will now automatically be formatted on each commit.
238
-
If you want to run the hooks before creating a commit,
239
-
use `pre-commit run` (only staged files) or `pre-commit run -a` (all files).
233
+
The recommended way to install all development dependencies is in a virtual environment,
234
+
created with `python3 -m venv venv` and activated with `. venv/bin/activate`.<br />
235
+
Install the development dependencies with `pip install --editable .[dev]`.
240
236
241
-
- Imports are usually ordered with system libraries first, followed by a
242
-
newline, followed by local includes. Both groups are sorted alphabetically,
243
-
and `import` comes before `from ... import`.
237
+
If you want to use your local development version of BAPCtools anywhere, you can create a symlink from any `bin` directory on your `$PATH` to the virtual environment, for example: `ln -s /path/to/BAPCtools/venv/bin/bt ~/bin/bt`
238
+
239
+
The Python code in the repository is formatted using [Ruff](https://github.com/astral-sh/ruff)
240
+
and type-checked using [mypy](https://mypy-lang.org/).
241
+
To enable the pre-commit hook,
242
+
run `pre-commit install` from the repository root.
243
+
All Python code will now automatically be formatted and type-checked on each commit.
244
+
If you want to run the hooks before creating a commit,
245
+
use `pre-commit run` (only staged files) or `pre-commit run -a` (all files).
0 commit comments