From 9e260247426e214dd488a6d2d9fdf58836c0bb16 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Sun, 28 Nov 2021 14:15:21 -0600 Subject: [PATCH 1/6] Drop version check that is outdated --- setup.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.py b/setup.py index bd2ffe51..7b4b3feb 100644 --- a/setup.py +++ b/setup.py @@ -21,9 +21,6 @@ install_requires = ['jupyter', 'jupyter-server-proxy', 'numpy', 'ipykernel', 'autobahn>=18.8.2'] -if sys.version_info.major == 3 and sys.version_info.minor >= 5: - install_requires.append('autobahn') - setup_args = dict( name='vpython', packages=['vpython'], From 38c891fc387da2672f14ad16f777be1ef88d6ff9 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Sun, 28 Nov 2021 14:16:31 -0600 Subject: [PATCH 2/6] Drop python 3.7 test in favor of 3.10 This does NOT mean Python 3.7 is no longer supported. Just trying to keep the number of builds a little reasonable. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11ed5229..1b58431c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: max-parallel: 4 fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.8, 3.9, 3.10] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} From 517a5fb0bb9c47aef845aae6d16445c04bc11248 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Sun, 28 Nov 2021 14:19:27 -0600 Subject: [PATCH 3/6] Add wheel builds for Python 3.10 --- .github/workflows/upload_pypi.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/upload_pypi.yml b/.github/workflows/upload_pypi.yml index e16c9682..90863d27 100644 --- a/.github/workflows/upload_pypi.yml +++ b/.github/workflows/upload_pypi.yml @@ -11,8 +11,8 @@ jobs: max-parallel: 4 fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9] - platform: [macos-latest, windows-latest] # No wheels on linux yet + python-version: [3.7, 3.8, 3.9, 3.10] + platform: [macos-latest, windows-latest] # Wheels on linux below runs-on: ${{ matrix.platform }} steps: @@ -55,9 +55,9 @@ jobs: python -m pip install --upgrade pip pip install twine - name: Python wheels manylinux build - uses: RalfG/python-wheels-manylinux-build@v0.3.4 + uses: RalfG/python-wheels-manylinux-build@v0.4.0 with: - python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38' + python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' build-requirements: 'setuptools cython' - name: Build and publish wheel env: @@ -73,7 +73,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: '3.8' + python-version: '3.10' - name: Install dependencies run: | python -m pip install --upgrade pip From 02ed63fd07b12a7ad3fe67ad2c4d5a339f73c925 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Sun, 28 Nov 2021 14:29:18 -0600 Subject: [PATCH 4/6] Make sure 3.10 is interpreted as three point ten --- .github/workflows/build.yml | 2 +- .github/workflows/upload_pypi.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1b58431c..279137c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: max-parallel: 4 fail-fast: false matrix: - python-version: [3.8, 3.9, 3.10] + python-version: [3.8, 3.9, '3.10'] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} diff --git a/.github/workflows/upload_pypi.yml b/.github/workflows/upload_pypi.yml index 90863d27..9f6f3a5e 100644 --- a/.github/workflows/upload_pypi.yml +++ b/.github/workflows/upload_pypi.yml @@ -11,7 +11,7 @@ jobs: max-parallel: 4 fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9, 3.10] + python-version: [3.7, 3.8, 3.9, '3.10'] platform: [macos-latest, windows-latest] # Wheels on linux below runs-on: ${{ matrix.platform }} From 7ef57afc545e2ae374a2ac4e3a563659b3738532 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Sun, 28 Nov 2021 14:38:52 -0600 Subject: [PATCH 5/6] Add minimum python version to setup --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 7b4b3feb..6ecd9e90 100644 --- a/setup.py +++ b/setup.py @@ -47,6 +47,7 @@ ], ext_modules=extensions, install_requires=install_requires, + python_requires=">=3.7", package_data={'vpython': ['vpython_data/*', 'vpython_libraries/*', 'vpython_libraries/images/*']}, From 3e3b03ada1cc254c8d0b43b2ceadb49df8363143 Mon Sep 17 00:00:00 2001 From: Matt Craig Date: Sun, 28 Nov 2021 14:40:27 -0600 Subject: [PATCH 6/6] Drop outdated Python version checks --- vpython/__init__.py | 16 +--------------- vpython/vpython.py | 7 +------ 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/vpython/__init__.py b/vpython/__init__.py index c09f697a..d8e548f3 100644 --- a/vpython/__init__.py +++ b/vpython/__init__.py @@ -9,21 +9,7 @@ # __gs_version__ exist before importing vpython, which itself imports # both of those. -from ._notebook_helpers import _isnotebook, __is_spyder -import sys -__v = sys.version_info - -# Delete sys now that we are done with it -del sys - -__ispython3 = (__v.major == 3) -__require_notebook = (not __ispython3) or (__v.minor < 5) # Python 2.7 or 3.4 require Jupyter notebook - -if __require_notebook and (not _isnotebook): - s = "The non-notebook version of vpython requires Python 3.5 or later." - s += "\nvpython does work on Python 2.7 and 3.4 in the Jupyter notebook environment." - raise Exception(s) - +from ._notebook_helpers import __is_spyder from .vpython import canvas diff --git a/vpython/vpython.py b/vpython/vpython.py index 4196203f..eded2aaa 100644 --- a/vpython/vpython.py +++ b/vpython/vpython.py @@ -28,13 +28,8 @@ 'standardAttributes', 'text', 'textures', 'triangle', 'vertex', 'wtext', 'winput', 'keysdown'] -__p = platform.python_version() -_ispython3 = (__p[0] == '3') -if _ispython3: - from inspect import signature # Python 3; needed to allow zero arguments in a bound function -else: - from inspect import getargspec # Python 2; needed to allow zero arguments in a bound function +from inspect import signature # Python 3; needed to allow zero arguments in a bound function # __version__ is the version number of the Jupyter VPython installer, generated in building the installer. version = [__version__, 'jupyter']