Skip to content

Commit 0b0847b

Browse files
Support Python 3.10 and 3.11 (#65)
* Bump torch version for py311 * remove py311 for other os than ubuntu * Fix minimum version torch windows * fix tasks * Remove meta.yaml from bumpversion * Drop python3.11 * Fix versions * Update tox
1 parent e74757d commit 0b0847b

File tree

9 files changed

+42
-41
lines changed

9 files changed

+42
-41
lines changed

.github/workflows/integration.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,18 @@ on:
66
types: [opened, reopened]
77

88
jobs:
9-
unit:
9+
integration:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
python-version: [3.6, 3.7, 3.8, 3.9]
14-
os: [ubuntu-20.04, macos-latest, windows-latest]
13+
python-version: ['3.7', '3.8', '3.9', '3.10']
14+
os: [ubuntu-latest, macos-latest, windows-latest]
1515
steps:
1616
- uses: actions/checkout@v1
1717
- name: Set up Python ${{ matrix.python-version }}
1818
uses: actions/setup-python@v2
1919
with:
2020
python-version: ${{ matrix.python-version }}
21-
- if: matrix.os == 'windows-latest' && matrix.python-version == 3.6
22-
run: python -m pip install pywinpty==2.0.1
2321
- if: matrix.os == 'windows-latest'
2422
name: Install dependencies - Windows
2523
run: |

.github/workflows/minimum.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,24 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
python-version: [3.6, 3.7, 3.8, 3.9]
14-
os: [ubuntu-20.04, macos-latest, windows-latest]
13+
python-version: ['3.7', '3.8', '3.9', '3.10']
14+
os: [ubuntu-latest, macos-latest, windows-latest]
1515
steps:
1616
- uses: actions/checkout@v1
1717
- name: Set up Python ${{ matrix.python-version }}
1818
uses: actions/setup-python@v2
1919
with:
2020
python-version: ${{ matrix.python-version }}
21-
- if: matrix.os == 'windows-latest' && matrix.python-version == 3.6
22-
run: python -m pip install pywinpty==2.0.1
23-
- if: matrix.os == 'windows-latest'
21+
- if: matrix.os == 'windows-latest' && matrix.python-version != 3.10
2422
name: Install dependencies - Windows
2523
run: |
2624
python -m pip install --upgrade pip
2725
python -m pip install 'torch==1.8' -f https://download.pytorch.org/whl/cpu/torch/
26+
- if: matrix.os == 'windows-latest' && matrix.python-version == 3.10
27+
name: Install dependencies - Windows
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install 'torch==1.11.0' -f https://download.pytorch.org/whl/cpu/torch/
2831
- name: Install dependencies
2932
run: |
3033
python -m pip install --upgrade pip

.github/workflows/readme.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
python-version: [3.6, 3.7, 3.8, 3.9]
14-
os: [ubuntu-20.04, macos-latest] # skip windows bc rundoc fails
13+
python-version: ['3.7', '3.8', '3.9', '3.10']
14+
os: [ubuntu-latest, macos-latest] # skip windows bc rundoc fails
1515
steps:
1616
- uses: actions/checkout@v1
1717
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/unit.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
python-version: [3.6, 3.7, 3.8, 3.9]
14-
os: [ubuntu-20.04, macos-latest, windows-latest]
13+
python-version: ['3.7', '3.8', '3.9', '3.10']
14+
os: [ubuntu-latest, macos-latest, windows-latest]
1515
steps:
1616
- uses: actions/checkout@v1
1717
- name: Set up Python ${{ matrix.python-version }}
1818
uses: actions/setup-python@v2
1919
with:
2020
python-version: ${{ matrix.python-version }}
21-
- if: matrix.os == 'windows-latest' && matrix.python-version == 3.6
22-
run: python -m pip install pywinpty==2.0.1
2321
- if: matrix.os == 'windows-latest'
2422
name: Install dependencies - Windows
2523
run: |

INSTALL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## Requirements
44

5-
**DeepEcho** has been developed and tested on [Python 3.6, 3.7, 3.8 and 3.9](https://www.python.org/downloads/)
5+
**DeepEcho** has been developed and tested on
6+
[Python 3.7, 3.8, 3.9, 3.10 and 3.11](https://www.python.org/downloads/)
67

78
Also, although it is not strictly required, the usage of a [virtualenv](
89
https://virtualenv.pypa.io/en/latest/) is highly recommended in order to avoid

setup.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ replace = version='{new_version}'
2424
search = __version__ = '{current_version}'
2525
replace = __version__ = '{new_version}'
2626

27-
[bumpversion:file:conda/meta.yaml]
28-
search = version = '{current_version}'
29-
replace = version = '{new_version}'
30-
3127
[bdist_wheel]
3228
universal = 1
3329

setup.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
history = history_file.read()
1313

1414
install_requires = [
15-
"numpy>=1.18.0,<1.20.0;python_version<'3.7'",
16-
"numpy>=1.20.0,<2;python_version>='3.7'",
17-
'pandas>=1.1.3,<2',
18-
'torch>=1.8.0,<2',
15+
"numpy>=1.20.0,<2;python_version<'3.10'",
16+
"numpy>=1.23.3,<2;python_version>='3.10'",
17+
"pandas>=1.1.3,<2;python_version<'3.10'",
18+
"pandas>=1.3.4,<2;python_version>='3.10'",
19+
"torch>=1.8.0,<2;python_version<'3.10'",
20+
"torch>=1.11.0,<2;python_version>='3.10'",
1921
'tqdm>=4.15,<5',
2022
]
2123

@@ -84,10 +86,10 @@
8486
'License :: Free for non-commercial use',
8587
'Natural Language :: English',
8688
'Programming Language :: Python :: 3',
87-
'Programming Language :: Python :: 3.6',
8889
'Programming Language :: Python :: 3.7',
8990
'Programming Language :: Python :: 3.8',
9091
'Programming Language :: Python :: 3.9',
92+
'Programming Language :: Python :: 3.10',
9193
'Topic :: Scientific/Engineering :: Artificial Intelligence',
9294
],
9395
description='Create sequential synthetic data of mixed types using a GAN.',
@@ -103,7 +105,7 @@
103105
long_description_content_type='text/markdown',
104106
name='deepecho',
105107
packages=find_packages(include=['deepecho', 'deepecho.*']),
106-
python_requires='>=3.6,<3.10',
108+
python_requires='>=3.7,<3.11',
107109
setup_requires=setup_requires,
108110
test_suite='tests',
109111
tests_require=tests_require,

tasks.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import glob
2+
import inspect
23
import operator
34
import os
45
import re
6+
import pkg_resources
57
import platform
68
import shutil
79
import stat
@@ -17,6 +19,11 @@
1719
'<=': operator.le
1820
}
1921

22+
23+
if not hasattr(inspect, 'getargspec'):
24+
inspect.getargspec = inspect.getfullargspec
25+
26+
2027
@task
2128
def check_dependencies(c):
2229
c.run('python -m pip check')
@@ -33,15 +40,18 @@ def unit(c):
3340

3441

3542
def _validate_python_version(line):
36-
python_version_match = re.search(r"python_version(<=?|>=?)\'(\d\.?)+\'", line)
37-
if python_version_match:
43+
is_valid = True
44+
for python_version_match in re.finditer(r"python_version(<=?|>=?|==)\'(\d\.?)+\'", line):
3845
python_version = python_version_match.group(0)
39-
comparison = re.search(r'(>=?|<=?)', python_version).group(0)
46+
comparison = re.search(r'(>=?|<=?|==)', python_version).group(0)
4047
version_number = python_version.split(comparison)[-1].replace("'", "")
4148
comparison_function = COMPARISONS[comparison]
42-
return comparison_function(platform.python_version(), version_number)
49+
is_valid = is_valid and comparison_function(
50+
pkg_resources.parse_version(platform.python_version()),
51+
pkg_resources.parse_version(version_number),
52+
)
4353

44-
return True
54+
return is_valid
4555

4656

4757
@task
@@ -56,7 +66,7 @@ def install_minimum(c):
5666
if line == ']':
5767
break
5868

59-
line = line.strip()
69+
line = line.strip()
6070
if _validate_python_version(line):
6171
requirement = re.match(r'[^>]*', line).group(0)
6272
requirement = re.sub(r"""['",]""", '', requirement)

tox.ini

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
[tox]
2-
envlist = py3{6,7,8,9}-{lint,readme,pytest,minimum}
3-
4-
[gh-actions]
5-
python =
6-
3.9: py39-lint, py39-readme, py39-pytest, py39-minimum, py39-tutorials
7-
3.8: py38-lint, py38-readme, py38-pytest, py38-minimum, py38-tutorials
8-
3.7: py37-lint, py37-readme, py37-pytest, py37-minimum, py37-tutorials
9-
3.6: py36-lint, py36-readme, py36-pytest, py36-minimum, py36-tutorials
2+
envlist = py38-lint, py3{7,8,9,10}-{readme,unit,integration,minimum,tutorials}
103

114
[testenv]
125
skipsdist = false

0 commit comments

Comments
 (0)