Skip to content

Commit

Permalink
Merge pull request #1642 from braingram/update_2p15
Browse files Browse the repository at this point in the history
Update 2.15.x branch
  • Loading branch information
braingram authored Sep 11, 2023
2 parents b144c69 + 4f6ebef commit fa6bd16
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 26 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
2 changes: 1 addition & 1 deletion .github/workflows/s390x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- arch: s390x

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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
8 changes: 8 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -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)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion asdf/_tests/test_array_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down
4 changes: 2 additions & 2 deletions asdf/_tests/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions asdf/asdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
16 changes: 5 additions & 11 deletions asdf/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,18 +343,12 @@ def validate_on_read(self, value):
def __repr__(self):
return (
"<AsdfConfig\n"
" array_inline_threshold: {}\n"
" default_version: {}\n"
" io_block_size: {}\n"
" legacy_fill_schema_defaults: {}\n"
" validate_on_read: {}\n"
f" array_inline_threshold: {self.array_inline_threshold}\n"
f" default_version: {self.default_version}\n"
f" io_block_size: {self.io_block_size}\n"
f" legacy_fill_schema_defaults: {self.legacy_fill_schema_defaults}\n"
f" validate_on_read: {self.validate_on_read}\n"
">"
).format(
self.array_inline_threshold,
self.default_version,
self.io_block_size,
self.legacy_fill_schema_defaults,
self.validate_on_read,
)


Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
14 changes: 13 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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 =
Expand Down

0 comments on commit fa6bd16

Please sign in to comment.