How to Contribute

linusg-github edited this page May 15, 2016 · 4 revisions

You are very welcome to contribute!

Since as of now all core-developers are working on PyInstaller in their spare-time, you can help us (and the project) most if you are following some simple guidelines. The higher the quality of your contribution, the less work we have incorporating them and the earlier we will be able to incorporate them :-)

Some thing to keep in mind:

#-----------------------------------------------------------------------------
# Copyright (c) 2005-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------

If you plan to contribute frequently, just ask for write access to the main git repository. We would be glad to welcome you in the team!

And this is how it works:

git clone git@github.com:GIT_USERNAME/pyinstaller.git
  • If you are going to implement a hook, start with creating a minimalistic build-test (see below). You will need to test your hook anyway, so why not use a build-test from the start?
  • Incorporate your changes into PyInstaller.
  • Test your changes by running ''all'' build tests to ensure nothing else is broken. Please test on as many platform as you can.
  • Push you work up to your fork on github.
  • Create a pull request on github.
  • For syncing your fork with the PyInstaller upstream repository see syncing a fork at github

The test workflow:

  • If those tests will be interactive (user has to click on a button), then it should go into ./tests/interactive/, test for hooks (and suchlike) go into ./tests/libraries/. If you are working on a core function, ./tests/basic/ or ./tests/import/ are appropriate.
  • If you have more test files, create them with file name prefix test_yourtest_.
  • If your test should be run in --onefile mode then create it with file name prefix test_onefile_
  • Usually for a test you do not need create .spec file. It will be created automatically.
  • If your test needs special options or settings then you probably need to create .spec file. If so then append your test file name to the list SPEC_FILE in ./tests/runtests.py otherwise your .spec file will be removed.
  • If your test depends on some libraries, append test name and required libraries to the list self.MODULES in ./tests/runtests.py.
  • If your test is just for a specific OS or Python version append your test name to the list self.MIN_VERSION_OR_OS in ./tests/runtests.py.
  • To run a single test:
cd tests
python runtests.py libraries/test_yourtestname
  • To run all tests:
cd tests
python runtests.py 
  • To run all interactive tests:
cd tests
python runtests.py -i
  • Test success depends on zero exit status of created binary.