Skip to content

Commit 33d390f

Browse files
author
Adrian
authored
Added support for Python3.10 (CADC-11161) (#208)
* Added support for Python3.10 and removed support for Python2.7
1 parent 5263cff commit 33d390f

File tree

14 files changed

+122
-180
lines changed

14 files changed

+122
-180
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.8
16+
- name: Set up Python 3.9
1717
uses: actions/setup-python@v2
1818
with:
19-
python-version: 3.8
19+
python-version: 3.9
2020
- name: Install tox
2121
run: python -m pip install --upgrade tox
2222
- name: egg-info vos
@@ -31,8 +31,7 @@ jobs:
3131
fail-fast: true
3232
matrix:
3333
#TODO 2.7 fails on GH Actions but cannot be reproduced locally. Disabled for now.
34-
# python-version: [2.7,3.5,3.6,3.7,3.8,3.9]
35-
python-version: [3.5,3.6,3.7,3.8,3.9]
34+
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
3635
package: [vos, vofs]
3736
steps:
3837
- name: Checkout code
@@ -58,10 +57,10 @@ jobs:
5857
needs: tests
5958
steps:
6059
- uses: actions/checkout@v2
61-
- name: Set up Python 3.8
60+
- name: Set up Python 3.9
6261
uses: actions/setup-python@v2
6362
with:
64-
python-version: 3.8
63+
python-version: 3.9
6564
- name: Setup Graphviz
6665
uses: ts-graphviz/setup-graphviz@v1
6766
- name: Install tox

README.rst

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,78 @@ VOS - VOSpace tools
1313
.. image:: https://img.shields.io/github/contributors/opencadc/vostools.svg
1414
:target: https://github.com/opencadc/vostools/graphs/contributors
1515

16+
17+
Tools to work with VOSpace services (primarily the CADC ones)..
18+
19+
20+
Developers Guide
21+
================
22+
23+
24+
Requires pip.
25+
26+
Installing Packages
27+
-------------------
28+
Note: might need to escape chars in your shell
29+
30+
::
31+
32+
cd vos && pip install -e .[test]
33+
cd vofs && pip install -e .[test]
34+
35+
Testing packages
36+
----------------
37+
38+
Testing vos
39+
~~~~~~~~~~~
40+
41+
::
42+
43+
cd ./vos
44+
pytest vos
45+
46+
Testing vofs
47+
~~~~~~~~~~~~
48+
49+
::
50+
51+
cd ./vofs
52+
pytest vofs
53+
54+
55+
56+
Checkstyle
57+
~~~~~~~~~~
58+
flake8 style checking is enforced on pull requests. Following commands should
59+
not report errors
60+
61+
::
62+
63+
flake8 vos/vos vofs/vofs
64+
65+
66+
Testing with tox
67+
~~~~~~~~~~~~~~~~
68+
69+
If tox, the generic virtual environment tool, is available it can be used to test with different versions of
70+
python is isolation. For example, to test on all supported versions of Python in cadcdata (assuming that
71+
they are available in the system):
72+
73+
::
74+
75+
cd ./vos && tox
76+
77+
To test a specific version:
78+
79+
::
80+
81+
cd ./vos && tox -e py3.9
82+
83+
84+
To list all the available environments:
85+
86+
::
87+
88+
cd ./vos && tox -a
89+
90+

vofs/README.rst

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -70,82 +70,13 @@ Tutorial
7070
of your unix users IDs and thus files appear to be owned by the
7171
user who issued the 'mountvofs' command.*
7272

73-
Development
74-
-----------
75-
76-
A virtual environment (**venv**) is recommended to set up external
77-
dependencies without installing them system-wide. Following `these
78-
instructions <http://docs.python-guide.org/en/latest/dev/virtualenvs/>`__,
79-
install **virtualenv**:
80-
81-
::
82-
83-
$ pip install virtualenv
84-
85-
Next, create, and activate a local **venv** (this example uses
86-
**bash**):
87-
88-
::
89-
90-
$ virtualenv venv
91-
$ source venv/bin/activate
92-
93-
Setup the new development environment for testing by installing the
94-
appropriate packages:
95-
96-
::
97-
98-
$ pip install -r dev_requirements.txt
99-
100-
The test environment is built into the *setup.py* so that conducting
101-
unit-tests can be achieved like so:
102-
103-
::
104-
105-
python setup.py test
106-
107-
If you would like versbose output formated as a web page, for example,
108-
you can add options to the test call:
109-
110-
::
111-
112-
python setup.py test --addopts '--cov-report html:cov_html --cov=vosfs'
113-
114-
The same option attribute can be used to pass other arguments to py.test
115-
that is executing the test. To run specific only tests for example:
116-
117-
::
118-
119-
python setup.py test --addopts 'vos/test/Test_vos.py::TestClient::test_transfer_error'
120-
121-
Each time you resume work on the project and want to use the **venv**
122-
(e.g., from a new shell), simply re-activate it:
123-
124-
::
125-
126-
$ source venv/bin/activate
127-
128-
When done, just issue a
129-
130-
::
131-
132-
$ deactivate
133-
134-
command to deactivate the virtual environment.
13573

13674
Integration Tests
13775
~~~~~~~~~~~~~~~~~
13876

13977
The integration tests are, at present, designed to run only with the
14078
CADC VOSpace. Tests assume that the vofs package has been installed.
14179

142-
Activate the **venv** and install vofs
143-
144-
::
145-
146-
$ source venv/bin/activate.csh
147-
$ pip install vofs
148-
14980
Run the tests:
15081

15182
\`\`\` $ ./test/scripts/vospace-mountvospace-atest.tcsh

vofs/dev_requirements.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

vofs/setup.cfg

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,20 @@ license = AGPLv3
4949
url = https://www.canfar.net/en/docs/storage
5050
edit_on_github = False
5151
github_project = opencadc/vostools
52-
install_requires = vos>=3.1.2 BitVector>=3.4.4,<4.0 fusepy>=2.0.4
52+
install_requires =
53+
vos>=3.3.7
54+
BitVector>=3.4.4,<4.0
55+
fusepy>=2.0.4
5356
# version should be PEP440 compatible (http://www.python.org/dev/peps/pep-0440)
54-
version = 3.1a
57+
version = 3.1
58+
59+
[options.extras_require]
60+
test =
61+
pytest>=4.6
62+
pytest-cov>=2.5.1
63+
flake8>=3.4.1
64+
future>=0.16.0
65+
mock>=2.0.0
5566

5667
[entry_points]
5768
#astropy-package-template-example = packagename.example_mod:main

vofs/setup.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,14 @@ def run_tests(self):
129129
use_2to3=False,
130130
setup_requires=['pytest-runner'],
131131
entry_points=entry_points,
132-
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4',
132+
python_requires='!=3.0.*, !=3.1.*, !=3.2.*, !=3.4, <4',
133133
packages=find_packages(),
134134
package_data={PACKAGENAME: ['data/*', 'tests/data/*', '*/data/*', '*/tests/data/*']},
135135
classifiers=[
136136
'Natural Language :: English',
137137
'License :: OSI Approved :: GNU Affero General Public License v3',
138138
'Programming Language :: Python',
139-
'Programming Language :: Python :: 2.7',
140139
'Programming Language :: Python :: 3',
141-
'Programming Language :: Python :: 3.4',
142-
'Programming Language :: Python :: 3.5',
143-
'Programming Language :: Python :: 3.6'
144140
],
145141
cmdclass = {
146142
'coverage': PyTest, 'intTest': PyIntTest, 'allTest': PyAllTest

vofs/tox.ini

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@ name = vofs
55

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

1212
[testenv]
1313
description = run tests
1414
changedir = {toxinidir}
1515
passenv = HOME
16-
deps = -rdev_requirements.txt
16+
deps =
17+
-e ../vos
1718
commands =
1819
pip freeze
1920
pytest {[package]name}
21+
extras =
22+
test
2023

2124
[testenv:egg_info]
2225
description = ensure egg_info works without dependencies
@@ -27,7 +30,7 @@ commands =
2730
description = determine the code coverage
2831
deps:
2932
coverage>=4.5.4
30-
-rdev_requirements.txt
33+
-e ../vos
3134
commands =
3235
pytest {[package]name} --cov {[package]name} --cov-report xml --cov-config={toxinidir}/setup.cfg
3336

vofs/vofs/tests/test_vofs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import ctypes
1010
from fuse import FuseOSError, fuse_operations
1111
from errno import EIO, EPERM, ENOENT
12-
import unittest2 as unittest
12+
import unittest
1313
from mock import Mock, MagicMock, patch, ANY
1414
import vos
1515
from cadcutils import exceptions

vos/README.rst

Lines changed: 2 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ System Requirments
3333

3434
- A CANFAR VOSpace account (required for WRITE access, READ access can
3535
be anonymous)
36-
- fuse OR OSX-FUSE (see additional documentation, only required for
37-
filesystem based access, not for command line or programmatic)
38-
- python2.6 or later
36+
- python3.7 or later
3937

4038
Installation
4139
------------
@@ -83,82 +81,14 @@ Tutorial
8381
client = vos.Client()
8482
client.listdir('vos:jkavelaars')
8583

86-
Development
87-
-----------
88-
89-
A virtual environment (**venv**) is recommended to set up external
90-
dependencies without installing them system-wide. Following `these
91-
instructions <http://docs.python-guide.org/en/latest/dev/virtualenvs/>`__,
92-
install **virtualenv**:
93-
94-
::
95-
96-
$ pip install virtualenv
97-
98-
Next, create, and activate a local **venv** (this example uses
99-
**bash**):
100-
101-
::
102-
103-
$ virtualenv venv
104-
$ source venv/bin/activate
105-
106-
107-
Setup the new development environment for testing by installing the appropriate packages:
108-
109-
::
110-
111-
$ pip install -r dev_requirements.txt
112-
113-
The test environment is built into the *setup.py* so that conducting unit-tests can be achieved like so:
114-
115-
::
116-
117-
$ python setup.py test
118-
119-
If you would like versbose output formated as a web page, for example,
120-
you can add options to the test call:
121-
122-
::
123-
124-
$ python setup.py test --addopts '--cov-report html:cov_html --cov=vos'
125-
126-
The same option attribute can be used to pass other arguments to py.test
127-
that is executing the test. To run specific only tests for example:
128-
129-
::
130-
131-
$ python setup.py test --addopts 'vos/test/Test_vos.py::TestClient::test_transfer_error'
132-
133-
Each time you resume work on the project and want to use the **venv**
134-
(e.g., from a new shell), simply re-activate it:
135-
136-
::
137-
138-
$ source venv/bin/activate
139-
140-
When done, just issue a
141-
142-
::
143-
144-
$ deactivate
145-
146-
command to deactivate the virtual environment.
14784

14885
Integration Tests
14986
~~~~~~~~~~~~~~~~~
15087

15188
The integration tests are, at present, designed to run only with the
152-
CADC VOSpace. Tests assume that vos and/or vofs packages have been
89+
CADC VOSpace and test accounts credentials. Tests assume that vos and/or vofs packages have been
15390
installed.
15491

155-
Activate the **venv** and install vos
156-
157-
::
158-
159-
$ source venv/bin/activate.csh
160-
$ pip install vos
161-
16292
Run the tests:
16393

16494
$ ./test/scripts/vospace-all.tcsh

vos/dev_requirements.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)