Skip to content

Commit 017a645

Browse files
authored
DOC: Add "build C extensions" note (pandas-dev#46055)
1 parent f1dc278 commit 017a645

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

doc/source/development/contributing_environment.rst

+18-9
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,28 @@ with a full pandas development environment.
2626

2727
**Docker Commands**
2828

29-
Pass your GitHub username in the ``DockerFile`` to use your own fork::
29+
Build the Docker image::
3030

3131
# Build the image pandas-yourname-env
3232
docker build --tag pandas-yourname-env .
33-
# Run a container and bind your local forked repo, pandas-yourname, to the container
34-
docker run -it --rm -v path-to-pandas-yourname:/home/pandas-yourname pandas-yourname-env
33+
# Or build the image by passing your GitHub username to use your own fork
34+
docker build --build-arg gh_username=yourname --tag pandas-yourname-env .
3535

36-
Even easier, you can integrate Docker with the following IDEs:
36+
Run Container::
37+
38+
# Run a container and bind your local repo to the container
39+
docker run -it -w /home/pandas --rm -v path-to-local-pandas-repo:/home/pandas pandas-yourname-env
40+
41+
.. note::
42+
If you bind your local repo for the first time, you have to build the C extensions afterwards.
43+
Run the following command inside the container::
44+
45+
python setup.py build_ext -j 4
46+
47+
You need to rebuild the C extensions anytime the Cython code in ``pandas/_libs`` changes.
48+
This most frequently occurs when changing or merging branches.
49+
50+
*Even easier, you can integrate Docker with the following IDEs:*
3751

3852
**Visual Studio Code**
3953

@@ -47,11 +61,6 @@ Enable Docker support and use the Services tool window to build and manage image
4761
run and interact with containers.
4862
See https://www.jetbrains.com/help/pycharm/docker.html for details.
4963

50-
Note that you might need to rebuild the C extensions if/when you merge with upstream/main using::
51-
52-
python setup.py build_ext -j 4
53-
54-
5564
Creating an environment without Docker
5665
---------------------------------------
5766

0 commit comments

Comments
 (0)