Commit Graph
20 Commits
Author SHA1 Message Date
Matt HauffandGitHub 40db4635a8 [LABS-245] Enable PEP604 Ruff rules (#20269)
* Enable PEP604 Ruff rules

* Fix harcoded signature in test

* Hack CLVMStreamable test with note to fast follow
2025-11-18 12:34:00 -08:00
Matt HauffandGitHub fcdb8e4925 Manual fixes for upcoming Ruff pyupgrade push (#20213)
* Manual fixes

* Revert back to variable in type expression

* Fix streamable to handle UnionType
2025-11-03 09:16:42 -07:00
e947dd14c7 [LABS-244] Remove python 3.9 support (#20099)
* initial changes

* poetry fix

* Address ruff

* Install scripts issues

* Experiment a little bit

* Okay now try for rocky linux and use 3.12 instead

* Remove the now unused thing

* Use dnf for consistency

* Simplify installations

* Still need git

* relock poetry with 2.2.0

* relock poetry with 2.2.0

* try `git checkout main poetry.lock && .penv/bin/poetry lock` on altendky's system

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2025-10-14 07:19:52 -07:00
Matt HauffandGitHub a803dc0fa6 [CHIA-3633] August 2025 pass of Ruff linting rules (#19929)
* Enable Ruff `PLR1704` (`redefined-argument-from-local`)

* Enable Ruff `PLR5501` (`collapsible-else-if`)

* Enable Ruff `PLW2901` (`redefined-loop-name`)

* bad change

* Enable Ruff `RUF043` (`pytest-raises-ambiguous-pattern`)

* Enable Ruff `RUF046` (`unnecessary-cast-to-int`)

* Enable Ruff `RUF052` (`used-dummy-variable`)

* Remove unused ignore `UP006`

* One mis-signaled regex

* Comments by @altendky

* bad change, my bad
2025-08-11 14:39:12 -07:00
6050235bdb [CHIA-3043] Add (hopefully) non-controversial ruff rules (#19684)
* Add (hopefully) non-controversial ruff rules

* mypy-exclusions.txt

* PIE

* Fix pre-commit?

* PYI

* RSE

* S + ignores

* Whitespace fix

* Re-add build-init-files.py

* Add comment about security ignores

* Update mypy-exclusions.txt

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* Fix the executable status of build-init-files.py

* Set executable bit for tools/run_block.py and readd shebang

* Fix new errors

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2025-06-11 08:36:08 -07:00
Kyle AltendorfandGitHub 99448387ad add the keys root path to ChiaCliContext (#19420)
* add the keys root path to `ChiaCliContext`

* tidy
2025-03-24 14:41:06 -07:00
Kyle AltendorfandGitHub d50b6e0883 use chia_rs directly for sized bytes (#19326) 2025-02-28 09:35:25 -08:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Kyle Altendorf
bc99c7a283 build(deps): bump mypy from 1.14.1 to 1.15.0 (#19319)
* build(deps): bump mypy from 1.14.1 to 1.15.0

Bumps [mypy](https://github.com/python/mypy) from 1.14.1 to 1.15.0.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.14.1...v1.15.0)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* adjust accordingly

* remove another

* and windows

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2025-02-28 09:32:34 -08:00
Kyle AltendorfandGitHub 9a0b5728c5 use a class for the chia cli context data (#18919)
* use a class for the chia cli context data

* actually assign to the context properly...

* handle the not-present case

* catch up

* tidy

* more

* stuff

* ...

* more real

* expected address prefix
2024-12-19 10:44:48 -07:00
Kyle AltendorfandGitHub 45465b4865 move some non-framework items out of chia.cmds.cmd_classes (#19047)
* move some non-framework items out of `chia.cmds.cmd_classes`

* move the other new stuff too
2024-12-17 14:14:13 -07:00
61207d2435 [CHIA-1348] Port chia wallet coin commands to @chia_command framework (#18641)
* Extract TransactionsIn/Out

* Create a helper for coin selection arguments

* Port `chia wallet coins list`

* Unused item

* Add TransactionEndpoint

* Port `chia wallet coins combine`

* Port `chia wallet coins split`

* Delete test_coins.py

* Add test for TXConfig helpers

* Add test for TransactionEndpoint mixin

* Forgot to delete old split command

* test coverage

* coverage ignores

* Link old framework with new

* fix command tests

* fix signer test

* coverage ignores

* pre-commit

* Move tests back to rpc file

* Move coin functions back to their own file

* Move split above combine in rpc tests

* Stop duplicate name definitions

* new puzzle hashes allowed

* Address comments by @altendky

* more comments by @altendky

* Update chia/cmds/cmd_classes.py

Co-authored-by: Kyle Altendorf <sda@fstab.net>

* another comment by @altendky

* this one is the fault of @altendky

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-12-17 10:44:33 -07:00
Kyle AltendorfandGitHub 78afe07f28 first pass at using @chia_command without a group (#19040)
* first pass at using `@chia_command` without a group

* less slots
2024-12-13 11:49:16 -07:00
Kyle AltendorfandGitHub bc5ad74c99 more less default root path (#19031)
* more less default root path

* hmm
2024-12-13 11:39:55 -07:00
Kyle AltendorfandGitHub 3bfb4da50f explicitly set option parameter name based on field name for cmd classes (#18926) 2024-12-02 14:50:17 -07:00
Kyle AltendorfandGitHub 30a83ce791 adjust cmd class help parameters (#18921) 2024-11-22 10:50:55 -08:00
6c90a76b56 Tighten up ruff ignore list (#18837)
* Tighten up ruff ignore list

* Okay that fix was indeed unsafe

* enable type-name-incorrect-variance

* enable literal-membership

* enable non-augmented-assignment

* enable useless-return

* enable global-variable-not-assigned

* -

* fixup

* Clean up roff.toml from annotations

* use ignore instead of explicit re-export

* use more descriptive names

---------

Co-authored-by: Kyle Altendorf <sda@fstab.net>
2024-11-12 12:19:31 -07:00
Matt HauffandGitHub 6084112d48 [CHIA-1553] Replace pylint with ruff (#18759)
* Replace pylint with ruff

* poetry

* remove pylint

* Address comments by @altendky

* Undo formatting

* actually undo formatting
2024-10-25 15:55:37 -07:00
Kyle AltendorfandGitHub 9c8557a1f8 Remove Python 3.8 support and update source to 3.9 standards (#18687)
* manual python 3.8 removals

* poetry

* pyupgrade

* black

* isort

* manually tidy imports

* work around shadowed type

* catch up build network protocol files for pyupgrade changes

* placate pylint

* re-enable 20.04

* placate flake8
2024-10-16 14:21:15 -07:00
Matt HauffandGitHub 8fcfd20d88 [CHIA-958] In cmd class framework: help -> short_help (#18334)
help -> short_help
2024-07-18 09:39:29 -07:00
Matt HauffandGitHub 1821d6b575 Add new command class framework for easier testing (#17851)
* Add new command class framework for easier testing

* Add better test coverage

* Surface exception message

* textwrap.dedent

* remove unnecessary list

* Remove type check

* helper attribute variable name

* Rename helper attribute

* Simplify and statement

* Do some de-nesting

* Take default suggestion

* Add a __call__ method to the command parser

* subclass -> member

* Remove requirement that requied=False on optionals

* remove useless is_command_option

* Use global 'register' for special types

* Use a class for metadata optiona args

* Revert option args to class
2024-04-23 18:09:09 -07:00