From 19db8589c2a560c9dfcf93738629f0f3d965e4ca Mon Sep 17 00:00:00 2001 From: DanPuzzuoli Date: Wed, 14 Feb 2024 12:53:06 -0800 Subject: [PATCH 01/11] dropping 3.8 and adding 3.12 --- .github/workflows/main.yml | 10 +++++----- pyproject.toml | 2 +- requirements-dev.txt | 6 +++--- setup.py | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3cfab32..91c1549 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11', '3.12'] os: ["ubuntu-latest", "macOS-latest", "windows-latest"] steps: - uses: actions/checkout@v2 @@ -36,10 +36,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up Python 3.8 + - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.10 - name: Pip cache uses: actions/cache@v2 with: @@ -60,10 +60,10 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Set up Python 3.8 + - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.10 - name: Pip cache uses: actions/cache@v2 with: diff --git a/pyproject.toml b/pyproject.toml index f9728a2..c38b9a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,4 +4,4 @@ build-backend = "setuptools.build_meta" [tool.black] line-length = 100 -target-version = ['py38', 'py39', 'py310', 'py311'] +target-version = ['py39', 'py310', 'py311', 'py312'] diff --git a/requirements-dev.txt b/requirements-dev.txt index 81f6af3..abcbc79 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ -black~=22.0 +astroid==2.14.2 +pylint==2.16.2 +black~=24.1 stestr>=3.0.0 -astroid==2.9.3 -pylint==2.12.2 qiskit-sphinx-theme~=1.16.0rc1 sphinx-autodoc-typehints jupyter-sphinx diff --git a/setup.py b/setup.py index c7d2fba..e902f14 100755 --- a/setup.py +++ b/setup.py @@ -51,17 +51,17 @@ "Operating System :: MacOS", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering", ], keywords="array dispatcher qiskit numpy jax tensorflow", packages=find_packages(exclude=['test*']), install_requires=REQUIREMENTS, include_package_data=True, - python_requires=">=3.7", + python_requires=">=3.9", project_urls={ "Bug Tracker": "https://github.com/Qiskit/arraylias/issues", "Documentation": "https://qiskit.org/documentation/", From 947092a0f7248e1e8a0976d2ed535f9a0c6e2325 Mon Sep 17 00:00:00 2001 From: DanPuzzuoli Date: Wed, 14 Feb 2024 13:03:07 -0800 Subject: [PATCH 02/11] adding release note --- releasenotes/notes/drop-3.8-add-3.12-2f80020044cc4c6f.yaml | 4 ++++ tox.ini | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/drop-3.8-add-3.12-2f80020044cc4c6f.yaml diff --git a/releasenotes/notes/drop-3.8-add-3.12-2f80020044cc4c6f.yaml b/releasenotes/notes/drop-3.8-add-3.12-2f80020044cc4c6f.yaml new file mode 100644 index 0000000..3f9db60 --- /dev/null +++ b/releasenotes/notes/drop-3.8-add-3.12-2f80020044cc4c6f.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + Support for Python 3.12 has been added, and 3.8 has been dropped. diff --git a/tox.ini b/tox.ini index d6ec4a5..00acf9b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.3.0 -envlist = py38,py39,py310,py311,lint +envlist = py39,py310,py311,py312,lint isolated_build = true [testenv] From ddf4fe9044effb5c66bc05dabfa618bb1bf99354 Mon Sep 17 00:00:00 2001 From: DanPuzzuoli Date: Wed, 14 Feb 2024 13:10:42 -0800 Subject: [PATCH 03/11] removing unused options --- .pylintrc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.pylintrc b/.pylintrc index c07480c..542e117 100644 --- a/.pylintrc +++ b/.pylintrc @@ -57,8 +57,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=no-self-use, # disabled as it is too verbose - fixme, # disabled as TODOs would show up as warnings +disable=fixme, # disabled as TODOs would show up as warnings protected-access, # disabled as we don't follow the public vs private # convention strictly duplicate-code, # disabled as it is too verbose @@ -70,8 +69,7 @@ disable=no-self-use, # disabled as it is too verbose unnecessary-pass, # allow for methods with just "pass", for clarity no-else-return, # relax "elif" after a clause with a return docstring-first-line-empty, # relax docstring style - import-outside-toplevel, - bad-continuation, bad-whitespace # differences of opinion with black + import-outside-toplevel From 497cedf52b5e59c5a559d0b6af90d4e61608bb64 Mon Sep 17 00:00:00 2001 From: DanPuzzuoli Date: Wed, 14 Feb 2024 15:25:03 -0800 Subject: [PATCH 04/11] fixing pylint settings --- .pylintrc | 79 -------------------------------- test/alias/test_register_type.py | 2 +- 2 files changed, 1 insertion(+), 80 deletions(-) diff --git a/.pylintrc b/.pylintrc index 542e117..f7e0d58 100644 --- a/.pylintrc +++ b/.pylintrc @@ -80,12 +80,6 @@ disable=fixme, # disabled as TODOs would show up as warnings # mypackage.mymodule.MyReporterClass. output-format=text -# Put messages in a separate file for each module / package specified on the -# command line instead of printing them on stdout. Reports (if any) will be -# written in a file name "pylint_global.[txt|html]". This option is deprecated -# and it will be removed in Pylint 2.0. -files-output=no - # Tells whether to display a full report or only the messages reports=yes @@ -131,66 +125,6 @@ include-naming-hint=no # to this list to register other decorators that produce valid properties. property-classes=abc.abstractproperty -# Regular expression matching correct module names -module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - -# Naming hint for module names -module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - -# Regular expression matching correct constant names -const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ - -# Naming hint for constant names -const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ - -# Regular expression matching correct class names -class-rgx=[A-Z_][a-zA-Z0-9]+$ - -# Naming hint for class names -class-name-hint=[A-Z_][a-zA-Z0-9]+$ - -# Regular expression matching correct function names -function-rgx=[a-z_][a-z0-9_]{2,30}$ - -# Naming hint for function names -function-name-hint=[a-z_][a-z0-9_]{2,30}$ - -# Regular expression matching correct method names -method-rgx=(([a-z_][a-z0-9_]{2,49})|(assert[A-Z][a-zA-Z0-9]{2,43})|(test_[_a-zA-Z0-9]{2,}))$ - -# Naming hint for method names -method-name-hint=[a-z_][a-z0-9_]{2,30}$ or camelCase `assert*` in tests. - -# Regular expression matching correct attribute names -attr-rgx=[a-z_][a-z0-9_]{2,30}$ - -# Naming hint for attribute names -attr-name-hint=[a-z_][a-z0-9_]{2,30}$ - -# Regular expression matching correct argument names -argument-rgx=[a-z_][a-z0-9_]{2,30}|ax|dt$ - -# Naming hint for argument names -argument-name-hint=[a-z_][a-z0-9_]{2,30}$ - -# Regular expression matching correct variable names -variable-rgx=[a-z_][a-z0-9_]{2,30}$ - -# Naming hint for variable names -variable-name-hint=[a-z_][a-z0-9_]{2,30}$ - -# Regular expression matching correct class attribute names -class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ - -# Naming hint for class attribute names -class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ - -# Regular expression matching correct inline iteration names -inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ - -# Naming hint for inline iteration names -inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ - # Regular expression which should only match function or class names that do # not require a docstring. no-docstring-rgx=^_ @@ -218,12 +152,6 @@ ignore-long-lines=^\s*(# )??$ # else. single-line-if-stmt=no -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma,dict-separator - # Maximum number of lines in a module max-module-lines=1000 @@ -414,10 +342,3 @@ known-third-party=enchant # 3 compatible code, which means that the block might have code that exists # only in one or another interpreter, leading to false positives when analysed. analyse-fallback-blocks=no - - -[EXCEPTIONS] - -# Exceptions that will emit a warning when being caught. Defaults to -# "Exception" -overgeneral-exceptions=Exception diff --git a/test/alias/test_register_type.py b/test/alias/test_register_type.py index c04f559..3808bb2 100644 --- a/test/alias/test_register_type.py +++ b/test/alias/test_register_type.py @@ -132,7 +132,7 @@ def test_infer_lib_allow_sequence_nested(self): self.assertEqual(alias.infer_libs(tuple(nested)), ("int_lib",)) self.assertEqual(alias.infer_libs(tuple(nested), allow_sequence=False), tuple()) - def test_register_type__AUTOLIB(self): + def test_register_type_autolib(self): """Test automatic inference of lib from base module name""" alias = Alias() alias.register_type(complex) From f86423b12ec1bd98004edab4fa8522053ca722f6 Mon Sep 17 00:00:00 2001 From: DanPuzzuoli Date: Wed, 14 Feb 2024 15:28:14 -0800 Subject: [PATCH 05/11] fixign python version --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91c1549..aedbe9f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,7 +39,7 @@ jobs: - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.10 + python-version: '3.10' - name: Pip cache uses: actions/cache@v2 with: @@ -63,7 +63,7 @@ jobs: - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.10 + python-version: '3.10' - name: Pip cache uses: actions/cache@v2 with: From 81f2b4dca85c34d8ab3d76ed074593e7006a4d8f Mon Sep 17 00:00:00 2001 From: DanPuzzuoli Date: Wed, 14 Feb 2024 15:30:38 -0800 Subject: [PATCH 06/11] fixing errant test --- test/default_alias/test_default_alias.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/default_alias/test_default_alias.py b/test/default_alias/test_default_alias.py index db247a1..a44cd26 100644 --- a/test/default_alias/test_default_alias.py +++ b/test/default_alias/test_default_alias.py @@ -163,8 +163,8 @@ def test_eigh(self): """ w_usp, v_usp = usp.linalg.eigh(self.arr_2d) w, v = scipy.linalg.eigh(self.arr_2d) - self.assertTrue(usp.allclose(w, w_usp)) - self.assertTrue(usp.allclose(v, v_usp)) + self.assertTrue(unp.allclose(w, w_usp)) + self.assertTrue(unp.allclose(v, v_usp)) class TestJaxScipyAlias(JaxBase, TestScipyAlias): From fccb5ff6107d7135c74432e2342eb854a10d7e33 Mon Sep 17 00:00:00 2001 From: DanPuzzuoli Date: Wed, 14 Feb 2024 16:09:08 -0800 Subject: [PATCH 07/11] bounding tensorflow version --- requirements-dev.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index abcbc79..3e51fe2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -20,5 +20,5 @@ jax; sys_platform == 'darwin' or sys_platform == 'linux' jaxlib; sys_platform == 'darwin' or sys_platform == 'linux' # Tensorflow does not yet have a 3.11 version -tensorflow; (sys_platform != 'darwin' or platform_machine != 'arm64') and python_version<'3.11' -tensorflow-macos; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version<'3.11' \ No newline at end of file +tensorflow<2.15; (sys_platform != 'darwin' or platform_machine != 'arm64') and python_version<'3.11' +tensorflow-macos<2.15; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version<'3.11' \ No newline at end of file From 76eb0ea0fa1dfec2b52edc8f4731678a935c3c4d Mon Sep 17 00:00:00 2001 From: DanPuzzuoli Date: Wed, 14 Feb 2024 16:12:38 -0800 Subject: [PATCH 08/11] reverting tensorflow bound --- requirements-dev.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 3e51fe2..abcbc79 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -20,5 +20,5 @@ jax; sys_platform == 'darwin' or sys_platform == 'linux' jaxlib; sys_platform == 'darwin' or sys_platform == 'linux' # Tensorflow does not yet have a 3.11 version -tensorflow<2.15; (sys_platform != 'darwin' or platform_machine != 'arm64') and python_version<'3.11' -tensorflow-macos<2.15; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version<'3.11' \ No newline at end of file +tensorflow; (sys_platform != 'darwin' or platform_machine != 'arm64') and python_version<'3.11' +tensorflow-macos; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version<'3.11' \ No newline at end of file From f25f2f6cbdf98928b73a5b523ce7a9c1a6dca880 Mon Sep 17 00:00:00 2001 From: DanPuzzuoli Date: Wed, 14 Feb 2024 16:15:20 -0800 Subject: [PATCH 09/11] restricting to tensorflow-cpu --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index abcbc79..e1a54e4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -20,5 +20,5 @@ jax; sys_platform == 'darwin' or sys_platform == 'linux' jaxlib; sys_platform == 'darwin' or sys_platform == 'linux' # Tensorflow does not yet have a 3.11 version -tensorflow; (sys_platform != 'darwin' or platform_machine != 'arm64') and python_version<'3.11' +tensorflow-cpu; (sys_platform != 'darwin' or platform_machine != 'arm64') and python_version<'3.11' tensorflow-macos; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version<'3.11' \ No newline at end of file From 83b6d266584b5170fca20c050a13e3dba4db81b0 Mon Sep 17 00:00:00 2001 From: to24toro Date: Sun, 18 Feb 2024 12:07:09 +0900 Subject: [PATCH 10/11] upgrade some yml files from 3.8 to 3.9 --- .github/workflows/docs.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 952d4f4..35da8c2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.9' - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2891ca4..20792f5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/setup-python@v4 name: Install Python with: - python-version: '3.8' + python-version: '3.9' - name: Install Deps run: pip install -U wheel - name: Build Artifacts From 50f5a426df84059c10ee2ea070dd7f94772f56f5 Mon Sep 17 00:00:00 2001 From: DanPuzzuoli Date: Tue, 20 Feb 2024 07:46:33 -0800 Subject: [PATCH 11/11] updating strict bound on tensorflow to 3.12 --- requirements-dev.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e1a54e4..a3ea4c9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -19,6 +19,6 @@ matplotlib>=3.3.0 jax; sys_platform == 'darwin' or sys_platform == 'linux' jaxlib; sys_platform == 'darwin' or sys_platform == 'linux' -# Tensorflow does not yet have a 3.11 version -tensorflow-cpu; (sys_platform != 'darwin' or platform_machine != 'arm64') and python_version<'3.11' -tensorflow-macos; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version<'3.11' \ No newline at end of file +# Tensorflow does not yet have a 3.12 version +tensorflow-cpu; (sys_platform != 'darwin' or platform_machine != 'arm64') and python_version<'3.12' +tensorflow-macos; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version<'3.12' \ No newline at end of file