From 8dcb6f968d40021bc97bad683a3a9f431bcc8ab7 Mon Sep 17 00:00:00 2001 From: Georgi Baychev Date: Sat, 19 Oct 2019 20:58:01 +0200 Subject: [PATCH 1/7] DOC: Add instructions how to activate virtual env under windows with pip Contributing.rst now correctly describes how to setup dev environment under Windows Closes #29112 --- doc/source/development/contributing.rst | 4 ++++ doc/source/whatsnew/v1.0.0.rst | 1 + 2 files changed, 5 insertions(+) diff --git a/doc/source/development/contributing.rst b/doc/source/development/contributing.rst index 949b6bd475319..15beea3977576 100644 --- a/doc/source/development/contributing.rst +++ b/doc/source/development/contributing.rst @@ -245,6 +245,10 @@ You'll need to have at least python3.5 installed on your system. # Any parent directories should already exist python3 -m venv ~/virtualenvs/pandas-dev # Activate the virtualenv + # If you are using Windows and Powershell you need to run: + # ~/virtualenvs/pandas-dev/Scripts/Activate.ps1 + # or if you are using Windows and command prompt (cmd.exe): + # ~/virtualenvs/pandas-dev/Scripts/activate.bat . ~/virtualenvs/pandas-dev/bin/activate # Install the build dependencies diff --git a/doc/source/whatsnew/v1.0.0.rst b/doc/source/whatsnew/v1.0.0.rst index 48c1173a372a7..8f2378e9404c1 100644 --- a/doc/source/whatsnew/v1.0.0.rst +++ b/doc/source/whatsnew/v1.0.0.rst @@ -195,6 +195,7 @@ Documentation Improvements - Added new section on :ref:`scale` (:issue:`28315`). - Added sub-section Query MultiIndex in IO tools user guide (:issue:`28791`) +- Added hints how setup a dev environment under Windows when using pip only (:issue:`29112`) .. _whatsnew_1000.deprecations: From d94c5a1bd2ea9e48f205913435f97e773e04f40a Mon Sep 17 00:00:00 2001 From: Georgi Baychev Date: Wed, 23 Oct 2019 20:24:41 +0200 Subject: [PATCH 2/7] Remove the unneeded whatsnew entry --- doc/source/whatsnew/v1.0.0.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/whatsnew/v1.0.0.rst b/doc/source/whatsnew/v1.0.0.rst index 8f2378e9404c1..48c1173a372a7 100644 --- a/doc/source/whatsnew/v1.0.0.rst +++ b/doc/source/whatsnew/v1.0.0.rst @@ -195,7 +195,6 @@ Documentation Improvements - Added new section on :ref:`scale` (:issue:`28315`). - Added sub-section Query MultiIndex in IO tools user guide (:issue:`28791`) -- Added hints how setup a dev environment under Windows when using pip only (:issue:`29112`) .. _whatsnew_1000.deprecations: From 7aaf27079be28c07393ec754332feca430cde2a6 Mon Sep 17 00:00:00 2001 From: Georgi Baychev Date: Wed, 23 Oct 2019 22:18:13 +0200 Subject: [PATCH 3/7] Refer to the official user guide regarding the activation of virtual env --- doc/source/development/contributing.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/source/development/contributing.rst b/doc/source/development/contributing.rst index 15beea3977576..8f181d063e4a5 100644 --- a/doc/source/development/contributing.rst +++ b/doc/source/development/contributing.rst @@ -243,12 +243,16 @@ You'll need to have at least python3.5 installed on your system. # Create a virtual environment # Use an ENV_DIR of your choice. We'll use ~/virtualenvs/pandas-dev # Any parent directories should already exist + # If you are using Windows and command prompt, replace ~ (the tilde sign) + # with %userprofile% python3 -m venv ~/virtualenvs/pandas-dev + # Activate the virtualenv - # If you are using Windows and Powershell you need to run: - # ~/virtualenvs/pandas-dev/Scripts/Activate.ps1 - # or if you are using Windows and command prompt (cmd.exe): - # ~/virtualenvs/pandas-dev/Scripts/activate.bat + # If you are using Windows, you can find the activation scripts under + # ~\virtualenvs\pandas-dev\scripts + # Please refer to the official user guide at + # https://virtualenv.pypa.io/en/stable/userguide/#activate-script + # about how to activate your virtual environment under Windows . ~/virtualenvs/pandas-dev/bin/activate # Install the build dependencies From 39f6fa71a6945cb5edebb942f36e8f703176ae7d Mon Sep 17 00:00:00 2001 From: Georgi Baychev Date: Thu, 24 Oct 2019 21:34:30 +0200 Subject: [PATCH 4/7] Move the Windows doc about venv with pip into a separate code block Relevant issue #29112 --- doc/source/development/contributing.rst | 32 +++++++++++++++++++------ 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/doc/source/development/contributing.rst b/doc/source/development/contributing.rst index 8f181d063e4a5..62e1d17dc4330 100644 --- a/doc/source/development/contributing.rst +++ b/doc/source/development/contributing.rst @@ -238,21 +238,16 @@ Creating a Python environment (pip) If you aren't using conda for your development environment, follow these instructions. You'll need to have at least python3.5 installed on your system. +**Unix**/**Mac OS** + .. code-block:: none # Create a virtual environment # Use an ENV_DIR of your choice. We'll use ~/virtualenvs/pandas-dev # Any parent directories should already exist - # If you are using Windows and command prompt, replace ~ (the tilde sign) - # with %userprofile% python3 -m venv ~/virtualenvs/pandas-dev # Activate the virtualenv - # If you are using Windows, you can find the activation scripts under - # ~\virtualenvs\pandas-dev\scripts - # Please refer to the official user guide at - # https://virtualenv.pypa.io/en/stable/userguide/#activate-script - # about how to activate your virtual environment under Windows . ~/virtualenvs/pandas-dev/bin/activate # Install the build dependencies @@ -262,6 +257,29 @@ You'll need to have at least python3.5 installed on your system. python setup.py build_ext --inplace -j 4 python -m pip install -e . --no-build-isolation +**Windows** + +Below is a brief overview on how to set-up a virtual environment with Powershell +under Windows. For details please refer to the \ +`official virtualenv user guide `__ + +.. code-block:: none + + # Create a virtual environment + # Use an ENV_DIR of your choice. We'll use ~\virtualenvs\pandas-dev + # Any parent directories should already exist + python -m venv ~\virtualenvs\pandas-dev + + # Activate the virtualenv + ~\virtualenvs\pandas-dev\Scripts\Activate.ps1 + + # Install the build dependencies + python -m pip install -r requirements-dev.txt + + # Build and install pandas + python setup.py build_ext --inplace -j 4 + python -m pip install -e . --no-build-isolation + Creating a branch ----------------- From e1d3a6dcb39429a022b55a48d5851c98978c97ce Mon Sep 17 00:00:00 2001 From: Georgi Baychev Date: Fri, 25 Oct 2019 12:54:01 +0200 Subject: [PATCH 5/7] Additional refinement - add aditional information about cmd.exe - use $env:Userprofile where appropriate - add --use-no-pep517 to the windows instruction - add some syntax highlight Relevant issue #29113 --- doc/source/development/contributing.rst | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/doc/source/development/contributing.rst b/doc/source/development/contributing.rst index 62e1d17dc4330..8f337645e90f0 100644 --- a/doc/source/development/contributing.rst +++ b/doc/source/development/contributing.rst @@ -240,7 +240,7 @@ You'll need to have at least python3.5 installed on your system. **Unix**/**Mac OS** -.. code-block:: none +.. code-block:: bash # Create a virtual environment # Use an ENV_DIR of your choice. We'll use ~/virtualenvs/pandas-dev @@ -260,25 +260,30 @@ You'll need to have at least python3.5 installed on your system. **Windows** Below is a brief overview on how to set-up a virtual environment with Powershell -under Windows. For details please refer to the \ +under Windows. For details please refer to the `official virtualenv user guide `__ -.. code-block:: none +.. code-block:: powershell # Create a virtual environment - # Use an ENV_DIR of your choice. We'll use ~\virtualenvs\pandas-dev + # Use an ENV_DIR of your choice. We'll use ~\virtualenvs\pandas-dev where + # '~' is the folder pointed to by either $env:USERPROFILE (Powershell) or + # %USERPROFILE% (cmd.exe) environment variable # Any parent directories should already exist - python -m venv ~\virtualenvs\pandas-dev + + # If you are using cmd.exe, run instead: python -m venv $env:USERPROFILE\virtualenvs\pandas-dev + python -m venv $env:USERPROFILE\virtualenvs\pandas-dev # Activate the virtualenv - ~\virtualenvs\pandas-dev\Scripts\Activate.ps1 + # If you are using cmd.exe, run instead: %USERPROFILE%\virtualenvs\pandas-dev\Scripts\activate.bat + ~\virtualenvs\pandas-dev\Scripts\Activate.ps1 # Install the build dependencies python -m pip install -r requirements-dev.txt # Build and install pandas python setup.py build_ext --inplace -j 4 - python -m pip install -e . --no-build-isolation + python -m pip install -e . --no-build-isolation --no-use-pep517 Creating a branch ----------------- From 776e542436c0d36b0c7727084a8d1e8b2598c996 Mon Sep 17 00:00:00 2001 From: Georgi Baychev Date: Fri, 1 Nov 2019 18:58:28 +0100 Subject: [PATCH 6/7] PR improvements - remove trailing spacing remove - change the setup.py params so that all CPU cores will be utilized - split cmd.exe instructions on a separate line Related issue #29112 --- doc/source/development/contributing.rst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/doc/source/development/contributing.rst b/doc/source/development/contributing.rst index 8f337645e90f0..6087d3abeafa1 100644 --- a/doc/source/development/contributing.rst +++ b/doc/source/development/contributing.rst @@ -254,35 +254,37 @@ You'll need to have at least python3.5 installed on your system. python -m pip install -r requirements-dev.txt # Build and install pandas - python setup.py build_ext --inplace -j 4 + python setup.py build_ext --inplace -j 0 python -m pip install -e . --no-build-isolation **Windows** Below is a brief overview on how to set-up a virtual environment with Powershell -under Windows. For details please refer to the +under Windows. For details please refer to the `official virtualenv user guide `__ .. code-block:: powershell # Create a virtual environment # Use an ENV_DIR of your choice. We'll use ~\virtualenvs\pandas-dev where - # '~' is the folder pointed to by either $env:USERPROFILE (Powershell) or + # '~' is the folder pointed to by either $env:USERPROFILE (Powershell) or # %USERPROFILE% (cmd.exe) environment variable # Any parent directories should already exist - # If you are using cmd.exe, run instead: python -m venv $env:USERPROFILE\virtualenvs\pandas-dev - python -m venv $env:USERPROFILE\virtualenvs\pandas-dev + # If you are using cmd.exe, run instead: + # python -m venv %USERPROFILE%\virtualenvs\pandas-dev + python -m venv $env:USERPROFILE\virtualenvs\pandas-dev # Activate the virtualenv - # If you are using cmd.exe, run instead: %USERPROFILE%\virtualenvs\pandas-dev\Scripts\activate.bat - ~\virtualenvs\pandas-dev\Scripts\Activate.ps1 + # If you are using cmd.exe, run instead: + # %USERPROFILE%\virtualenvs\pandas-dev\Scripts\activate.bat + ~\virtualenvs\pandas-dev\Scripts\Activate.ps1 # Install the build dependencies python -m pip install -r requirements-dev.txt # Build and install pandas - python setup.py build_ext --inplace -j 4 + python setup.py build_ext --inplace -j 0 python -m pip install -e . --no-build-isolation --no-use-pep517 Creating a branch From dc93e56b926f0828987f396101aa0a18d42b8d0b Mon Sep 17 00:00:00 2001 From: Georgi Baychev Date: Fri, 1 Nov 2019 21:07:43 +0100 Subject: [PATCH 7/7] Extract some windows pip venv comment insturctions into a separate paragraph --- doc/source/development/contributing.rst | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/doc/source/development/contributing.rst b/doc/source/development/contributing.rst index 6087d3abeafa1..61f660c23d8d4 100644 --- a/doc/source/development/contributing.rst +++ b/doc/source/development/contributing.rst @@ -263,21 +263,17 @@ Below is a brief overview on how to set-up a virtual environment with Powershell under Windows. For details please refer to the `official virtualenv user guide `__ +Use an ENV_DIR of your choice. We'll use ~\virtualenvs\pandas-dev where +'~' is the folder pointed to by either $env:USERPROFILE (Powershell) or +%USERPROFILE% (cmd.exe) environment variable. Any parent directories +should already exist. + .. code-block:: powershell # Create a virtual environment - # Use an ENV_DIR of your choice. We'll use ~\virtualenvs\pandas-dev where - # '~' is the folder pointed to by either $env:USERPROFILE (Powershell) or - # %USERPROFILE% (cmd.exe) environment variable - # Any parent directories should already exist - - # If you are using cmd.exe, run instead: - # python -m venv %USERPROFILE%\virtualenvs\pandas-dev python -m venv $env:USERPROFILE\virtualenvs\pandas-dev - # Activate the virtualenv - # If you are using cmd.exe, run instead: - # %USERPROFILE%\virtualenvs\pandas-dev\Scripts\activate.bat + # Activate the virtualenv. Use activate.bat for cmd.exe ~\virtualenvs\pandas-dev\Scripts\Activate.ps1 # Install the build dependencies