diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index e6a61e0fd..9e949e086 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -17,8 +17,10 @@ jobs: name: Confirm changelog entry runs-on: ubuntu-latest steps: - - name: Check change log entry - uses: scientific-python/action-check-changelogfile@6087eddce1d684b0132be651a4dad97699513113 # 0.2 - env: - CHANGELOG_FILENAME: CHANGES.rst - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Grep for PR number in CHANGES.rst + run: grep -P '\[[^\]]*#${{github.event.number}}[,\]]' CHANGES.rst + if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog-entry-needed') }} diff --git a/.github/workflows/s390x.yml b/.github/workflows/s390x.yml index ac3bb355a..c7795375c 100644 --- a/.github/workflows/s390x.yml +++ b/.github/workflows/s390x.yml @@ -37,7 +37,7 @@ jobs: - arch: s390x steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 submodules: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3b1bb09a1..b77fcb47b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: exclude: "asdf/(extern||_jsonschema)/.*" - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.0.280' + rev: 'v0.0.287' hooks: - id: ruff args: ["--fix"] @@ -54,11 +54,11 @@ repos: - id: black - repo: https://github.com/asottile/blacken-docs - rev: '1.15.0' + rev: '1.16.0' hooks: - id: blacken-docs - repo: https://github.com/abravalheri/validate-pyproject - rev: "v0.13" + rev: "v0.14" hooks: - id: validate-pyproject diff --git a/CHANGES.rst b/CHANGES.rst index 3be69ade9..d3bac7824 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,11 @@ +2.15.2 (unreleased) +------------------- + +The ASDF Standard is at v1.6.0 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Add support for python 3.12 [#1641] + 2.15.1 (2023-08-07) ------------------- diff --git a/asdf/_tests/test_array_blocks.py b/asdf/_tests/test_array_blocks.py index c96eebc74..0bc37ca8c 100644 --- a/asdf/_tests/test_array_blocks.py +++ b/asdf/_tests/test_array_blocks.py @@ -445,7 +445,7 @@ def test_checksum(tmp_path): ff.write_to(path) with asdf.open(path, validate_checksums=True) as ff: - assert type(ff._blocks._internal_blocks[0].checksum) == bytes + assert isinstance(ff._blocks._internal_blocks[0].checksum, bytes) assert ff._blocks._internal_blocks[0].checksum == b"\xcaM\\\xb8t_L|\x00\n+\x01\xf1\xcfP1" diff --git a/asdf/_tests/test_info.py b/asdf/_tests/test_info.py index 8c50d2806..932db9107 100644 --- a/asdf/_tests/test_info.py +++ b/asdf/_tests/test_info.py @@ -78,12 +78,12 @@ def __init__(self, clown="", the_meaning=0, anyof=None, allof=None, oneof=None, self.patt = {} for key in kw: if re.search("^S_", key): - if type(kw[key]) != str: + if not isinstance(kw[key], str): msg = "S_ pattern object must be a string" raise ValueError(msg) self.patt[key] = kw[key] if re.search("^I_", key): - if type(kw[key]) != int: + if not isinstance(kw[key], int): msg = "I_ pattern object must be an int" raise ValueError(msg) self.patt[key] = kw[key] diff --git a/asdf/asdf.py b/asdf/asdf.py index 4a485972b..3e8644870 100644 --- a/asdf/asdf.py +++ b/asdf/asdf.py @@ -1590,8 +1590,8 @@ def add_history_entry(self, description, software=None): elif software is not None: software = Software(software) - time_ = datetime.datetime.utcfromtimestamp( - int(os.environ.get("SOURCE_DATE_EPOCH", time.time())), + time_ = datetime.datetime.fromtimestamp( + int(os.environ.get("SOURCE_DATE_EPOCH", time.time())), datetime.timezone.utc ) entry = HistoryEntry( diff --git a/asdf/config.py b/asdf/config.py index bd0dc8407..6284d544b 100644 --- a/asdf/config.py +++ b/asdf/config.py @@ -343,18 +343,12 @@ def validate_on_read(self, value): def __repr__(self): return ( "" - ).format( - self.array_inline_threshold, - self.default_version, - self.io_block_size, - self.legacy_fill_schema_defaults, - self.validate_on_read, ) diff --git a/pyproject.toml b/pyproject.toml index 9ae6eaf98..dd9969700 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ classifiers = [ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ] dynamic = [ 'version', diff --git a/tox.ini b/tox.ini index 02f2ff29d..e6f6373dd 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,17 @@ [tox] -env_list = py{39,310}{,-compatibility,-coverage}{,-parallel} +env_list = + compatibility + coverage + py{39,310,311}{,-compatibility,-coverage,-jsonschema}{,-parallel} + asdf{-standard,-transform-schemas,-unit-schemas,-wcs-schemas,-coordinates-schemas,-astropy} + gwcs + jwst + stdatamodels + stpipe + roman_datamodels + weldx + sunpy + dkist [testenv] set_env =