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/main.yml b/.github/workflows/main.yml index 3cfab32..aedbe9f 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/.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 diff --git a/.pylintrc b/.pylintrc index c07480c..f7e0d58 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 @@ -82,12 +80,6 @@ disable=no-self-use, # disabled as it is too verbose # 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 @@ -133,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=^_ @@ -220,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 @@ -416,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/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/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/requirements-dev.txt b/requirements-dev.txt index 81f6af3..a3ea4c9 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 @@ -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; (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 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/", 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) 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): 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]