From 9cbdf8c4431b6cd33fa3293eff72d9b5b7ddc401 Mon Sep 17 00:00:00 2001 From: Zeecka Date: Thu, 8 Jan 2026 18:02:25 +0100 Subject: [PATCH] Update dev requirements --- .gitignore | 1 + CONTRIBUTING.md | 62 +++++++++++++++++++++------------ aperisolve/requirements-dev.txt | 6 ++++ 3 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 aperisolve/requirements-dev.txt diff --git a/.gitignore b/.gitignore index 7b0fdd9..61c8c3e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Python .env +.venv/ __pycache__/ .mypy_cache/ results/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c8346db..029a156 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,41 +60,57 @@ Contributions to the web interface are welcome: ## Code Style & Quality > [!IMPORTANT] -> Please follow the code style and run linters before submitting. +> Follow the project’s code style and run linters before submitting any code. -The project adheres to: +This project enforces: +- **Black** : line length 100 +- **Isort** : profile black +- **Flake8** : ignoring E203, E501, W503 +- **Pylint** : ignoring W0511, W0718, R0801, R0903, R0914 +- **Mypy** : ignoring unused-awaitable -- **Black** (line length 100) -- **Isort** (profile black) -- **Flake8** (ignoring E203, E501, W503) -- **Pylint** (ignoring W0718, R0903, R0801) -- **Mypy** (ignoring unused-awaitable) +See [.pre-commit-config.yaml](.pre-commit-config.yaml) for the exact configuration. -See [.pre-commit-config.yaml](.pre-commit-config.yaml) for exact configuration. - -### Running Linters Locally +### Setup > [!TIP] -> Install pre-commit hooks to automatically check your code before commits: -> ```bash -> pip install pre-commit -> pre-commit install -> ``` +> Use a virtual environment and install development dependencies: + +```bash +# Create & activate a virtual environment +python3 -m venv .venv +source .venv/bin/activate # Linux/macOS +# .venv\Scripts\activate # Windows + +# Install dev dependencies +pip install -r aperisolve/requirements-dev.txt +pip install -r aperisolve/requirements.txt +``` + +### Running Tools Manually + +Install pre-commit hooks to automatically check your code before commits: + +```bash +pre-commit install +``` + +Check for issues: + +```bash +pre-commit run --all-files +``` + +Format code: -**Manual checks:** ```bash -# Format code black . --line-length 100 isort . --profile black - -# Check for issues -flake8 . -pylint **/*.py -mypy . ``` > [!NOTE] -> CI will automatically run these checks on every PR. Make sure they pass! +> Continuous Integration (CI) runs all checks on every PR. Ensure your code passes before submitting. + ## Pull Request Guidelines diff --git a/aperisolve/requirements-dev.txt b/aperisolve/requirements-dev.txt new file mode 100644 index 0000000..4cfd75c --- /dev/null +++ b/aperisolve/requirements-dev.txt @@ -0,0 +1,6 @@ +black==25.12.0 +isort==7.0.0 +flake8==7.3.0 +mypy==1.18.1 +pylint==4.0.4 +pre-commit==4.5.1