Skip to content

Commit c79f527

Browse files
author
Adrian
authored
A few improvements (#210)
* Added support for -k option used for testing * Removed vofs * Removed 2.7 code * Added support for server versions
1 parent d32c85c commit c79f527

35 files changed

+1897
-114
lines changed

.github/workflows/cibuild.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v2
16-
- name: Set up Python 3.9
16+
- name: Set up Python 3.10
1717
uses: actions/setup-python@v2
1818
with:
19-
python-version: 3.9
19+
python-version: "3.10"
2020
- name: Install tox
2121
run: python -m pip install --upgrade tox
2222
- name: egg-info vos
@@ -28,8 +28,7 @@ jobs:
2828
strategy:
2929
fail-fast: true
3030
matrix:
31-
#TODO 2.7 fails on GH Actions but cannot be reproduced locally. Disabled for now.
32-
python-version: ["3.7", "3.8", "3.9", "3.10"]
31+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
3332
package: [vos]
3433
steps:
3534
- name: Checkout code
@@ -55,10 +54,10 @@ jobs:
5554
needs: tests
5655
steps:
5756
- uses: actions/checkout@v2
58-
- name: Set up Python 3.9
57+
- name: Set up Python 3.10
5958
uses: actions/setup-python@v2
6059
with:
61-
python-version: 3.9
60+
python-version: "3.10"
6261
- name: Setup Graphviz
6362
uses: ts-graphviz/setup-graphviz@v1
6463
- name: Install tox

vos/intTest/test_basic_cmds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from vos.commands import vls, vcp, vmkdir, vrm, vrmdir, vchmod, vmv, vln, vsync
22
from vos.commands import vtag, vlock
3-
from six import StringIO
3+
from io import StringIO
44
from cadcutils import net
55
from mock import patch, Mock
66
import pytest

vos/setup.cfg

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,17 @@ edit_on_github = False
5050
github_project = opencadc/vostools
5151
install_requires =
5252
html2text>=2016.5.29
53-
cadcutils>=1.4.3
54-
future
53+
cadcutils>=1.5.1
5554
aenum
5655

5756
# version should be PEP440 compatible (http://www.python.org/dev/peps/pep-0440)
58-
version = 3.3.7
57+
version = 3.4
5958

6059
[options.extras_require]
6160
test =
6261
pytest>=4.6
6362
pytest-cov>=2.5.1
6463
flake8>=3.4.1
65-
future>=0.16.0
6664
mock>=2.0.0
6765

6866

vos/setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ def run_tests(self):
121121
long_description=readme(),
122122
project_urls={
123123
'Source': 'https://github.com/opencadc/vostools',
124-
'Travis CI': 'https://travis-ci.org/opencadc/vostools',
125124
'Issues': 'https://github.com/opencadc/vostools/issues',
126125
'VOSpace Standard': 'http://www.ivoa.net/documents/VOSpace/'
127126
},

vos/test/performance/vofsRandomAccessSeeks.py

Lines changed: 74 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,71 @@
1-
#!/usr/bin/env python2.7
1+
# ***********************************************************************
2+
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
3+
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
4+
#
5+
# (c) 2022. (c) 2022.
6+
# Government of Canada Gouvernement du Canada
7+
# National Research Council Conseil national de recherches
8+
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
9+
# All rights reserved Tous droits réservés
10+
#
11+
# NRC disclaims any warranties, Le CNRC dénie toute garantie
12+
# expressed, implied, or énoncée, implicite ou légale,
13+
# statutory, of any kind with de quelque nature que ce
14+
# respect to the software, soit, concernant le logiciel,
15+
# including without limitation y compris sans restriction
16+
# any warranty of merchantability toute garantie de valeur
17+
# or fitness for a particular marchande ou de pertinence
18+
# purpose. NRC shall not be pour un usage particulier.
19+
# liable in any event for any Le CNRC ne pourra en aucun cas
20+
# damages, whether direct or être tenu responsable de tout
21+
# indirect, special or general, dommage, direct ou indirect,
22+
# consequential or incidental, particulier ou général,
23+
# arising from the use of the accessoire ou fortuit, résultant
24+
# software. Neither the name de l'utilisation du logiciel. Ni
25+
# of the National Research le nom du Conseil National de
26+
# Council of Canada nor the Recherches du Canada ni les noms
27+
# names of its contributors may de ses participants ne peuvent
28+
# be used to endorse or promote être utilisés pour approuver ou
29+
# products derived from this promouvoir les produits dérivés
30+
# software without specific prior de ce logiciel sans autorisation
31+
# written permission. préalable et particulière
32+
# par écrit.
33+
#
34+
# This file is part of the Ce fichier fait partie du projet
35+
# OpenCADC project. OpenCADC.
36+
#
37+
# OpenCADC is free software: OpenCADC est un logiciel libre ;
38+
# you can redistribute it and/or vous pouvez le redistribuer ou le
39+
# modify it under the terms of modifier suivant les termes de
40+
# the GNU Affero General Public la “GNU Affero General Public
41+
# License as published by the License” telle que publiée
42+
# Free Software Foundation, par la Free Software Foundation
43+
# either version 3 of the : soit la version 3 de cette
44+
# License, or (at your option) licence, soit (à votre gré)
45+
# any later version. toute version ultérieure.
46+
#
47+
# OpenCADC is distributed in the OpenCADC est distribué
48+
# hope that it will be useful, dans l’espoir qu’il vous
49+
# but WITHOUT ANY WARRANTY; sera utile, mais SANS AUCUNE
50+
# without even the implied GARANTIE : sans même la garantie
51+
# warranty of MERCHANTABILITY implicite de COMMERCIALISABILITÉ
52+
# or FITNESS FOR A PARTICULAR ni d’ADÉQUATION À UN OBJECTIF
53+
# PURPOSE. See the GNU Affero PARTICULIER. Consultez la Licence
54+
# General Public License for Générale Publique GNU Affero
55+
# more details. pour plus de détails.
56+
#
57+
# You should have received Vous devriez avoir reçu une
58+
# a copy of the GNU Affero copie de la Licence Générale
59+
# General Public License along Publique GNU Affero avec
60+
# with OpenCADC. If not, see OpenCADC ; si ce n’est
61+
# <http://www.gnu.org/licenses/>. pas le cas, consultez :
62+
# <http://www.gnu.org/licenses/>.
63+
#
64+
# $Revision: 4 $
65+
#
66+
# ***********************************************************************
67+
#
68+
269

370
import os
471
import optparse
@@ -21,7 +88,7 @@ def parseCmdLine():
2188
help='File to read.' )
2289
Main.opt, args = op.parse_args()
2390
if ( Main.opt.fileName == '-' ):
24-
print "ERROR: Filename must be provided."
91+
print("ERROR: Filename must be provided.")
2592
op.print_help()
2693
exit( -1 )
2794

