* Add ruff for shared mutable defaults (B)
* Apply B006, B008 on current files, except fast API
* Update agenthub/SWE_agent/prompts.py
Co-authored-by: Graham Neubig <neubig@gmail.com>
* fix unintended behavior change
* this is correct, tell Ruff to leave it alone
---------
Co-authored-by: Graham Neubig <neubig@gmail.com>
Co-authored-by: Boxuan Li <liboxuan@connect.hku.hk>
* ci/lint: fix calling Ruff's format
* Transition for ruff lint. Only checking the modified files.
---------
Co-authored-by: ifuryst <ifuryst@gmail.com>
* This has been a headache for a long time, and we had #1071 and #1100 with the hope to fix the inconsistent behaviour across linters and environments. However, we recently found out that double-quote-string-fixer plugin in pre-commit-hook has inconsistent behaviour on python 3.11 and 3.12. See discussion here. This is sad because while this plugin enforces single quote behaviour with 3.11, it doesn't always enforce so with 3.12. Specifically, with fstr syntax, this plugin allows both single quotes and double quotes with python 3.12.
The problem is, some developers have black linter installed/integrated with their IDE, which is probably the most popular linter in python world (ranked by GitHub stars). This linter insists on always using double quotes. Now we have black and double-quote-string-fixer fight each other (iff the developer uses python 3.12) for some quotes (fstr syntax).
After a lot of research, I couldn't find a way to enforce single quote behaviour without introducing a new dependency, flake8, together with a plugin for it to enforce quotes' behavior. I believe it's better off introducing the more popular black if we have to introduce a new linter. Since black and autopep8 sometimes fight each other, and they mostly overlap, I further remove autopep8.
The unfortunate consequence of this PR is that I had to revert all single quotes back to double quotes. This might cause some inconvenience to existing PRs as they have to resolve conflicts, but I believe the headache will be gone soon. That being said, I am open to abandon this PR if anyone has a better idea to solve the headache.
* Remove black
* Prevent black from changing quotes
* Use flake8 to enforce single quotes
* Fix quotes in config.py
* Add back autopep8
* Add make lint to run linters
* Fix pre-commit and linter versions to avoid surprise
To avoid surprising results on GitHub Actions, e.g. a new release of pre-commit starts to
reject all PRs, fix it to the latest version, 3.7.0. This PR also fixes ruff and mypy
versions in pyproject.toml since we very likely don't really need latest upgrades from
linters, and upgrades can always bring surprise.
* pre-commit-config: Use v0.3.7 for Ruff as in pyproject.toml
* create the pyproject file
* Fix the pyproject.toml file
* Update Makefile
* adapt makefile
* fix some execution issues
* Untrack lock files and wait for the backend to get start before frontend
* Remove LangChain dependencies
* Add github action for pytest
* add missing dependency
* rebase and fix the versions adding lock file
* add torch and pymupdfb deps
* some conflicts fixes
* Add dependencies evaluation group
* add poetry.lock
* Fix unexpected operator
---------
Co-authored-by: Robert Brennan <contact@rbren.io>
* don't modify directories
* oops typo
* dev_config/python
* add config to CI
* bump CI python to 3.10
* 3.11?
* del actions/
* add suggestions
* delete unused code
* missed some
* oops missed another one
* remove a file