Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.10 and drop 3.6 #171

Merged
merged 6 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
os: [ubuntu-20.04, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- if: matrix.os == 'windows-latest'
- if: matrix.os == 'windows-latest' && matrix.python-version != '3.10'
name: Install dependencies - Windows
run: |
python -m pip install --upgrade pip
python -m pip install 'torch==1.8.0' -f https://download.pytorch.org/whl/cpu/torch/
python -m pip install 'torchvision==0.9.0' -f https://download.pytorch.org/whl/cpu/torchvision/
- if: matrix.os == 'windows-latest' && matrix.python-version == 3.6
name: Install dependencies - Windows with Python 3.6
run: python -m pip install pywinpty==2.0.1
- if: matrix.os == 'windows-latest' && matrix.python-version == '3.10'
name: Install dependencies - Windows
run: |
python -m pip install --upgrade pip
python -m pip install 'torch==1.11.0' -f https://download.pytorch.org/whl/cpu/torch/
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
lint:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/minimum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
os: [ubuntu-20.04, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- if: matrix.os == 'windows-latest'
- if: matrix.os == 'windows-latest' && matrix.python-version != 3.10
name: Install dependencies - Windows
run: |
python -m pip install --upgrade pip
python -m pip install 'torch==1.8.0' -f https://download.pytorch.org/whl/cpu/torch/
python -m pip install 'torchvision==0.9.0' -f https://download.pytorch.org/whl/cpu/torchvision/
- if: matrix.os == 'windows-latest' && matrix.python-version == 3.6
name: Install dependencies - Windows with Python 3.6
run: python -m pip install pywinpty==2.0.1
- if: matrix.os == 'windows-latest' && matrix.python-version == 3.10
name: Install dependencies - Windows
run: |
python -m pip install --upgrade pip
python -m pip install 'torch==1.11.0' -f https://download.pytorch.org/whl/cpu/torch/
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
os: [ubuntu-20.04, macos-latest] # skip windows bc rundoc fails
python-version: ['3.7', '3.8', '3.9', '3.10']
os: [ubuntu-latest, macos-latest] # skip windows bc rundoc fails
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
os: [ubuntu-20.04, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- if: matrix.os == 'windows-latest'
- if: matrix.os == 'windows-latest' && matrix.python-version != 3.10
name: Install dependencies - Windows
run: |
python -m pip install --upgrade pip
python -m pip install 'torch==1.8.0' -f https://download.pytorch.org/whl/cpu/torch/
python -m pip install 'torchvision==0.9.0' -f https://download.pytorch.org/whl/cpu/torchvision/
- if: matrix.os == 'windows-latest' && matrix.python-version == 3.6
name: Install dependencies - Windows with Python 3.6
run: python -m pip install pywinpty==2.0.1
- if: matrix.os == 'windows-latest' && matrix.python-version == 3.10
name: Install dependencies - Windows
run: |
python -m pip install --upgrade pip
python -m pip install 'torch==1.11.0' -f https://download.pytorch.org/whl/cpu/torch/
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ Before you submit a pull request, check that it meets these guidelines:
4. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
5. The pull request should work for Python 3.5 and 3.6. Check
https://travis-ci.org/sdv-dev/SDGym/pull_requests
5. The pull request should work for Python 3.7, 3.8, 3.9, and 3.10. Check
https://github.com/sdv-dev/SDGym/actions
and make sure that all the checks pass.

Unit Testing Guidelines
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Requirements

**SDGym** has been developed and tested on [Python 3.6, 3.7, 3.8 and 3.9](https://www.python.org/downloads/)
**SDGym** has been developed and tested on [Python 3.7, 3.8, 3.9, and 3.10](https://www.python.org/downloads/)

Also, although it is not strictly required, the usage of a [virtualenv](
https://virtualenv.pypa.io/en/latest/) is highly recommended in order to avoid
Expand Down
29 changes: 16 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,24 @@
'botocore>=1.18,<2',
'compress-pickle>=1.2.0,<3',
'humanfriendly>=8.2,<11',
"numpy>=1.18.0,<1.20.0;python_version<'3.7'",
"numpy>=1.20.0,<2;python_version>='3.7'",
'pandas>=1.1.3,<2',
"pomegranate>=0.13.4,<0.14.2;python_version<'3.7'",
"pomegranate>=0.14.1,<0.14.7;python_version>='3.7'",
"numpy>=1.20.0,<2;python_version<'3.10'",
"numpy>=1.23.3,<2;python_version>='3.10'",
"pandas>=1.1.3,<2;python_version<'3.10'",
"pandas>=1.5.0,<2;python_version>='3.10'",
"pomegranate>=0.14.3,<0.15",
'psutil>=5.7,<6',
'scikit-learn>=0.24,<2',
'scipy>=1.5.4,<2',
"scikit-learn>=0.24,<2;python_version<'3.10'",
"scikit-learn>=1.1.3,<2;python_version>='3.10'",
"scipy>=1.5.4,<2;python_version<'3.10'",
"scipy>=1.9.2,<2;python_version>='3.10'",
'tabulate>=0.8.3,<0.9',
'torch>=1.8.0,<2',
"torch>=1.8.0,<2;python_version<'3.10'",
"torch>=1.11.0,<2;python_version>='3.10'",
'tqdm>=4.15,<5',
'XlsxWriter>=1.2.8,<4',
'rdt>=1.2.1,<2.0',
'sdmetrics>=0.7.0,<1.0',
'sdv>=0.17.1',
'rdt>=1.3.0,<2.0',
'sdmetrics>=0.9.0,<1.0',
'sdv>=0.18.0',
]


Expand Down Expand Up @@ -87,10 +90,10 @@
'License :: Free for non-commercial use',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
],
description=(
Expand All @@ -115,7 +118,7 @@
keywords='machine learning synthetic data generation benchmark generative models',
name='sdgym',
packages=find_packages(include=['sdgym', 'sdgym.*']),
python_requires='>=3.6,<3.10',
python_requires='>=3.7,<3.11',
setup_requires=setup_requires,
test_suite='tests',
tests_require=tests_require,
Expand Down
22 changes: 15 additions & 7 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import glob
import inspect
import operator
import os
import re
import pkg_resources
import platform
import shutil
import stat
Expand All @@ -17,6 +19,10 @@
}


if not hasattr(inspect, 'getargspec'):
inspect.getargspec = inspect.getfullargspec


@task
def check_dependencies(c):
c.run('python -m pip check')
Expand Down Expand Up @@ -48,15 +54,18 @@ def readme(c):


def _validate_python_version(line):
python_version_match = re.search(r"python_version(<=?|>=?)\'(\d\.?)+\'", line)
if python_version_match:
is_valid = True
for python_version_match in re.finditer(r"python_version(<=?|>=?|==)\'(\d\.?)+\'", line):
python_version = python_version_match.group(0)
comparison = re.search(r'(>=?|<=?)', python_version).group(0)
comparison = re.search(r'(>=?|<=?|==)', python_version).group(0)
version_number = python_version.split(comparison)[-1].replace("'", "")
comparison_function = COMPARISONS[comparison]
return comparison_function(platform.python_version(), version_number)
is_valid = is_valid and comparison_function(
pkg_resources.parse_version(platform.python_version()),
pkg_resources.parse_version(version_number),
)

return True
return is_valid


@task
Expand All @@ -69,8 +78,7 @@ def install_minimum(c):
for line in lines:
if started:
if line == ']':
started = False
continue
break

line = line.strip()
if _validate_python_version(line):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38-lint, py3{6,7,8,9}-{integration,unit,minimum,readme}
envlist = py38-lint, py3{7,8,9,10}-{integration,unit,minimum,readme}

[testenv]
skipsdist = false
Expand Down