cuspaceflight / firefish

CFD simulation software for Martlet 3
Apache License 2.0
5 stars 4 forks source link

Add some basic Python packaging #4

Closed rjw57 closed 8 years ago

rjw57 commented 8 years ago

Adds some basic Python packaging and test infrastructure. Please read each commit message carefully since I've tried to describe what each piece does and provide links to more information.

After this PR is merged, anyone should be able to install the software with a single command. (See the README.) In addition travis is set up to automatically test on both Python 3 and Python 2.

Finally, I've included an example port of the fin flutter code and made it a little more "Pythonic". It would be worth having a read through PEP20[1] to get an idea of the "zen" of Python programming.

[1] https://www.python.org/dev/peps/pep-0020/

rjw57 commented 8 years ago

I'd like at least three thumbs up for this before merging if possible. Thanks!

jb803 commented 8 years ago

Looks good :+1:

rjw57 commented 8 years ago

This provides a nice example of resolving incompatible changes. (A situation known as a "merge conflict".) In this case the README.md file was modified both by this PR and the (now merged) #3.

To fix this I did the following. This assumes you've got origin as a remote pointing to your own fork and upstream as a remote pointing to this repo. This is documented in the cheat sheet.

$ git checkout master
$ git pull upstream # Update "master" to new version from "upstream" (cuspaceflight repo)
$ git checkout python-packaging # Switch to the feature branch for this PR
$ git merge master # Shows conflict
Auto-merging README.md     
CONFLICT (content): Merge conflict in README.md 
Automatic merge failed; fix conflicts and then commit the result. 
$ vim README.md # Fix conflict
$ git add README.md # Tell git
$ git commit # Commit the merge
$ git push origin python-packaging # Push the branch back to GitHub

Note that adding a commit to the python-packaging branch automatically added it to this PR. This is why you never issue a PR from master. If you do so then every subsequent change also appears in it(!)

boyuanxiao commented 8 years ago

:+1: like the ported code.

rjw57 commented 8 years ago

@boyuanxiao If you're starting to write stuff based on this PR, you should just merge.