Ejemplo n.º 1
0
def buildRelease(versionStr, noCommit=False, interactive=True):
    #
    createInitFile(dist='sdist', version=versionStr, sha=getSHA())
    dest = join(VERSIONS, "psychopy")
    shutil.rmtree(dest)
    ignores = shutil.ignore_patterns("demos", "docs", "tests", "pylink",
                                     "*.pyo", "*.pyc", "*.orig", "*.bak",
                                     ".DS_Store", ".coverage")
    shutil.copytree("psychopy", dest, symlinks=False, ignore=ignores)

    # todo: would be nice to check here that we didn't accidentally add anything large (check new folder size)
    Mb = float(subprocess.check_output(["du", "-sck", dest
                                        ]).split()[0]) / 10**3
    print("size for '%s' will be: %.2f Mb" % (versionStr, Mb))
    if noCommit:
        return False

    if interactive:
        ok = input("OK to continue? [n]y :")
        if ok != "y":
            return False

    lastSHA = getSHA(cwd=VERSIONS)
    print('updating: git add --all')
    output = subprocess.check_output(["git", "add", "--all"], cwd=VERSIONS)
    if interactive:
        ok = subprocess.call(gitgui, cwd=VERSIONS)
        if lastSHA == getSHA():
            # we didn't commit the changes so quit
            print("no git commit was made: exiting")
            return False
    else:
        print("committing: git commit -m 'release version %s'" % versionStr)
        subprocess.call(
            ["git", "commit", "-m",
             "'release version %s'" % versionStr],
            cwd=VERSIONS)

    print("tagging: git tag -m 'release %s'" % versionStr)
    ok = subprocess.call(
        ["git", "tag", versionStr, "-m",
         "'release %s'" % versionStr],
        cwd=VERSIONS)

    print("'versions' tags are now:",
          subprocess.check_output(["git", "tag"], cwd=VERSIONS).split())
    print('pushing: git push origin %s' % versionStr)
    output = subprocess.check_output(
        ["git", "push", "origin", "%s" % versionStr], cwd=VERSIONS)
    print(output)

    # revert the __init__ file to non-ditribution state
    print(
        'reverting the main master branch: git checkout HEAD psychopy/__init__.py '
    )
    print(
        subprocess.check_output(
            ["git", "checkout", "HEAD", "psychopy/__init__.py"], cwd=MAIN))
    return True  # success
Ejemplo n.º 2
0
def buildRelease(versionStr, noCommit=False, interactive=True):
    #
    createInitFile(dist='sdist', version=versionStr, sha=getSHA())
    dest = join(VERSIONS, "psychopy")
    shutil.rmtree(dest)
    ignores = shutil.ignore_patterns("demos", "docs", "tests", "pylink",
                                     "*.pyo", "*.pyc", "*.orig", "*.bak",
                                     ".DS_Store", ".coverage")
    shutil.copytree("psychopy", dest, symlinks=False, ignore=ignores)

    # todo: would be nice to check here that we didn't accidentally add anything large (check new folder size)
    Mb = float(subprocess.check_output(["du", "-sck", dest]).split()[0])/10**3
    print("size for '%s' will be: %.2f Mb" %(versionStr, Mb))
    if noCommit:
        return False

    if interactive:
        ok = input("OK to continue? [n]y :")
        if ok != "y":
            return False

    lastSHA = getSHA(cwd=VERSIONS)
    print('updating: git add --all')
    output = subprocess.check_output(["git", "add", "--all"], cwd=VERSIONS)
    if interactive:
        ok = subprocess.call(gitgui, cwd=VERSIONS)
        if lastSHA == getSHA():
            # we didn't commit the changes so quit
            print("no git commit was made: exiting")
            return False
    else:
        print("committing: git commit -m 'release version %s'" %versionStr)
        subprocess.call(
            ["git", "commit", "-m", "'release version %s'" %versionStr],
            cwd=VERSIONS)

    print("tagging: git tag -m 'release %s'" %versionStr)
    ok = subprocess.call(
        ["git", "tag", versionStr, "-m", "'release %s'" %versionStr],
        cwd=VERSIONS)

    print("'versions' tags are now:", subprocess.check_output(
        ["git","tag"], cwd=VERSIONS).split())
    ok = subprocess.call(["git", "push", "origin", "%s" % versionStr],
                         cwd=VERSIONS)
    if ok:
        print("Successfully pushed tag %s to origin" %versionStr)
    else:
        print("Failed to push tag %s origin" %versionStr)

    # revert the __init__ file to non-ditribution state
    print('reverting the main master branch: git reset --hard HEAD')
    print(subprocess.check_output(
        ["git","reset", "--hard", "HEAD"],
        cwd=MAIN))
    return True  # success
Ejemplo n.º 3
0
import sys
from sys import platform
from distutils.core import setup
from pkg_resources import parse_version
# import versioneer
import psychopy
version = psychopy.__version__

