Skip to content
This repository
Browse code

add travis.yaml

  • Loading branch information...
commit 3e83d22db8859510e73ea61087e7b39d8fe238d9 1 parent 6aa3ca6
Oliver Tonnhofer authored September 04, 2012
15  .travis.yml
... ...
@@ -0,0 +1,15 @@
  1
+language: python
  2
+python:
  3
+  - "2.5"
  4
+  - "2.6"
  5
+  - "2.7"
  6
+services:
  7
+  - couchdb
  8
+# command to install dependencies
  9
+install:
  10
+    - "if [[ $TRAVIS_PYTHON_VERSION == '2.5' ]]; then pip install --use-mirrors multiprocessing; fi"
  11
+    - "if [[ $TRAVIS_PYTHON_VERSION != '2.5' ]]; then pip install requests==0.14.0; export MAPPROXY_TEST_COUCHDB=http://127.0.0.1:5984; fi"
  12
+    - "sudo apt-get install libproj0 libgeos-dev libgdal-dev libxslt1-dev libxml2-dev build-essential python-dev libjpeg-dev zlib1g-dev libfreetype6-dev"
  13
+    - "pip install -r requirements-travis.txt --use-mirrors"
  14
+# command to run tests
  15
+script: nosetests
24  mapproxy/util/__init__.py
... ...
@@ -1,12 +1,12 @@
1 1
 # This file is part of the MapProxy project.
2 2
 # Copyright (C) 2010 Omniscale <http://omniscale.de>
3  
-# 
  3
+#
4 4
 # Licensed under the Apache License, Version 2.0 (the "License");
5 5
 # you may not use this file except in compliance with the License.
6 6
 # You may obtain a copy of the License at
7  
-# 
  7
+#
8 8
 #    http://www.apache.org/licenses/LICENSE-2.0
9  
-# 
  9
+#
10 10
 # Unless required by applicable law or agreed to in writing, software
11 11
 # distributed under the License is distributed on an "AS IS" BASIS,
12 12
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,7 +30,7 @@
30 30
 def local_base_config(conf):
31 31
     """
32 32
     Temporarily set the global configuration (mapproxy.config.base_config).
33  
-    
  33
+
34 34
     The global mapproxy.config.base_config object is thread-local and
35 35
     is set per-request in the MapProxyApp. Use `local_base_config` to
36 36
     set base_config outside of a request context (e.g. system loading
@@ -97,9 +97,9 @@ def swap_dir(src_dir, dst_dir, keep_old=False, backup_ext='.tmp'):
97 97
     tmp_dir = dst_dir + backup_ext
98 98
     if os.path.exists(dst_dir):
99 99
         os.rename(dst_dir, tmp_dir)
100  
-    
  100
+
101 101
     _force_rename_dir(src_dir, dst_dir)
102  
-    
  102
+
103 103
     if os.path.exists(tmp_dir) and not keep_old:
104 104
         shutil.rmtree(tmp_dir)
105 105
 
@@ -139,8 +139,10 @@ def timestamp_before(weeks=0, days=0, hours=0, minutes=0):
139 139
 
140 140
 def timestamp_from_isodate(isodate):
141 141
     """
142  
-    >>> timestamp_from_isodate('2009-06-09T10:57:00')
143  
-    1244537820.0
  142
+    >>> ts = timestamp_from_isodate('2009-06-09T10:57:00')
  143
+    >>> # we don't know which timezone the test will run
  144
+    >>> (1244537820.0 - 14 * 3600) < ts < (1244537820.0 + 14 * 3600)
  145
+    True
144 146
     >>> timestamp_from_isodate('2009-06-09T10:57') #doctest: +ELLIPSIS
145 147
     Traceback (most recent call last):
146 148
     ...
@@ -152,7 +154,7 @@ def timestamp_from_isodate(isodate):
152 154
         date = datetime.datetime.strptime(isodate, "%Y-%m-%dT%H:%M:%S")
153 155
     return time.mktime(date.timetuple())
154 156
 
155  
-def cleanup_directory(directory, before_timestamp, remove_empty_dirs=True, 
  157
+def cleanup_directory(directory, before_timestamp, remove_empty_dirs=True,
156 158
                       file_handler=None):
157 159
     if file_handler is None:
158 160
         file_handler = os.remove
@@ -173,7 +175,7 @@ def cleanup_directory(directory, before_timestamp, remove_empty_dirs=True,
173 175
 
174 176
             if remove_empty_dirs:
175 177
                 remove_dir_if_emtpy(dirpath)
176  
-    
  178
+
177 179
         if remove_empty_dirs:
178 180
             remove_dir_if_emtpy(directory)
179 181
 
@@ -199,7 +201,7 @@ def ensure_directory(file_name):
199 201
 def replace_instancemethod(old_method, new_method):
200 202
     """
201 203
     Replace an instance method.
202  
-    
  204
+
203 205
     >>> class Foo(object):
204 206
     ...    val = 'bar'
205 207
     ...    def bar(self):
3  requirements-tests.txt
... ...
@@ -1,4 +1,5 @@
1  
-WebTest>=1.2.2
  1
+WebTest>=1.2.2,<1.2.99
  2
+webob==1.1.1
2 3
 coverage>=2.85
3 4
 lxml>=2.1.3
4 5
 mocker>=0.10.1
9  requirements-travis.txt
... ...
@@ -0,0 +1,9 @@
  1
+WebTest==1.4.0
  2
+webob==1.1.1
  3
+lxml==2.3.5
  4
+mocker==1.1.1
  5
+nose==1.1.2
  6
+Shapely==1.2.15
  7
+PyYAML==3.10
  8
+Pillow==1.7.7
  9
+eventlet==0.9.17

0 notes on commit 3e83d22

Please sign in to comment.
Something went wrong with that request. Please try again.