Skip to content

Commit

Permalink
Merge branch '1.0.x' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed Aug 29, 2018
2 parents 3942480 + 4d841bd commit bdc6bf7
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 28 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,24 @@ Features:
* Configuration file contains the walltime taken by each run
* It is now possible to upload or download any file via its full path

1.0.16 (???)
------------

Bugfixes:
* Fixed input/output file filter on Python 3 (to omit `.so`, `.pyc` etc files)

Enhancements:
* Use the [distro](https://distro.readthedocs.io/) module instead of the deprecated `platform.linux_distribution()` function to detect the distribution (the latter will be removed in Python 3.8).

1.0.15 (2018-07-31)
-------------------

(reprounzip-qt only)

Bugfixes:
* Fixed running command from reprounzip-qt on Windows
* Fixed using Jupyter from reprounzip-qt

1.0.14 (2018-07-30)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion reprounzip-qt/reprounzip_qt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0.14'
__version__ = '1.0.15'
3 changes: 1 addition & 2 deletions reprounzip-qt/reprounzip_qt/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import logging
import os
import platform
from PyQt4 import QtCore, QtGui
import shutil
import subprocess
Expand Down Expand Up @@ -166,7 +165,7 @@ def event(self, event):
def set_first_window(self, window):
self.first_window = window
self.windows.add(window)
if platform.system().lower() == 'linux':
if sys.platform.startswith('linux'):
self.linux_try_register_default(window)
if usage_report.status is usagestats.Stats.UNSET:
self.ask_enable_usage_report()
Expand Down
12 changes: 5 additions & 7 deletions reprounzip-qt/reprounzip_qt/reprounzip_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import logging
import os
import pickle
import platform
import subprocess
import sys
import time
Expand Down Expand Up @@ -343,8 +342,7 @@ def run_in_system_terminal(cmd, env={},
environ = dict(os.environ)
environ.update(env)

system = platform.system().lower()
if system == 'darwin':
if sys.platform == 'darwin':
# Dodge py2app issues
environ.pop('PYTHONPATH', None)
environ.pop('PYTHONHOME', None)
Expand Down Expand Up @@ -392,17 +390,17 @@ def run_in_system_terminal(cmd, env={},
if wait:
time.sleep(0.5)
return None
elif system == 'windows':
elif sys.platform.startswith('win'):
if not close_on_success:
cmd = cmd + ' & pause'
cmd = cmd + ' ^& pause'
subprocess.check_call(
'start%s cmd /c %s' % (
' /wait' if wait else '',
win_escape(cmd),
cmd,
),
shell=True)
return None
elif system == 'linux':
elif sys.platform.startswith('linux'):
if not close_on_success:
cmd = '/bin/sh -c %s' % \
shell_escape(cmd + ' ; echo "Press enter..."; read r')
Expand Down
2 changes: 1 addition & 1 deletion reprounzip-qt/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
with io.open('README.rst', encoding='utf-8') as fp:
description = fp.read()
setup(name='reprounzip-qt',
version='1.0.14',
version='1.0.15',
packages=['reprounzip_qt', 'reprounzip_qt.gui'],
package_data={'reprounzip_qt': ['icon.png']},
entry_points={
Expand Down
3 changes: 2 additions & 1 deletion reprounzip/reprounzip/pack_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from __future__ import division, print_function, unicode_literals

import argparse
import distro
import json
import logging
import platform
Expand Down Expand Up @@ -179,7 +180,7 @@ def _print_package_info(pack, info, verbosity=1):
platform.machine().lower()))
if 'distribution' in info_meta:
distribution = ' '.join(t for t in info_meta['distribution'] if t)
current_distribution = platform.linux_distribution()[0:2]
current_distribution = [distro.id(), distro.version()]
current_distribution = ' '.join(t for t in current_distribution if t)
print("Distribution: %s (current: %s)" % (
distribution, current_distribution or "(not Linux)"))
Expand Down
4 changes: 2 additions & 2 deletions reprounzip/reprounzip/unpackers/common/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

from __future__ import division, print_function, unicode_literals

import distro
import logging
import platform
import subprocess

from reprounzip.unpackers.common.misc import UsageError
Expand All @@ -18,7 +18,7 @@
logger = logging.getLogger('reprounzip')


THIS_DISTRIBUTION = platform.linux_distribution()[0].lower()
THIS_DISTRIBUTION = distro.id()


PKG_NOT_INSTALLED = "(not installed)"
Expand Down
2 changes: 1 addition & 1 deletion reprounzip/reprounzip/unpackers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ def test_linux_same_arch(pack, config, **kwargs):

orig_architecture = runs[0]['architecture']
current_architecture = platform.machine().lower()
if platform.system().lower() != 'linux':
if not sys.platform.startswith('linux'):
return COMPAT_NO, "This machine is not running Linux"
elif (orig_architecture == current_architecture or
(orig_architecture == 'i386' and current_architecture == 'amd64')):
Expand Down
3 changes: 2 additions & 1 deletion reprounzip/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
'PyYAML',
'rpaths>=0.8',
'usagestats>=0.3',
'requests']
'requests',
'distro']
setup(name='reprounzip',
version='1.1.0',
packages=['reprounzip', 'reprounzip.unpackers',
Expand Down
14 changes: 11 additions & 3 deletions reprozip/reprozip/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from __future__ import division, print_function, unicode_literals

import logging
import re

from reprozip.tracer.trace import TracedFile
from reprozip.utils import irange, iteritems
Expand All @@ -13,13 +14,20 @@
logger = logging.getLogger('reprozip')


_so_file = re.compile(br'\.so(\.[0-9]+)*$')


def builtin(input_files, **kwargs):
"""Default heuristics for input files.
"""
for i in irange(len(input_files)):
lst = []
for path in input_files[i]:
if path.unicodename[0] == '.' or path.ext in ('.pyc', '.so'):
if (
# Hidden files
path.unicodename[0] == '.' or
# Shared libraries
_so_file.search(path.name)):
logger.info("Removing input %s", path)
else:
lst.append(path)
Expand All @@ -30,7 +38,7 @@ def builtin(input_files, **kwargs):
def python(files, input_files, **kwargs):
add = []
for path, fi in iteritems(files):
if path.ext == '.pyc':
if path.ext == b'.pyc':
pyfile = path.parent / path.stem + '.py'
if pyfile.is_file():
if pyfile not in files:
Expand All @@ -43,7 +51,7 @@ def python(files, input_files, **kwargs):
for i in irange(len(input_files)):
lst = []
for path in input_files[i]:
if path.ext in ('.py', '.pyc'):
if path.ext in (b'.py', b'.pyc'):
logger.info("Removing input %s", path)
else:
lst.append(path)
Expand Down
4 changes: 2 additions & 2 deletions reprozip/reprozip/tracer/linux_pkgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

from __future__ import division, print_function, unicode_literals

import distro
import logging
import platform
from rpaths import Path
import subprocess
import time
Expand Down Expand Up @@ -235,7 +235,7 @@ def _create_package(self, pkgname):
def identify_packages(files):
"""Organizes the files, using the distribution's package manager.
"""
distribution = platform.linux_distribution()[0].lower()
distribution = distro.id()
if distribution in ('debian', 'ubuntu'):
logger.info("Identifying Debian packages for %d files...", len(files))
manager = DpkgManager()
Expand Down
5 changes: 3 additions & 2 deletions reprozip/reprozip/tracer/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from __future__ import division, print_function, unicode_literals

import warnings
import distro
from collections import defaultdict
from itertools import count
import logging
Expand All @@ -21,6 +21,7 @@
from rpaths import Path
import sqlite3
import sys
import warnings

from reprozip import __version__ as reprozip_version
from reprozip import _pytracer
Expand Down Expand Up @@ -387,7 +388,7 @@ def write_configuration(directory, sort_packages, find_inputs_outputs,

# Writes configuration file
config = directory / 'config.yml'
distribution = platform.linux_distribution()[0:2]
distribution = [distro.id(), distro.version()]
cur = conn.cursor()
if overwrite or not config.exists():
runs = []
Expand Down
6 changes: 3 additions & 3 deletions reprozip/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import io
import os
import platform
from setuptools import setup, Extension
import sys

Expand All @@ -10,7 +9,7 @@


# This won't build on non-Linux -- don't even try
if platform.system().lower() != 'linux':
if not sys.platform.startswith('linux'):
sys.stderr.write("reprozip uses ptrace and thus only works on Linux\n"
"You can however install reprounzip and plugins on other "
"platforms\n")
Expand Down Expand Up @@ -40,7 +39,8 @@
'PyYAML',
'rpaths>=0.8',
'usagestats>=0.3',
'requests']
'requests',
'distro']
setup(name='reprozip',
version='1.1.0',
ext_modules=[pytracer],
Expand Down
2 changes: 1 addition & 1 deletion scripts/linux-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cd "$(dirname "$0")/.."
if [ ! -d dist ]; then mkdir dist; fi
sudo docker run -i --rm -v "${PWD}:/src" markrwilliams/manylinux2:x86_64 <<'END'
docker run -i --rm -v "${PWD}:/src" markrwilliams/manylinux2:x86_64 <<'END'
yum install -y sqlite-devel
cd /src/reprozip
for PYBIN in /opt/python/*/bin; do "${PYBIN}/pip" wheel . -w ../dist; done
Expand Down
2 changes: 1 addition & 1 deletion scripts/macos/instructions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export CFLAGS="-mmacosx-version-min=10.8 -isysroot /Developer/SDKs/MacOSX10.8.sd
export LDFLAGS="-mmacosx-version-min=10.8 -isysroot /Developer/SDKs/MacOSX10.8.sdk"
export MACOS_DEPLOYMENT_TARGET=10.8
Build Python with --prefix=/opt/reprounzip/python27
Copy reprounzip and reprounzip-qt to /opt/reprounzip
Copy reprounzip, reprounzip-qt, and reprozip-jupyter to /opt/reprounzip
Install pip with get-pip.py
Install reprounzip, reprounzip-docker, reprounzip-vagrant, reprounzip-vistrails
Install sip and PyQt4
Expand Down
3 changes: 3 additions & 0 deletions scripts/macos/reprozip-jupyter
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

exec "$(dirname "$0")/python27/bin/reprozip-jupyter" "$@"
2 changes: 2 additions & 0 deletions scripts/windows/input/reprozip-jupyter.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
"%~dp0\python2.7\Scripts\reprozip-jupyter.exe" %*
1 change: 1 addition & 0 deletions scripts/windows/reprounzip.iss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Source: input\ssh\*; DestDir: {app}\ssh
; Other files
Source: input\reprounzip.bat; DestDir: {app}
Source: input\reprounzip-qt.bat; DestDir: {app}
Source: input\reprozip-jupyter.bat; DestDir: {app}
Source: input\reprozip.ico; DestDir: {app}

[UninstallDelete]
Expand Down

0 comments on commit bdc6bf7

Please sign in to comment.