-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Create DockerFile and devcontainer.json files to work with Docker and VS Code in Containers #30638
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
Conversation
Co-Authored-By: gfyoung <[email protected]>
@WillAyd : Could you have a look? |
|
||
Instead of manually setting up a development environment, you can use Docker to | ||
automatically create the environment with just several commands. Pandas provides a `DockerFile` | ||
in the root directory to build a Docker image with a full pandas development environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth linking the docker installation guide in this section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where's that? I never saw a docker section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried this out today in VS Code and I think looks good. Some minor comment otherwise @jreback for thoughts
Dockerfile
Outdated
RUN mkdir "$pandas_home" \ | ||
&& git clone "https://github.com/$gh_username/pandas.git" "$pandas_home" \ | ||
&& cd "$pandas_home" \ | ||
&& git remote add upstream "https://github.com/pandas-dev/pandas.git" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you pull from upstream master after this step? Should keep up with the latest changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just did
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm don't see this in the diff. Should be a git pull upstream master
in there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I thought you meant on my changes in the PR, lol, not in the DockerFile. got it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @WillAyd is requesting that the Dockerfile has a git pull upstream master
?
Though I'm not sure that would achieve the desired effect, since it only happens when the docker image is built. How often does that happen? How does a person starting up a container ensure they're working with a fresh copy of pandas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, the main use case is setting up a fresh env for some dev work, using this DockerFile
and the devcontainer.json
. Once you are using that env, if you use it for a while, it's up to the user to keep the code up to date with master. This is just intended for first time set up.
But the real value of this is that's it's dead simple to delete and create a new env in VS Online or with containers, so the usual use case is just to create a new env and not use an existing one for a while.
So I guess this line is indeed unnecessary, and I should remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you agree before I revert that commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think either this should stay or should remove the build step later. Doesn't make sense to build an outdated version for development
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure I follow you there. this is the same steps as the instructions in the main docs. Even if we remove git pull upstream master
, how is this an outdated version? We just cloned the repo 2 lines before this, like 5 seconds ago
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think looks good to start. @pandas-dev/pandas-core any other thoughts?
Two questions, neither blockers. Is the root directory the ideal/only place for this? Do we need to worry about this getting out of date? |
@jbrockmendel per the VS Code docs |
Hi all, just bumping this in case it gets stale @pandas-dev/pandas-core can we merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yehoshuadimarsky : Sorry for the radio silence! Let's merge and see how this goes.
Thank you for the patience and effort in putting this together! 🚀
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
The instructions aren't that well written, and should probably be improved, but here's a first shot.