Skip to content

Commit

Permalink
PKG: moved a lot of packaging code into packaging folder
Browse files Browse the repository at this point in the history
We had a nearly-empty folder called buildScripts (now packaging) and lots
of files that were in the root and didn't need to be
  • Loading branch information
peircej committed Feb 18, 2020
1 parent ef102d4 commit 7aa767a
Show file tree
Hide file tree
Showing 18 changed files with 94 additions and 20 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,4 @@ gource_psychopy.mkv
# Documentation generated files #
#################################
.coverage
builddocs.sh
nonSphinx
1 change: 0 additions & 1 deletion .lgtm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ extraction:
- libglu1-mesa-dev
- libgstreamer1.0-dev
- libgstreamer-plugins-base1.0-dev
- libwebkitgtk-3.0-dev
4 changes: 2 additions & 2 deletions buildCompleteInstaller.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ var PRODUCT_REGISTRY_ROOT
!include MultiUser.nsh

!include "MUI2.nsh"
!include "fileassoc.nsh"
!include "EnvVarUpdate.nsh"
!include "packaging/fileassoc.nsh"
!include "packaging/EnvVarUpdate.nsh"
!include "Library.nsh"
!include LogicLib.nsh

Expand Down
2 changes: 1 addition & 1 deletion buildWinDistributions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ for ($i=0; $i -lt $pyPaths.Length; $i++) {

echo 'moving files to ..\dist'

Invoke-Expression ("{0}python.exe setup.py clean --all" -f $pyPaths[$i]) # clean up our build dir
# try to uninstall psychopy from site-packages
Invoke-Expression ("{0}python.exe -m pip uninstall -y psychopy" -f $pyPaths[$i])
# re-install the current version as editable/developer
Invoke-Expression ("{0}python.exe -m pip install -e . --no-deps" -f $pyPaths[$i])
Invoke-Expression ("{0}python.exe setup.py clean --all" -f $pyPaths[$i]) # clean up our build dir

}

Expand Down
2 changes: 1 addition & 1 deletion gource.cfg → docs/gource.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ viewport=1280x720
date-format=%d/%m/%Y
seconds-per-day=0.03
title=History of PsychoPy development
logo=psychopy/app/Resources/psychopy.png
logo=../psychopy/app/Resources/psychopy.png
caption-file=gourceCaptions.txt
caption-colour=CCCCFF
hide=filenames
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 7 additions & 2 deletions changelogUpdate.py → docs/updateChangelog.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@

from __future__ import absolute_import, print_function
import re
from pathlib import Path

input_path = 'psychopy/CHANGELOG.txt'
output_path = 'docs/source/changelog.rst'
thisFolder = Path(__file__).parent
rootFolder = thisFolder.parent
input_path = rootFolder / 'psychopy/CHANGELOG.txt'
output_path = thisFolder / 'source/changelog.rst'

def repl_issue(m):
g = m.group(1)
Expand Down Expand Up @@ -53,6 +56,8 @@ def repl_noncompat(m):
with open(output_path, "w", encoding='utf8') as doc:
doc.write(newRST)

print(f"generated {output_path}")

#test:
#text = "yes #123\n yes (#4567)\n; none of `#123, #3, #45, #12345 #123a"
#newText = expr.sub(repl, text)
Expand Down
8 changes: 6 additions & 2 deletions changelogUpdateMD.py → docs/updateChangelogMD.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
# written by Jon with regex code by Jeremy

import re
from pathlib import Path

input_path = 'psychopy/CHANGELOG.txt'
output_path = 'docs/source/changelog.md'
thisFolder = Path(__file__).parent
rootFolder = thisFolder.parent
input_path = rootFolder / 'psychopy/CHANGELOG.txt'
output_path = thisFolder / 'source/changelog.md'

def repl_link(match):

Expand Down Expand Up @@ -60,6 +63,7 @@ def repl_noncompat(m):

with open(output_path, "w", encoding='utf8') as doc:
doc.write(txt_final)
print(f"generated {output_path}")

#test:
#text = "yes #123\n yes (#4567)\n; none of `#123, #3, #45, #12345 #123a"
Expand Down
5 changes: 3 additions & 2 deletions gen_authors.py → docs/update_authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
import warnings
from datetime import datetime
from psychopy.core import shellCall
from pathlib import Path

