From 57aaaf7441722d2021733e0fe6f9b4508bf04ccc Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Fri, 29 Sep 2023 12:53:19 -0400 Subject: [PATCH] Backport PR #2473: TST: Python 3.12 --- .github/workflows/ci_workflows.yml | 18 +++++++++--------- CHANGES.rst | 5 +++++ .../aper_phot_simple/aper_phot_simple.py | 4 ++-- pyproject.toml | 1 + tox.ini | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci_workflows.yml b/.github/workflows/ci_workflows.yml index 56bc55c122..05d326bb49 100644 --- a/.github/workflows/ci_workflows.yml +++ b/.github/workflows/ci_workflows.yml @@ -44,10 +44,10 @@ jobs: toxenv: securityaudit allow_failure: false - - name: Python 3.10 with coverage checking, all deps, and remote data + - name: Python 3.11 with coverage checking, all deps, and remote data os: ubuntu-latest - python: '3.10' - toxenv: py310-test-alldeps-cov + python: '3.11' + toxenv: py311-test-alldeps-cov toxposargs: --remote-data allow_failure: false @@ -57,18 +57,18 @@ jobs: toxenv: py39-test allow_failure: false - - name: Windows - Python 3.9 + - name: Windows - Python 3.10 os: windows-latest - python: 3.9 - toxenv: py39-test + python: '3.10' + toxenv: py310-test allow_failure: false # This also runs on cron but we want to make sure new changes # won't break this job at the PR stage. - - name: Python 3.11 with latest dev versions of key dependencies, and remote data + - name: Python 3.12 with latest dev versions of key dependencies, and remote data os: ubuntu-latest - python: '3.11' - toxenv: py311-test-devdeps + python: '3.12-dev' + toxenv: py312-test-devdeps toxposargs: --remote-data --run-slow allow_failure: true diff --git a/CHANGES.rst b/CHANGES.rst index bd172928df..9a60dc27c8 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -24,6 +24,11 @@ Specviz Specviz2d ^^^^^^^^^ +Other Changes and Additions +--------------------------- + +- Compatibility with Python 3.12. [#2473] + 3.7 (2023-09-21) ================ diff --git a/jdaviz/configs/imviz/plugins/aper_phot_simple/aper_phot_simple.py b/jdaviz/configs/imviz/plugins/aper_phot_simple/aper_phot_simple.py index 93bf567b24..7485f716ab 100644 --- a/jdaviz/configs/imviz/plugins/aper_phot_simple/aper_phot_simple.py +++ b/jdaviz/configs/imviz/plugins/aper_phot_simple/aper_phot_simple.py @@ -1,6 +1,6 @@ import os import warnings -from datetime import datetime +from datetime import datetime, timezone import astropy import numpy as np @@ -312,7 +312,7 @@ def vue_do_aper_phot(self, *args, **kwargs): phot_table.add_columns( [xcenter * u.pix, ycenter * u.pix, sky_center, bg, pixarea_fac, sum_ct, sum_ct_err, ctfac, sum_mag, flux_scale, data.label, - reg.meta.get('label', ''), Time(datetime.utcnow())], + reg.meta.get('label', ''), Time(datetime.now(tz=timezone.utc))], names=['xcenter', 'ycenter', 'sky_center', 'background', 'pixarea_tot', 'aperture_sum_counts', 'aperture_sum_counts_err', 'counts_fac', 'aperture_sum_mag', 'flux_scaling', diff --git a/pyproject.toml b/pyproject.toml index 28182f5c3b..dfc708a4cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -137,6 +137,7 @@ filterwarnings = [ "ignore:The unit 'Angstrom' has been deprecated in the VOUnit standard\\. Suggested.* 0\\.1nm\\.", "ignore:specutils uses the deprecated entry point asdf_extensions", "ignore:((.|\n)*)Sentinel is not a public part of the traitlets API((.|\n)*)", + "ignore:datetime\\.datetime\\.utcfromtimestamp:DeprecationWarning", # asdf + dateutil<=2.8.2 + Python 3.12 "ignore::DeprecationWarning:glue", "ignore::DeprecationWarning:bqplot", "ignore::DeprecationWarning:bqplot_image_gl", diff --git a/tox.ini b/tox.ini index 1a49385f36..aab3c7cf6a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{38,39,310,311}-test{,-alldeps,-devdeps,-predeps}{-romandeps}{,-cov} + py{38,39,310,311,312}-test{,-alldeps,-devdeps,-predeps}{-romandeps}{,-cov} linkcheck codestyle pep517