You need to clarify your question.
Are you trying to compute the hash digest needed for signing a certain input using SIGHASH_SINGLE or are you stuck using a certain library with the "options" you posted?
Because if it is the former, the respond is too long and doesn't fit in one comment since we already have 3 output "families" (legacy, wit ver 0, wit ver 1) and sighash is computed differently for each of them. Both legacy and witness version 0 also have their own subcategories (like P2SH) which demand a different approach.
If you want details on a certain smaller part, be more specific otherwise if you want to know how
all of it works you have to check out the source code. The two SignatureHash methods inside
interpreter.cpp is a place to start.
Question is clear as it can be.
Now sharing additional info which shouldn't be needed by person which is involved in such script creation:
1. I am trying to put both inputs into one place because there is such need and don't know which place it should be, at which stage of python script which builds the transaction and was meant to create new raw hex tx data.
2. Library I am using is "bitcoin" with python 3.11. "bitcoin.core" and "bitcoin.wallet".
3. Output can be any, 1..., 3..., bc1.... However now the script is created for testnet. I am not asking about output, but inputs.
4. SigHash for now looks like that: sighash1 = SignatureHash(redeem_script1, tx, txin_index, SIGHASH_SINGLE, amount=amount1, sigversion=SIGVERSION_WITNESS_V0)
Hope that helps.