1. Update version
=================

__version_info__ in pydevd.py


2. Create conda envs
=====================

set CONDA_FORCE_32BIT=1

conda create -y -f -n py27_32 python=2.7 cython numpy nose ipython pip
activate py27_32
pip install "django>=1.7,<1.8"
pip install -U "setuptools>=0.9"
pip install -U "pip>=1.4" "wheel>=0.21" twine
conda deactivate

conda create -y -f -n py36_32 python=3.6 cython numpy nose ipython pip
activate py36_32
pip install "django>=1.9"
pip install -U "setuptools>=0.9"
pip install -U "pip>=1.4" "wheel>=0.21" twine
conda deactivate

conda create -y -f -n py37_32 python=3.7 cython numpy pip
activate py37_32
pip install "django>=1.9"
pip install -U "setuptools>=0.9"
pip install -U "pip>=1.4" "wheel>=0.21" twine
conda deactivate

conda create -y -f -n py38_32 python=3.8 cython pip
activate py38_32
pip install "django>=1.9"
pip install -U "setuptools>=0.9"
pip install -U "pip>=1.4" "wheel>=0.21" twine
conda deactivate

conda create -y -f -n py39_32 python=3.9 cython pip
activate py39_32
pip install "django>=1.9"
pip install -U "setuptools>=0.9"
pip install -U "pip>=1.4" "wheel>=0.21" twine
conda deactivate

conda create -y -f -n py310_32 python=3.10 cython pip
activate py310_32
pip install "django>=1.9"
pip install -U "setuptools>=0.9"
pip install -U "pip>=1.4" "wheel>=0.21" twine
conda deactivate


set CONDA_FORCE_32BIT=

conda create -y -f -n py27_64 python=2.7 cython numpy nose ipython pip
activate py27_64
pip install "django>=1.7,<1.8"
pip install -U "setuptools>=0.9"
pip install -U "pip>=1.4" "wheel>=0.21" twine
conda deactivate


conda create -y -f -n py36_64 python=3.6 cython numpy nose ipython pip
activate py36_64
pip install "django>=1.9"
pip install -U "setuptools>=0.9"
pip install -U "pip>=1.4" "wheel>=0.21" twine
conda deactivate

conda create -y -f -n py37_64 python=3.7 cython numpy nose ipython pip
activate py37_64
pip install "django>=1.9"
pip install -U "setuptools>=0.9"
pip install -U "pip>=1.4" "wheel>=0.21" twine
conda deactivate

conda create -y -f -n py38_64 python=3.8 cython numpy nose ipython pip
activate py38_64
pip install "django>=1.9"
pip install -U "setuptools>=0.9"
pip install -U "pip>=1.4" "wheel>=0.21" twine
conda deactivate

conda create -y -f -n py39_64 python=3.9 cython pip
activate py39_64
pip install "django>=1.9"
pip install -U "setuptools>=0.9"
pip install -U "pip>=1.4" "wheel>=0.21" twine
conda deactivate

conda create -y -f -n py310_64 python=3.10 cython pip
activate py310_64
pip install "django>=1.9"
pip install -U "setuptools>=0.9"
pip install -U "pip>=1.4" "wheel>=0.21" twine
conda deactivate

### UPDATE CYTHON

set CONDA_FORCE_32BIT=1

activate py27_32
pip install cython==0.29.28
conda deactivate

activate py36_32
pip install cython==0.29.28
conda deactivate

activate py37_32
pip install cython==0.29.28
conda deactivate

activate py38_32
pip install cython==0.29.28
conda deactivate

activate py39_32
pip install cython==0.29.28
conda deactivate

activate py310_32
pip install cython==0.29.28
conda deactivate

set CONDA_FORCE_32BIT=

activate py27_64
pip install cython==0.29.28
conda deactivate

activate py36_64
pip install cython==0.29.28
conda deactivate

activate py37_64
pip install cython==0.29.28
conda deactivate

activate py38_64
pip install cython==0.29.28
conda deactivate

activate py39_64
pip install cython==0.29.28
conda deactivate

activate py310_64
pip install cython==0.29.28
conda deactivate

4. Regenerate the .pyx and .c
===============================

cd /D x:\pydev\plugins\org.python.pydev.core\pysrc
set PYTHONPATH=x:\pydev\plugins\org.python.pydev.core\pysrc
C:\bin\Python38-32\python build_tools\build.py

${ptvsd_folder}
cd /D X:\ptvsd_workspace\ptvsd\src\debugpy\_vendored\pydevd
set PYTHONPATH=X:\ptvsd_workspace\ptvsd\src\debugpy\_vendored\pydevd
C:\bin\Python38-32\python build_tools\build.py


cd ~/Desktop/Pydev/plugins/org.python.pydev.core/pysrc
export PYTHONPATH=~/Desktop/Pydev/plugins/org.python.pydev.core/pysrc
python build_tools/build.py

3. Generate new version
======================

cd /D x:\PyDev.Debugger

set PYTHONPATH=x:\PyDev.Debugger
set MINICONDA_ENVS=C:\bin\Miniconda3\envs
conda deactivate
C:\bin\Python38-32\python build_tools\build.py
C:\bin\Python38-32\python build_tools\build_binaries_windows.py

rm dist/pydevd*

activate py27_32
python setup.py sdist bdist_wheel
conda deactivate
dir dist

activate py36_32
python setup.py sdist bdist_wheel
conda deactivate
dir dist

activate py37_32
python setup.py sdist bdist_wheel
conda deactivate
dir dist

activate py38_32
python setup.py sdist bdist_wheel
conda deactivate
dir dist

activate py39_32
python setup.py sdist bdist_wheel
conda deactivate
dir dist

activate py310_32
python setup.py sdist bdist_wheel
conda deactivate
dir dist

activate py27_64
python setup.py sdist bdist_wheel
conda deactivate
dir dist

activate py36_64
python setup.py sdist bdist_wheel
conda deactivate
dir dist

activate py37_64
python setup.py sdist bdist_wheel
conda deactivate
dir dist

activate py38_64
python setup.py sdist bdist_wheel
conda deactivate
dir dist

activate py39_64
python setup.py sdist bdist_wheel
conda deactivate
dir dist

activate py310_64
python setup.py sdist bdist_wheel
conda deactivate
dir dist

# Note: uploading with twine gives an error in the end, but apparently it works (check final result in pypi).
twine upload dist/pydevd*

git tag pydev_debugger_2_8_0 -a -m "PyDev.Debugger 2.8.0"
git push --tags

