Repository: pytorch
Issue: PyTorch Preview (Nightly) version number does not comply with Conda conventions
Labels: module: binaries,triaged

### 🐛 Describe the bug

Conda environments using PyTorch Preview (Nightly) builds cannot be easily exported and recreated because of the way the package version number changes every night, and previous builds are no longer available.

This requires the user to manually edit their Conda environment file daily to remove the date from the PyTorch package version number, e.g., changing it from `pytorch=1.13.0.dev20220614` to `pytorch=1.13.0.*`.

The user experience with Conda would be better if `dev20220614` were removed from the package version number. Then `conda env export --no-builds` would work for PyTorch as for all other packages available via Conda.

Below are all the steps required to reproduce this issue.

---

Create a new Conda environment:

`$ conda create --name pytorch-nightly python=3.9.13 --no-default-packages`

Active the Conda environment:

`$ conda activate pytorch-nightly`

Install the newest PyTorch Preview (Nightly) build via Conda:

`$ conda install pytorch -c pytorch-nightly`

Export the Conda environment to a file, with and without build specifications:

`$ conda env export > with_environment.yml`

`$ conda env export --no-builds > without_environment.yml`

Compare the resulting files:

```
$ diff with_environment.yml without_environment.yml 
7,25c7,25
<   - bzip2=1.0.8=h3422bc3_4
<   - ca-certificates=2022.5.18.1=h4653dfc_0
<   - libffi=3.4.2=h3422bc3_5
<   - libzlib=1.2.12=h90dfc92_0
<   - ncurses=6.3=h07bb92c_1
<   - openssl=3.0.3=ha287fd2_0
<   - pip=22.1.2=pyhd8ed1ab_0
<   - python=3.9.13=h96fcbfb_0_cpython
<   - python_abi=3.9=2_cp39
<   - pytorch=1.13.0.dev20220614=py3.9_0
<   - readline=8.1.2=h46ed386_0
<   - setuptools=62.3.4=py39h2804cbe_0
<   - sqlite=3.38.5=h40dfcc0_0
<   - tk=8.6.12=he1e0b03_0
<   - typing_extensions=4.2.0=pyha770c72_1
<   - tzdata=2022a=h191b570_0
<   - wheel=0.37.1=pyhd8ed1ab_0
<   - xz=5.2.5=h642e427_1
<   - zlib=1.2.12=h90dfc92_0
---
>   - bzip2=1.0.8
>   - ca-certificates=2022.5.18.1
>   - libffi=3.4.2
>   - libzlib=1.2.12
>   - ncurses=6.3
>   - openssl=3.0.3
>   - pip=22.1.2
>   - python=3.9.13
>   - python_abi=3.9
>   - pytorch=1.13.0.dev20220614
>   - readline=8.1.2
>   - setuptools=62.3.4
>   - sqlite=3.38.5
>   - tk=8.6.12
>   - typing_extensions=4.2.0
>   - tzdata=2022a
>   - wheel=0.37.1
>   - xz=5.2.5
>   - zlib=1.2.12
```

Notice that `dev20220614` is a part of the `pytorch` _package version number_ (not its _build specification_).

Wait until the next Preview (Nightly) build is released.

Deactivate and delete the Conda environment you created earlier:

`$ conda deactivate`

`$ conda env remove --name pytorch-nightly`

Recreate the environment from the file created earlier:

`$ conda env create --file without_environment.yml`

Notice the error message:

```
Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound: 
  - pytorch=1.13.0.dev20220614
```

### Versions

```
Collecting environment information...
PyTorch version: 1.13.0.dev20220614
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 12.4 (arm64)
GCC version: Could not collect
Clang version: 13.1.6 (clang-1316.0.21.2.5)
CMake version: version 3.23.2
Libc version: N/A

Python version: 3.9.13 | packaged by conda-forge | (main, May 27 2022, 17:01:00)  [Clang 13.0.1 ] (64-bit runtime)
Python platform: macOS-12.4-arm64-i386-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.21.6
[pip3] torch==1.13.0.dev20220614
[conda] numpy                     1.21.6           py39h690d673_0    conda-forge
[conda] pytorch                   1.13.0.dev20220614         py3.9_0    pytorch-nightly
```

cc @ezyang @seemethere @malfet