Skip to content

DOC: Add "build C extensions" note #46055

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions doc/source/development/contributing_environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,27 @@ with a full pandas development environment.

**Docker Commands**

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

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

Even easier, you can integrate Docker with the following IDEs:
Run Container::

# Run a container and bind your local repo to the container
docker run -it -w /home/pandas --rm -v path-to-local-pandas-repo:/home/pandas pandas-yourname-env

.. note::
If you bind your local repo for the first time, you have to build the C extensions afterwards.
Run the following command inside the container::

python setup.py build_ext -j 4

You might need to rebuild the C extensions if/when you merge your repo with upstream/main.
Copy link
Member

@rhshadrach rhshadrach Feb 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You might need to rebuild the C extensions if/when you merge your repo with upstream/main.
You need to rebuild the C extensions anytime the Cython code in ``pandas/core/_libs`` changes. This most frequently occurs when changing or merging branches.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better would be to separate out this into a new section, something like "Rebuilding the C extensions" and going into a bit more detail as to the why/how/when. But certainly okay to leave it here for this PR.

Copy link
Contributor Author

@rendner rendner Feb 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhshadrach

  1. Is pandas/core/_libs right? Because such a folder does not exist. I think you mean pandas/_libs?

Even better would be to separate out this into a new section, something like "Rebuilding the C extensions"... But certainly okay to leave it here for this PR.

  1. That's a good idea. I can create a new issue if that is OK for you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, an issue would be great.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, an issue would be great.

I created one.


*Even easier, you can integrate Docker with the following IDEs:*

**Visual Studio Code**

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

Note that you might need to rebuild the C extensions if/when you merge with upstream/main using::

python setup.py build_ext -j 4


Creating an environment without Docker
---------------------------------------

Expand Down