--- /dev/null
+# Config file for automatic testing at travis-ci.org
+
+# Only test master and pull requests; skip tags.
+# Other branches can allow themselves.
+branches:
+ only:
+ - master
+
+# Prefer docker containers
+sudo: required
+
+language: python
+
+python:
+ - "3.6"
+
+cache: pip
+
+env:
+ - TOXENV=py27
+ - TOXENV=py33
+ - TOXENV=py34
+ - TOXENV=py35
+ - TOXENV=py36
+
+install:
+ - travis_retry pip install tox
+
+script:
+ - tox
-Travis, AppVeyor, PyPI.
+PyPI.
Add option -v/--verbose to report every removed file.
--- /dev/null
+# Test on windows
+# Heavily inspired by Oliver Grisel's appveyor-demo (https://github.com/ogrisel/python-appveyor-demo)
+version: '{branch}-{build}'
+
+# Only test master and pull requests; skip tags.
+# Other branches can allow themselves.
+branches:
+ only:
+ - master
+skip_branch_with_pr: false
+skip_tags: true
+
+cache:
+ - '%LOCALAPPDATA%\pip\Cache'
+
+# Match travis
+clone_depth: 50
+
+environment:
+ matrix:
+ - PYTHON_HOME: "C:\\Python27"
+ PYTHON_VERSION: "2.7"
+ PYTHON_ARCH: "32"
+ TOX_ENV: "py27"
+ - PYTHON_HOME: "C:\\Python27-x64"
+ PYTHON_VERSION: "2.7"
+ PYTHON_ARCH: "64"
+ TOX_ENV: "py27"
+ - PYTHON_HOME: "C:\\Python33"
+ PYTHON_VERSION: "3.3"
+ PYTHON_ARCH: "32"
+ TOX_ENV: "py33"
+ - PYTHON_HOME: "C:\\Python33-x64"
+ PYTHON_VERSION: "3.3"
+ PYTHON_ARCH: "64"
+ TOX_ENV: "py33"
+ - PYTHON_HOME: "C:\\Python34"
+ PYTHON_VERSION: "3.4"
+ PYTHON_ARCH: "32"
+ TOX_ENV: "py34"
+ - PYTHON_HOME: "C:\\Python34-x64"
+ PYTHON_VERSION: "3.4"
+ PYTHON_ARCH: "64"
+ TOX_ENV: "py34"
+ - PYTHON_HOME: "C:\\Python35"
+ PYTHON_VERSION: "3.5"
+ PYTHON_ARCH: "32"
+ TOX_ENV: "py35"
+ - PYTHON_HOME: "C:\\Python35-x64"
+ PYTHON_VERSION: "3.5"
+ PYTHON_ARCH: "64"
+ TOX_ENV: "py35"
+ - PYTHON_HOME: "C:\\Python36"
+ PYTHON_VERSION: "3.6"
+ PYTHON_ARCH: "32"
+ TOX_ENV: "py36"
+ - PYTHON_HOME: "C:\\Python36-x64"
+ PYTHON_VERSION: "3.6"
+ PYTHON_ARCH: "64"
+ TOX_ENV: "py36"
+
+install:
+ # Ensure we use the right python version
+ - "SET PATH=%PYTHON_HOME%;%PYTHON_HOME%\\Scripts;%PATH%"
+ - "SET TOXPYTHON=%PYTHON_HOME%\\python.exe"
+ - "python --version"
+ - "python -c \"import struct; print(struct.calcsize('P') * 8)\""
+ - "pip --version"
+ - "pip install tox"
+
+# No build step - _namemapper extension will be built under tox
+build: false
+
+test_script:
+ - "tox -e %TOX_ENV%"
News
====
+Version 0.2.0 (2017-05-??)
+--------------------------
+
+* Test at Travis and AppVeyor.
+
0.1.0 (2017-04-16)
------------------
#! /usr/bin/env python
-import shutil
import os
+import shutil
+import sys
from tempfile import mkdtemp
tmp_dir = None
+for path in os.environ["PATH"].split(os.pathsep):
+ path = path.strip('"')
+ test_prog_path = os.path.join(path, 'remove-old-files.py')
+ if os.path.exists(test_prog_path):
+ break
+else:
+ sys.exit("Cannot find remove-old-files.py in %s" % os.environ["PATH"])
def setup():
create_files(['test1', 'test2'])
assert_files_exist(['test1', 'test2'])
os.utime('test2', (0, 0))
- assert os.system("remove-old-files.py --older 100 .") == 0
+ assert os.system(
+ "%s %s --older 100 ." % (sys.executable, test_prog_path)) == 0
assert_files_exist('test1')
assert_files_not_exist('test2')
test4 = os.path.join('subdir', 'test4')
assert_files_exist([test3, test4])
os.utime(test4, (0, 0))
- assert os.system("remove-old-files.py --older 100 .") == 0
+ assert os.system(
+ "%s %s --older 100 ." % (sys.executable, test_prog_path)) == 0
assert_files_exist(test3)
assert_files_not_exist(test4)
assert_files_exist([test3, test4])
os.utime(test3, (0, 0))
os.utime(test4, (0, 0))
- assert os.system("remove-old-files.py --older 100 .") == 0
+ assert os.system(
+ "%s %s --older 100 ." % (sys.executable, test_prog_path)) == 0
assert_files_exist('subdir')
assert_files_not_exist([test3, test4])
- assert os.system("remove-old-files.py -e --older 100 .") == 0
+ assert os.system(
+ "%s %s -e --older 100 ." % (sys.executable, test_prog_path)) == 0
assert_files_not_exist('subdir')
[tox]
minversion = 1.8
-toxworkdir={homedir}/.tox/remove-old-files
envlist = {py26,py27,py33,py34,py35,py36},{py27,py34}-flake8
# Base test environment settings
[testenv]
+basepython =
+ py26: {env:TOXPYTHON:python2.6}
+ py27: {env:TOXPYTHON:python2.7}
+ py33: {env:TOXPYTHON:python3.3}
+ py34: {env:TOXPYTHON:python3.4}
+ py35: {env:TOXPYTHON:python3.5}
+ py36: {env:TOXPYTHON:python3.6}
+commands =
+ {envpython} --version
+ {envpython} -c "import struct; print(struct.calcsize('P') * 8)"
deps =
pytest
pytest-cov
[general]
commands =
- python -m pytest
+ {envpython} -m pytest
[testenv:py26]
-commands = {[general]commands}
+commands =
+ {[testenv]commands}
+ {[general]commands}
[testenv:py27]
-commands = {[general]commands}
+commands =
+ {[testenv]commands}
+ {[general]commands}
+
+[testenv:py33]
+commands =
+ {[testenv]commands}
+ {[general]commands}
[testenv:py34]
-commands = {[general]commands}
+commands =
+ {[testenv]commands}
+ {[general]commands}
+
+[testenv:py35]
+commands =
+ {[testenv]commands}
+ {[general]commands}
+
+[testenv:py36]
+commands =
+ {[testenv]commands}
+ {[general]commands}
[testenv:py27-flake8]
deps =
flake8
-commands = flake8
+commands =
+ {[testenv]commands}
+ flake8
[testenv:py34-flake8]
deps =
flake8
-commands = flake8
+commands =
+ {[testenv]commands}
+ flake8