Repository navigation
DOC: Update dev workflow example - #10849
Conversation
mhvk
left a comment
There was a problem hiding this comment.
Good to give this a clean-up. A smaller comment about git commands, but a larger one about testing - I think we should get people used to tox, but this implies that we should let it handle virtual environments too...
| git push --set-upstream origin fix-1761 # tell my github acct about it | ||
| git checkout astropy/master -b fix-1761 # branch based on latest from GitHub | ||
| # and switch to this branch | ||
| git push your-user-name fix-1761 # tell my GitHub acct about it |
There was a problem hiding this comment.
I'm confused why this is here (and in the original). If you do it later, when the work is ready, then github will give you a nice web link to copy & paste to do the PR.
Also, if you keep it here, I would keep the --set-upstream...
There was a problem hiding this comment.
for what it's worth, I never manually say --set-upstream. Otherwise I agree that it might be better to push only once some work is done to get the github pop-up for opening the PR (maybe it also works when pushing for an existing branch?, I've never tried).
There was a problem hiding this comment.
I never use --set-upstream. In fact, I think a plain old git push is dangerous (personal opinion) and prefer to be explicit when I do the push. If there is a strong preference to add it back, I will.
Sure, I can also delay git push till the end. I wasn't questioning why this tutorial was pushing so often.
There was a problem hiding this comment.
oh, git push, just as is, is only asking for the troubles, I don't think should advocate for it anywhere.
There was a problem hiding this comment.
I do use -u (I find I'm more likely to push to the wrong branch if I have to enter a name, even with auto-completion...), but for the dev workflow example, I agree it is better not to - keep things as simple as possible. And really it is only useful if one keeps on pushing. So, if you are up for it, I would remove the git push until after the user has done the testing. After all, the whole point of git is to enable asynchronous development - there is no reason to keep github in the loop.
There was a problem hiding this comment.
@mhvk - I use gitprompt that decorates my bash prompt (there are way more fancy solutions, too, I just never got to the point of switching), so I always see which branch I'm at. It gives a very convenient double check for names, as well as branch status compared to upstream/origin. And I just got into the habit of double checking with a git gui whenever I need to force push to a branch (in those cases I usually just see the hash as normally I don't bother to create a branch when working with other people's forks).
Overall I find this a highly efficient, but also a quite safe setup.
There was a problem hiding this comment.
I am not sure if we want to get in the weeds on setting up custom git prompt etc. But I did remove all the extraneous git push commands.
There was a problem hiding this comment.
Oh, I'm not saying we should do anything about git prompt, it's on the same level of arbitrary personal preferences as the choice of editor. It was only a pointer to Marten's point that helps to avoid pushing to the wrong branch, in case he doesn't use it or something similar.
|
|
||
| Change to that directory and run the current tests with:: | ||
|
|
||
| cd astropy/coordinates/test |
There was a problem hiding this comment.
Ouch, this is quite bad!!! Doesn't even install things beforehand. I'd say this should be tox -e test -- -P coordinates...
Or, after all, suggest setting up with tox --develop.....
There was a problem hiding this comment.
It should work to run pytest directly, but yeah for a first time contributor I would suggest tox, no develop etc.
|
p.s. Since it is much better than it was, also OK to just follow @bsipocz's approval and merge... |
|
|
||
| + Install our branch in this environment with:: | ||
|
|
||
| pip install -e . |
There was a problem hiding this comment.
Later in the tutorial we ask people to run pytest, we should have them install it here. You could argue for a [all,test] here if you want to be able to run the full suite.
| pip install -e . | |
| pip install -e .[test] |
There was a problem hiding this comment.
@bsipocz This is my current leading theory for the issues the new astroquery contributor ran into fyi.
There was a problem hiding this comment.
@mhvk's suggestion below to turn the pytest into a call to tox is way better. Although arguably we should have them install the test extra anyway.
| cd astropy/coordinates/tests | ||
| pytest |
There was a problem hiding this comment.
This should really be:
| cd astropy/coordinates/tests | |
| pytest | |
| pytest astropy/coordinates/tests |
or via tox.
There was a problem hiding this comment.
I removed instructions to keep changing directories, so they all run from top-level now.
|
Having spent a while investigating issues from people using this tutorial this week, I strongly think we should have people use tox, it's more likely to work, it sets up a virtualenv without them having to do anything and it will be updated and use our pins to not use known bad versions of deps. |
Delete outdated command history and terminal case. [ci skip]
Funny timing given ContinuumIO/anaconda-issues#12094 . I never found So, if you really want to change this to use |
|
I would suggest to merge this as is, now, rather than keep iterating over it in this PR for tox. That can be done in a follow-up. There are a large number of incoming people for Outreachy right now, who are using this guide and this current form is way better than what is currently offered to them. |
mhvk
left a comment
There was a problem hiding this comment.
This is very nice now! I agree that we can leave tox for follow-up, pip install -e .[test] is a good thing to know too.
Will merge so that it can be seen by the outreachy fellows!
|
Thank you! |
Address the outdated doc part of #10841 . I could not reproduce the errors reported, however. I used Windows 10 + Git Bash + Miniconda setup.
Also deleted outdated command history and terminal case.