use the //tools/codegen target in Bazel (#74465)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74465
This requires adding py_library and its PyPI dependency provider
"requirement".
ghstack-source-id: 152438643
Test Plan: Rely on CI to validate.
Reviewed By: malfet
Differential Revision: D35009795
fbshipit-source-id: 424c4968474b3c2fb37d2c7dba932b37605a63f7
(cherry picked from commit 91e442c3bf0e204b0fb6c98405aaaa7308011511)