repo_path = os.path.split(__file__)[0]
authors_path = os.path.join(repo_path, 'AUTHORS.md')
repo_path = Path(__file__).parent.parent
authors_path = repo_path/'AUTHORS.md'
git_command = 'git --no-pager shortlog -s HEAD %s' % repo_path
last_run = datetime.utcnow().strftime('%B %d, %Y')

Expand Down
File renamed without changes.
7 changes: 5 additions & 2 deletions buildRelease.py → packaging/buildRelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
from os.path import join
from createInitFile import createInitFile
from psychopy.constants import PY3
from pathlib import Path

MAIN = os.path.abspath(os.path.split(__file__)[0])
VERSIONS = join(MAIN, '..', 'versions')
# MAIN is the root of the psychopy repo
MAIN = Path(__file__).parent.parent
# versions repo is next to MAIN
VERSIONS = MAIN.parent / 'versions'

if sys.platform == "darwin":
gitgui = ["git", "gui"]
Expand Down
File renamed without changes.
60 changes: 60 additions & 0 deletions packaging/construct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# name and version (required)
name: PsychoPy
company: Open Science Tools
version: 2020.1
signing_identity_name: OST

# channels to pull packages from
channels:
- https://repo.anaconda.com/pkgs/main/
- https://conda.anaconda.org/conda-forge/

install_in_dependency_order: True

# specifications can specify [unix]
specs:
- python
- conda
- psychopy
- pip

# exclude these packages (list of names)
exclude:
- tk

#pre_install: hello.sh [unix]
#post_install: goodbye.sh [unix]
#post_install: test-post.bat [win]

# The conda default channels which are used when running a conda which
# was installed be the constructor created (requires conda in the
# specifications) installer
#conda_default_channels: *id1

# type of the installer being created. Possible values are "sh", "pkg",
# and "exe". By default, the type is "sh" on Unix, and "exe" on Windows.
#installer_type: pkg [osx]

# installer filename (a reasonable default filename will determined by
# the `name`, (optional) `version`, OS and installer type)
#installer_filename: grin.sh

# a file with a license text, which is shown during the install process
license_file: ../LICENSE

# default install prefix
#default_prefix: /opt/example

icon_image: ../psychopy/app/Resources/psychopy.png
welcome_image: ../psychopy/app/Resources/psychopy.png
# If `welcome_image` or `header_image` are not provided, their texts
# default to `name`, which may be overridden by the following keys
#welcome_image_text: |-
# PsychoPy
# - Easy
# - Precise
# - Flexible
#
header_image_text: |-
Open Science
Tools Ltd.
8 changes: 4 additions & 4 deletions createInitFile.py → packaging/createInitFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import platform
import subprocess
from psychopy.constants import PY3
from pathlib import Path


thisLoc = os.path.split(__file__)[0]
root = Path(__file__).parent.parent
# import versioneer
# get version from file
with open('version') as f:
Expand All @@ -33,7 +33,7 @@ def createInitFile(dist=None, version=None, sha=None):
"""
# get default values if None
if version is None:
with open(os.path.join(thisLoc, 'version')) as f:
with open(root/'version') as f:
version = f.read().strip()
if sha is None:
sha = _getGitShaString(dist)
Expand All @@ -51,7 +51,7 @@ def createInitFile(dist=None, version=None, sha=None):
'platform': platformStr}

# write it
with open(os.path.join(thisLoc, 'psychopy', '__init__.py'), 'w') as f:
with open(root/'psychopy/__init__.py', 'w') as f:
outStr = template.format(**infoDict)
f.write(outStr)
print('wrote init for ', version, sha)
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions buildScripts/updateBuilderDemos.py → packaging/updateBuilderDemos.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
from __future__ import absolute_import, print_function
import os
from psychopy import experiment, __version__
from pathlib import Path

thisFolder = Path(__file__).parent

nFiles = 0
for root, dirs, files in os.walk("../psychopy/demos/builder"):
for root, dirs, files in os.walk(thisFolder.parent/"psychopy/demos/builder"):
for filename in files:
if filename.endswith('.psyexp'):

Expand All @@ -19,4 +22,4 @@
origVersion = exp.psychopyVersion
exp.psychopyVersion = __version__
exp.saveToXML(filepath)
print ("switching {} from {} to {}".format(filepath, origVersion, __version__))
print("switching {} from {} to {}".format(filepath, origVersion, __version__))

0 comments on commit 7aa767a

Please sign in to comment.