Support Python 3.12
More an FYI: Was able to compile/build a wheel "successfully" using the latest pull from master by forcing --repo_env=TF_PYTHON_VERSION=3.11 - Unfortunately, although the wheel was successfully created under python/3.12.0, it (perhaps understandably) refused to install with the message:
ERROR: tensorflow-2.15.0-cp311-cp311-linux_x86_64.whl is not a supported wheel on this platform. Extracting the wheel also results in a similar error: "module was compiled for Python 3.11"
Is it possible to force an attempt for a cp312 compatible build? It is easy enough to edit tensorflow/tools/toolchains/python/python_repo.bzl to add "3.12" to VERSIONS, which will let you set TF_PYTHON_VERSION=3.12.

But then you will encounter this build failure:

> ERROR: Traceback (most recent call last):
> 	File ".../tensorflow/WORKSPACE", line 32, column 27, in <toplevel>
> 		python_register_toolchains(
> 	File ".../.cache/bazel/.../40192ecc60b78c448056886e209e7d2b/external/rules_python/python/repositories.bzl", line 532, column 31, in python_register_toolchains
> 		sha256 = tool_versions[python_version]["sha256"].get(platform, None)
> Error: key "3.12" not found in dictionary

I am pretty sure this cannot be made to work until [rules_python](https://github.com/bazelbuild/rules_python) gets support for 3.12, and I do not even see an open issue for that yet. The TF build process is quite long, taking several weeks. Since Python 3.12 was not released at the time of TF branch cut it couldn't be supported by the newly released TF.

The team is working to reduce the time window between a Python version and the time TF supports it, but support cannot be added after the branch was cut. Python's development process includes a pretty lengthy beta + release candidate cycle. Python 3.12 candidate 1 was released on 8/6, for example.

If someone submitted a pull request to add support for a Python beta or release candidate, would it be accepted? For future reference. If CI can support testing with new versions of Python, then I think that should be possible. However, note that TF has a large number of dependencies and those will need to work before TF can support the new version of Python.

We've had issues in the past where some dependency did not release a wheel for new version of Python for nearly half a year. > TF has a large number of dependencies and those will need to work before TF can support the new version of Python.

Can we please have a checklist of those deps that are not yet shipping Py3.12 versions?
* [x] [rules_python v0.26.0](https://github.com/bazelbuild/rules_python/releases) has some level of Py3.12 support cc @MichaelHudgins for 

> > TF has a large number of dependencies and those will need to work before TF can support the new version of Python.
> 
> Can we please have a checklist of those deps that are not yet shipping Py3.12 versions?
> 
> * [x]  [rules_python v0.26.0](https://github.com/bazelbuild/rules_python/releases) has some level of Py3.12 support

 That being said, have a look at #62155  On at least the Linux side our upstream dependencies are present and we have local 3.12 builds successful with some test errors that will still need addressed.  We are in the process of adding 3.12 to the CI system and hope to have nightlies soon. 

Edit:
We are also working on the macOS and Windows side but are still assessing any additional work that needs to be done on them. Has there been any progress on this issue?

I tried installing TF with these commands:

```bash
python3 -m venv .venv  # create a virtual environment named .venv
source ./.venv/bin/activate  # activate the venv
pip3 install tensorflow  # install
```

Got this error:

```
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
```

macOS 14.1.1
Python 3.12.0
pip 23.3.1
M2 Macbook Air (arm64 I think) `tf-nightly` would be the first one to get support.

https://pypi.org/project/tf-nightly/#files already shows some `cp312` files, so this should work already @mihaimaruseac  - Seems like the file is for Linux, but thank you for pointing this out! Will wait for the macOS version :) MacOS is no longer released officially by the Google team, it's a partner project so it takes longer due to synchronization needs, etc. DIdn't know that! Thank you. How about the windows version? That is also built by partners. Google only builds the Linux wheels now Who are the "partners"?  Do they have GitHub repos that MacOS and Windows users can contribute to? Try checking the @Google organization? ;-) 2.6k repos. > ;-) 2.6k repos.

Can't you commit directly to this repo? > Who are the "partners"? Do they have GitHub repos that MacOS and Windows users can contribute to?

https://blog.tensorflow.org/2022/09/announcing-tensorflow-official-build-collaborators.html

They contribute directly here, in this repository, but they need to release separate wheels that TF then installs. For example https://pypi.org/project/tensorflow-intel/ for windows Is there any known ETA for Python 3.12 compatibility? So, nightly for Linux exists and will be included in the next TF release. By that time, I think the other operating systems will have added support too. Any updates? Same status as [3 weeks ago](https://github.com/tensorflow/tensorflow/issues/62003#issuecomment-1837679866). There has been no release of TensorFlow stable, only nightly releases Could we also add to the checklist:

- [ ] Python 3.12 wheels for [`tflite-runtime-nightly`](https://pypi.org/project/tflite-runtime-nightly)? hi, any new status? > Same status as [3 weeks ago](https://github.com/tensorflow/tensorflow/issues/62003#issuecomment-1837679866). There has been no release of TensorFlow stable, only nightly releases

This is still true It's here: https://github.com/tensorflow/tensorflow/releases/tag/v2.16.1

(edit: To be clear, I am not a tensorflow contributor. I am just monitoring the release.) Awesome. Then this can be closed now, right?

Thank you for the patience
### Issue type

Support

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

binary

### TensorFlow version

tf 2.15.0.dev

### Custom code

No

### OS platform and distribution

Linux Fedora 39

### Mobile device

_No response_

### Python version

3.12

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

No Python3.12 compatbility and wheels.

This issue can be used as a tracking issue. This includes:

 - [ ] TensorFlow builds fully on Python 3.12
 - [ ] All TensorFlow tests pass on Python 3.12
 - [ ] All CI is run and green on Python 3.12
 - [ ] Wheels are uploaded to PyPI for [tf-nightly](https://pypi.org/project/tf-nightly/#files)
   - [ ] Linux
   - [ ] macOS
   - [ ] Windows
 - [ ] Wheels are uploaded to PyPI for at least one TensorFlow release

### Standalone code to reproduce the issue

```shell
python3.12 -m venv venv
source venv/bin/activate
pip install -U pip setuptools wheel
pip install tf-nightly --pre
```


### Relevant log output

```shell
ERROR: Could not find a version that satisfies the requirement tf-nightly (from versions: none)
ERROR: No matching distribution found for tf-nightly

Prior editiions:
- [2011/3.11](https://github.com/tensorflow/tensorflow/issues/58032#issuecomment-1279963648)
- [2010/3.10](https://github.com/tensorflow/tensorflow/issues/51776#issuecomment-934569048)
- [2009/3.9](https://github.com/tensorflow/tensorflow/issues/44485)
- [2008/3.8](https://github.com/tensorflow/tensorflow/issues/33374)

TF 2.14 has just shipped, meaning we'll likely have to wait for TF 2.15/2.16 again.
```
