A Desktop/Mobile CPU is not dependent on the type of OS installed.
That is why a User can install and use drifferent types of Operating Systems in the same PC without having to change CPU or hardware.
Unless the hardware doesn't meet with the Minimum System Requirements to run the OS in the PC.
It look like on Google searches that Ryzen CPUs not work with Win 7. Much talking about to make it run Win 7 with slipstreamming and workarounds. I am no wanting to do this. I looking for last/best desktop AMD CPU that work with Win 7 with no problem, no workarounds. Just 'native support', ready to go.
The main problem that I see concerning Ryzen processor Motherboards is installing Windows 7.
The problem with AM4 Motherboards is USB and Chipset driver support for Windows 7.
When it comes to installing Windows 7 on a Ryzen Motherboard you need to use a special method to it. Like use a PS/2 Keyboard and mouse instead of a USB Keyboard and mouse.
Most AM4 Motherboards have special instructions or procedures on how to install Windows 7 on the AM4 Motherboards.
But once Windows 7 is installed it will work normally as long as there are Windows 7 drivers to install.
Like I mentioned before, a CPU is not really dependent on the OS as long as your have the proper drivers that are compatible with the OS you have installed.
By the way, both AMD and Intel CPUs doesn't support Windows 7 according to this 4 year old Tech Article: https://www.anandtech.com/show/11182/how-to-get-ryzen-working-on-windows-7-x64
NOTE: For the time being it seems like Windows 7 is still supported on some APUs and GPUs. But eventually AMD will stop completely making drivers for Windows 7 since it isn't supported by Microsoft anymore with Windows Updates.
So if it is possible it is best to upgrade to Windows 10 which you still might be able to do with a valid Windows 7 Key or pay to upgrade to Windows 10.
EDIT: You can try using AM3+ Motherboards that still support Windows 7. I had a FX8350 Processor when I upgraded from Windows Vista to Windows 7.
But AM4 processors are much superior to AM3+ processors. Before you purchase a Motherboard find out if it is compatible with Windows 7. Many times it will says it is compatible with so and so OS.