@@ -30,12 +97,12 @@ def parseCmdLine():
3097
statinfo = os.stat(Main.opt.fileName)
3198
maxValue = ( statinfo.st_size / 1024 ) - Main.opt.size
3299
Main.opt.offsets = " ".join( str(w) for w in \
33-
random.sample( xrange(maxValue), Main.opt.random) )
34-
print Main.opt.offsets
100+
random.sample( range(maxValue), Main.opt.random) )
101+
print(Main.opt.offsets)
35102
else:
36103
for offset in Main.opt.offsets.split():
37104
if ( not offset.isdigit() ):
38-
print "ERROR: Offsets must be integers"
105+
print("ERROR: Offsets must be integers")
39106
op.print_help()
40107
exit( -1 )
41108

@@ -66,7 +133,7 @@ def mainMethod():
66133
timming.append( end - start )
67134

68135
for atime in timming:
69-
print "{0} ".format( int( atime * 1000000 ) ),
70-
print
136+
print("{0} ".format( int( atime * 1000000 ) )),
137+
print('')
71138

72139
Main.mainMethod()

vos/test/scripts/test_lockerrors_int.py

Lines changed: 72 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,70 @@
1-
#!/usr/bin/env python2.7
1+
# ***********************************************************************
2+
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
3+
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
4+
#
5+
# (c) 2022. (c) 2022.
6+
# Government of Canada Gouvernement du Canada
7+
# National Research Council Conseil national de recherches
8+
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
9+
# All rights reserved Tous droits réservés
10+
#
11+
# NRC disclaims any warranties, Le CNRC dénie toute garantie
12+
# expressed, implied, or énoncée, implicite ou légale,
13+
# statutory, of any kind with de quelque nature que ce
14+
# respect to the software, soit, concernant le logiciel,
15+
# including without limitation y compris sans restriction
16+
# any warranty of merchantability toute garantie de valeur
17+
# or fitness for a particular marchande ou de pertinence
18+
# purpose. NRC shall not be pour un usage particulier.
19+
# liable in any event for any Le CNRC ne pourra en aucun cas
20+
# damages, whether direct or être tenu responsable de tout
21+
# indirect, special or general, dommage, direct ou indirect,
22+
# consequential or incidental, particulier ou général,
23+
# arising from the use of the accessoire ou fortuit, résultant
24+
# software. Neither the name de l'utilisation du logiciel. Ni
25+
# of the National Research le nom du Conseil National de
26+
# Council of Canada nor the Recherches du Canada ni les noms
27+
# names of its contributors may de ses participants ne peuvent
28+
# be used to endorse or promote être utilisés pour approuver ou
29+
# products derived from this promouvoir les produits dérivés
30+
# software without specific prior de ce logiciel sans autorisation
31+
# written permission. préalable et particulière
32+
# par écrit.
33+
#
34+
# This file is part of the Ce fichier fait partie du projet
35+
# OpenCADC project. OpenCADC.
36+
#
37+
# OpenCADC is free software: OpenCADC est un logiciel libre ;
38+
# you can redistribute it and/or vous pouvez le redistribuer ou le
39+
# modify it under the terms of modifier suivant les termes de
40+
# the GNU Affero General Public la “GNU Affero General Public
41+
# License as published by the License” telle que publiée
42+
# Free Software Foundation, par la Free Software Foundation
43+
# either version 3 of the : soit la version 3 de cette
44+
# License, or (at your option) licence, soit (à votre gré)
45+
# any later version. toute version ultérieure.
46+
#
47+
# OpenCADC is distributed in the OpenCADC est distribué
48+
# hope that it will be useful, dans l’espoir qu’il vous
49+
# but WITHOUT ANY WARRANTY; sera utile, mais SANS AUCUNE
50+
# without even the implied GARANTIE : sans même la garantie
51+
# warranty of MERCHANTABILITY implicite de COMMERCIALISABILITÉ
52+
# or FITNESS FOR A PARTICULAR ni d’ADÉQUATION À UN OBJECTIF
53+
# PURPOSE. See the GNU Affero PARTICULIER. Consultez la Licence
54+
# General Public License for Générale Publique GNU Affero
55+
# more details. pour plus de détails.
56+
#
57+
# You should have received Vous devriez avoir reçu une
58+
# a copy of the GNU Affero copie de la Licence Générale
59+
# General Public License along Publique GNU Affero avec
60+
# with OpenCADC. If not, see OpenCADC ; si ce n’est
61+
# <http://www.gnu.org/licenses/>. pas le cas, consultez :
62+
# <http://www.gnu.org/licenses/>.
63+
#
64+
# $Revision: 4 $
65+
#
66+
# ***********************************************************************
67+
#
268