# regenerate __init__.py only if we're in the source repos (not in a zip file)
try:
    import createInitFile  # won't exist in a sdist.zip
    writeNewInit = True
except:
    writeNewInit = False
if writeNewInit:
    vStr = createInitFile.createInitFile(dist='bdist')

#define the extensions to compile if necess
packageData = []
requires = []

if platform != 'darwin':
    raise RuntimeError(
        "setupApp.py is only for building Mac Standalone bundle")

import bdist_mpkg
import py2app
resources = glob.glob('psychopy/app/Resources/*')
frameworks = [
    "/usr/lib/libxml2.2.dylib",  #"libyaml.dylib",
    "libevent.dylib",
Ejemplo n.º 4
0
import sys
from sys import platform
from distutils.core import setup
from pkg_resources import parse_version
# import versioneer
import psychopy
version = psychopy.__version__

# regenerate __init__.py only if we're in the source repos (not in a zip file)
try:
    import createInitFile  # won't exist in a sdist.zip
    writeNewInit=True
except:
    writeNewInit=False
if writeNewInit:
    vStr = createInitFile.createInitFile(dist='bdist')

#define the extensions to compile if necess
packageData = []
requires = []

if platform != 'darwin':
    raise RuntimeError("setupApp.py is only for building Mac Standalone bundle")

import bdist_mpkg
import py2app
resources = glob.glob('psychopy/app/Resources/*')
resources.append('/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h')
frameworks = ["libavbin.dylib", "/usr/lib/libxml2.2.dylib", #"libyaml.dylib",
              "libevent.dylib", "libffi.dylib",
              "libmp3lame.0.dylib",
Ejemplo n.º 5
0
#regenerate __init__.py only if we're in the source repos (not in a source zip file)
try:
    import createInitFile  #won't exist in a sdist.zip
    writeNewInit = True
except:
    writeNewInit = False
if writeNewInit:
    #determine what type of dist is being created
    #(install and bdist might do compiliing and then build platform is needed)
    for arg in argv:
        if arg.startswith('bdist') or arg.startswith('install'):
            dist = 'bdist'
        else:
            dist = 'sdist'
    vStr = createInitFile.createInitFile(dist=dist)
else:
    #import the metadata from file we just created (or retrieve previous)
    f = open('psychopy/__init__.py', 'r')
    vStr = f.read()
    f.close()
exec(vStr)

#define the extensions to compile if necess
packages = find_packages()
#for the source dist this doesn't work - use the manifest.in file
dataExtensions = [
    '*.txt', '*.ico', '*.jpg', '*.gif', '*.png', '*.mov', '*.spec', '*.csv',
    '*.psyexp', '*.xlsx', '.zip'
]
dataFiles = ['psychopy/psychojs.zip']
Ejemplo n.º 6
0
# regenerate __init__.py only if we're in the source repos (not in a source zip file)
try:
    import createInitFile  # won't exist in a sdist.zip
    writeNewInit=True
except:
    writeNewInit=False
if writeNewInit:
    # determine what type of dist is being created
    # (install and bdist might do compiliing and then build platform is needed)
    for arg in argv:
        if arg.startswith('bdist') or arg.startswith('install'):
            dist='bdist'
        else:
            dist='sdist'
    vStr = createInitFile.createInitFile(dist=dist)
else:
    # import the metadata from file we just created (or retrieve previous)
    f = open('psychopy/__init__.py', 'r')
    vStr = f.read()
    f.close()
exec(vStr)

# define the extensions to compile if necess
packages = find_packages()
# for the source dist this doesn't work - use the manifest.in file
dataExtensions = ['*.txt', '*.ico', '*.jpg', '*.gif', '*.png', '*.mov', '*.spec', '*.csv','*.psyexp', '*.xlsx', '.zip']
dataFiles = ['psychopy/psychojs.zip']

scripts = ['psychopy/app/psychopyApp.py',
           'psychopy_post_inst.py'] #although post_install only needs installing on win32 it needs packaging in the zip
Ejemplo n.º 7
0
#!/usr/bin/env python
################
# see notes at bottom for requirements
import glob, os, shutil
from sys import platform
from distutils.core import setup

# regenerate __init__.py only if we're in the source repos (not in a source zip file)
try:
    import createInitFile  # won't exist in a sdist.zip

    writeNewInit = True
except:
    writeNewInit = False
if writeNewInit:
    vStr = createInitFile.createInitFile(dist="bdist")
    exec(vStr)  # create variables __version__, __author__ etc

# define the extensions to compile if necess
packageData = []
requires = []

if platform == "win32":
    import py2exe

    # get matplotlib data files
    from distutils.filelist import findall
    import os
    import matplotlib

    packageData.extend(matplotlib.get_py2exe_datafiles())