Merge branch 'master' into PICARD-1177

This commit is contained in:
Laurent Monin
2018-02-08 21:59:03 +01:00
committed by GitHub
6 changed files with 103 additions and 86 deletions

View File

@@ -3,66 +3,80 @@ dist: trusty
language: python
sudo: required
python:
- "3.6"
- "3.5"
- '3.6'
- '3.5'
cache:
- apt
- pip
- apt
- pip
cache:
ccache: true
directories:
- $HOME/Library/Caches/Homebrew
env:
global:
- PIP_INSTALL="pip3 install"
- DISCID="$PIP_INSTALL discid" MUTAGEN="$PIP_INSTALL mutagen>=1.37"
- BABEL="$PIP_INSTALL babel"
- NOSE="$PIP_INSTALL nose2"
- COVERAGE="$PIP_INSTALL nose-cov"
- CODACY="$PIP_INSTALL codacy-coverage"
- PIP_INSTALL="pip3 install"
- DISCID="$PIP_INSTALL discid" MUTAGEN="$PIP_INSTALL mutagen>=1.37"
- BABEL="$PIP_INSTALL babel"
- NOSE="$PIP_INSTALL nose2"
- COVERAGE="$PIP_INSTALL nose-cov"
- CODACY="$PIP_INSTALL codacy-coverage"
matrix:
- PYQT="$PIP_INSTALL pyqt5==5.9"
- PYQT="$PIP_INSTALL pyqt5==5.8"
- PYQT="$PIP_INSTALL pyqt5==5.9"
- PYQT="$PIP_INSTALL pyqt5==5.8"
matrix:
include:
- os: osx
osx_image: xcode8.3
language: generic
- os: osx
osx_image: xcode6.4
language: generic
allow_failures:
- os: osx
- os: osx
fast_finish: true
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq && sudo apt-get install -qq transifex-client libdiscid0 libdiscid0-dev qt5-default; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash scripts/setup-osx.sh; fi
- $BABEL
- $PYQT
- $MUTAGEN
- $DISCID
- $NOSE
- if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then $COVERAGE; fi
- touch ~/.transifexrc
- printf "[https://www.transifex.com]\nhostname = https://www.transifex.com\npassword = $TX_PASSWORD\ntoken =\nusername = $TX_USERNAME" > ~/.transifexrc
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq && sudo apt-get
install -qq transifex-client libdiscid0 libdiscid0-dev qt5-default; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash scripts/setup-osx.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source bin/activate; fi
- "$BABEL"
- "$PYQT"
- "$MUTAGEN"
- "$DISCID"
- "$NOSE"
- if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then $COVERAGE; fi
- touch ~/.transifexrc
- printf "[https://www.transifex.com]\nhostname = https://www.transifex.com\npassword
= $TX_PASSWORD\ntoken =\nusername = $TX_USERNAME" > ~/.transifexrc
install:
# Set up Picard
- python3 setup.py clean
- python3 setup.py clean_ui
- python3 setup.py build_ui
- python3 setup.py build_ext -i
- python3 setup.py regen_pot_file
- 'if [ ! -z "${TX_PASSWORD}" ]; then python3 setup.py get_po_files; fi'
- 'if [ ! -z "${TX_PASSWORD}" ]; then python3 setup.py update_constants; fi'
- python3 setup.py build_locales -i
- python3 setup.py patch_version --platform=test
# Travis OSX image has a permission issue while installing. Thus using sudo for it.
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo python3 setup.py install; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then python3 setup.py install; fi
# Run the tests!
script: "nose2 -v --with-coverage --coverage picard --coverage-report xml"
- python3 setup.py clean
- python3 setup.py clean_ui
- python3 setup.py build_ui
- python3 setup.py build_ext -i
- python3 setup.py regen_pot_file
- if [ ! -z "${TX_PASSWORD}" ]; then python3 setup.py get_po_files; fi
- if [ ! -z "${TX_PASSWORD}" ]; then python3 setup.py update_constants; fi
- python3 setup.py build_locales -i
- python3 setup.py patch_version --platform=test
- python3 setup.py install
script: nose2 -v --with-coverage --coverage picard --coverage-report xml
after_success:
- 'if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then $CODACY; python-codacy-coverage -r coverage.xml; fi'
# Tell people that tests were run
- if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then $CODACY; python-codacy-coverage -r coverage.xml;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash scripts/package-osx.sh; fi
notifications:
irc: "chat.freenode.net#metabrainz"
# Only build commits pushed to master or 1.4 dev branch.
# This avoid duplicate builds when we make a PR from the original repo
irc: chat.freenode.net#metabrainz
branches:
only:
- master
- 1.4.x
- master
- 1.4.x
deploy:
provider: releases
api_key:
secure: JgtlHc3OkQ+VzfpV7QGSIo/uJQdXSYgssi/f6rfwTYEy3nkLNRys7EQAYa8VExeK+QytiTuW6/2/hIUgFbjYywpkIBv+JiVrDStBOB8jI8QPcWx1fYWKnZOSITbvLXbKWNk4zMe8ccNIeP0+wRkZwio6FqrADbgg1On6n7setzU=
file_glob: true
skip_cleanup: true
file: dist/*.dmg
on:
tags: true

View File

@@ -40,6 +40,9 @@ if os_name == 'Windows':
fpcalc_name = 'fpcalc.exe'
binaries += [('discid.dll', '')]
if os_name == 'Darwin':
binaries += [('libdiscid.0.dylib', '')]
if os.path.isfile(fpcalc_name):
binaries += [(fpcalc_name, '')]
@@ -65,8 +68,15 @@ exe = EXE(pyz,
name='picard',
debug=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=False,
icon='picard.ico',
)
if platform.system() == 'Darwin':
info_plist = {'NSHighResolutionCapable': 'True', 'NSPrincipalClass': 'NSApplication'}
app = BUNDLE(exe,
name='MusicBrainz Picard.app',
icon='picard.icns',
bundle_identifier=None,
info_plist=info_plist
)

View File

@@ -278,8 +278,10 @@ class Tagger(QtWidgets.QApplication):
self.nats.update()
def exit(self):
log.debug("Picard stopping")
if self.stopping:
return
self.stopping = True
log.debug("Picard stopping")
self._acoustid.done()
self.thread_pool.waitForDone()
self.save_thread_pool.waitForDone()

View File

@@ -49,6 +49,7 @@ class ResultTable(QtWidgets.QTableWidget):
parent.scrolled.emit()
self.horizontalScrollBar().valueChanged.connect(emit_scrolled)
self.verticalScrollBar().valueChanged.connect(emit_scrolled)
self.setHorizontalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel)
class SearchBox(QtWidgets.QWidget):

49
scripts/package-osx.sh Normal file → Executable file
View File

@@ -1,43 +1,26 @@
curl -L -O https://github.com/acoustid/chromaprint/releases/download/v$CHROMAPRINT_FPCALC_VERSION/chromaprint-fpcalc-$CHROMAPRINT_FPCALC_VERSION-macos-x86_64.tar.gz
tar --strip-components 1 -xf chromaprint-fpcalc-$CHROMAPRINT_FPCALC_VERSION-macos-x86_64.tar.gz chromaprint-fpcalc-$CHROMAPRINT_FPCALC_VERSION-macos-x86_64/fpcalc
curl -L -O http://ftp.musicbrainz.org/pub/musicbrainz/libdiscid/libdiscid-$DISCID_VERSION-mac.zip
unzip -jx libdiscid-$DISCID_VERSION-mac.zip libdiscid-$DISCID_VERSION-mac/intel64/libdiscid.0.dylib
export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH
curl -L -o plugins.zip https://github.com/metabrainz/picard-plugins/archive/master.zip
unzip -x plugins.zip
mkdir contrib
mv picard-plugins-master/plugins contrib/plugins
rm -rf e
virtualenv -p python2.7 --system-site-packages e
. e/bin/activate
pip install mutagen==$MUTAGEN_VERSION
pip install discid==$PYTHON_DISCID_VERSION
pip install py2app==$PY2APP_VERSION
perl -pi -e 's{plugin_dir = (.*)$}{plugin_dir = "/Developer/Applications/Qt/plugins"}' e/lib/python2.7/site-packages/py2app/recipes/sip.py
echo 'from __future__ import absolute_import' > e/lib/python2.7/site-packages/py2app/recipes/sip.py.new
cat e/lib/python2.7/site-packages/py2app/recipes/sip.py >> e/lib/python2.7/site-packages/py2app/recipes/sip.py.new
mv e/lib/python2.7/site-packages/py2app/recipes/sip.py.new e/lib/python2.7/site-packages/py2app/recipes/sip.py
#!/usr/bin/env bash
if [ -z "$CI_BUILD_TAG" ]
then
python setup.py patch_version --platform=osx
python3 setup.py patch_version --platform=osx
fi
VERSION=`python -c 'import picard; print picard.__version__'`
VERSION=$(python3 -c 'import picard; print(picard.__version__)')
rm -rf dist build locale
python setup.py clean
python setup.py build_ext -i
python setup.py build_locales -i
python setup.py py2app
python3 setup.py clean
python3 setup.py build_ext
python3 setup.py build_locales
pip3 install pyinstaller
pyinstaller picard.spec
cd dist
ditto -rsrc --arch x86_64 'MusicBrainz Picard.app' 'MusicBrainz Picard.tmp'
rm -r 'MusicBrainz Picard.app'
mv 'MusicBrainz Picard.tmp' 'MusicBrainz Picard.app'
hdiutil create -volname "MusicBrainz Picard $VERSION" -srcfolder 'MusicBrainz Picard.app' -ov -format UDBZ ../MusicBrainz-Picard-$VERSION.dmg
hdiutil create -volname "MusicBrainz Picard $VERSION" -srcfolder 'MusicBrainz Picard.app' -ov -format UDBZ "MusicBrainz Picard $VERSION.dmg"
if [ -n "$UPLOAD_OSX" ]
then
curl --upload-file "MusicBrainz Picard $VERSION.dmg" https://transfer.sh/
# Required for a newline between the outputs
echo -e "\n"
md5 -r "MusicBrainz Picard $VERSION.dmg"
fi

11
scripts/setup-osx.sh Normal file → Executable file
View File

@@ -1,9 +1,16 @@
#!/usr/bin/env bash
brew update
brew install python3
brew link python3 --force
brew install gettext
brew link gettext --force
brew install libdiscid
wget "ftp://ftp.musicbrainz.org/pub/musicbrainz/libdiscid/libdiscid-$DISCID_VERSION.tar.gz"
tar -xf "libdiscid-$DISCID_VERSION.tar.gz"
cd "libdiscid-$DISCID_VERSION"
./configure --prefix="$HOME/libdiscid"
make install
cd ..
cp "$HOME/libdiscid/lib/libdiscid.0.dylib" .
pip3 install --upgrade pip setuptools wheel
pip3 install virtualenv
virtualenv -p python3 .
source bin/activate