369
"""Integration test wrapped in unit test infrastructure.
470
Expects vospace_ws to be running on localhost, and
@@ -42,21 +108,21 @@ def run_cmd(self, args, print_output=False, use_debug=False, expected_errno=255,
42108

43109
cmd = '%s %s %s %s %s' %(self.time_execution, self.script_run, args, self.use_debug, self.test_cert_param)
44110
if print_output:
45-
print 'Running [%s]' % cmd
111+
print('Running [%s]' % cmd)
46112

47113
try:
48114
p = Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT)
49115
output = p.communicate()[0]
50116
if print_output:
51-
print output
117+
print(output)
52118

53119
self.assertEquals(p.returncode, expected_errno, 'got returncode %d, expected %d' % (p.returncode, expected_errno))
54120
regex = re.search('NodeLocked', output)
55121
self.assertTrue(regex != None, 'did not find "NodeLocked"' )
56122

57-
except Exception, e:
58-
print 'Error running [%s]' % cmd
59-
print output
123+
except Exception as e:
124+
print('Error running [%s]' % cmd)
125+
print(output)
60126
self.fail(e)
61127

62128

vos/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name = vos
55

66
[tox]
77
envlist =
8-
py{27,34,35,36,37,38,39}
8+
py{37,38,39,310,311}
99
requires =
1010
pip >= 19.3.1
1111

vos/vos/commands/interrupt_exception.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,71 @@
1+
# ***********************************************************************
2+
# ****************** CANADIAN ASTRONOMY DATA CENTRE *******************
3+
# ************* CENTRE CANADIEN DE DONNÉES ASTRONOMIQUES **************
4+
#
5+
# (c) 2022. (c) 2022.
6+
# Government of Canada Gouvernement du Canada
7+
# National Research Council Conseil national de recherches
8+
# Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6
9+
# All rights reserved Tous droits réservés
10+
#
11+
# NRC disclaims any warranties, Le CNRC dénie toute garantie
12+
# expressed, implied, or énoncée, implicite ou légale,
13+
# statutory, of any kind with de quelque nature que ce
14+
# respect to the software, soit, concernant le logiciel,
15+
# including without limitation y compris sans restriction
16+
# any warranty of merchantability toute garantie de valeur
17+
# or fitness for a particular marchande ou de pertinence
18+
# purpose. NRC shall not be pour un usage particulier.
19+
# liable in any event for any Le CNRC ne pourra en aucun cas
20+
# damages, whether direct or être tenu responsable de tout
21+
# indirect, special or general, dommage, direct ou indirect,
22+
# consequential or incidental, particulier ou général,
23+
# arising from the use of the accessoire ou fortuit, résultant
24+
# software. Neither the name de l'utilisation du logiciel. Ni
25+
# of the National Research le nom du Conseil National de
26+
# Council of Canada nor the Recherches du Canada ni les noms
27+
# names of its contributors may de ses participants ne peuvent
28+
# be used to endorse or promote être utilisés pour approuver ou
29+
# products derived from this promouvoir les produits dérivés
30+
# software without specific prior de ce logiciel sans autorisation
31+
# written permission. préalable et particulière
32+
# par écrit.
33+
#
34+
# This file is part of the Ce fichier fait partie du projet
35+
# OpenCADC project. OpenCADC.
36+
#
37+
# OpenCADC is free software: OpenCADC est un logiciel libre ;
38+
# you can redistribute it and/or vous pouvez le redistribuer ou le
39+
# modify it under the terms of modifier suivant les termes de
40+
# the GNU Affero General Public la “GNU Affero General Public
41+
# License as published by the License” telle que publiée
42+
# Free Software Foundation, par la Free Software Foundation
43+
# either version 3 of the : soit la version 3 de cette
44+
# License, or (at your option) licence, soit (à votre gré)
45+
# any later version. toute version ultérieure.
46+
#
47+
# OpenCADC is distributed in the OpenCADC est distribué
48+
# hope that it will be useful, dans l’espoir qu’il vous
49+
# but WITHOUT ANY WARRANTY; sera utile, mais SANS AUCUNE
50+
# without even the implied GARANTIE : sans même la garantie
51+
# warranty of MERCHANTABILITY implicite de COMMERCIALISABILITÉ
52+
# or FITNESS FOR A PARTICULAR ni d’ADÉQUATION À UN OBJECTIF
53+
# PURPOSE. See the GNU Affero PARTICULIER. Consultez la Licence
54+
# General Public License for Générale Publique GNU Affero
55+
# more details. pour plus de détails.
56+
#
57+
# You should have received Vous devriez avoir reçu une
58+
# a copy of the GNU Affero copie de la Licence Générale
59+
# General Public License along Publique GNU Affero avec
60+
# with OpenCADC. If not, see OpenCADC ; si ce n’est
61+
# <http://www.gnu.org/licenses/>. pas le cas, consultez :
62+
# <http://www.gnu.org/licenses/>.
63+
#
64+
# $Revision: 4 $
65+
#
66+
# ***********************************************************************
67+
#
68+
169
"""A utilities for dealing with CL signal handeling."""
270
import signal
371

0 commit comments

Comments
 (0)