Skip to content

Commit 2ee3083

Browse files
committed
avoid deprecated utcnow
1 parent b6c1446 commit 2ee3083

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.github/workflows/ci_workflows.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ jobs:
4040
- name: Python 3.12 (Windows)
4141
os: windows-latest
4242
python: '3.12'
43-
toxenv: py311-test
43+
toxenv: py312-test
4444

4545
- name: Python 3.10 (MacOS X)
4646
os: macos-latest
4747
python: '3.10'
48-
toxenv: py311-test
48+
toxenv: py310-test
4949

5050
- name: Python 3.10
5151
os: ubuntu-latest
@@ -55,7 +55,7 @@ jobs:
5555
- name: Python 3.10 with oldest supported version of key dependencies
5656
os: ubuntu-22.04
5757
python: '3.10'
58-
toxenv: py38-test-oldestdeps
58+
toxenv: py310-test-oldestdeps
5959

6060
steps:
6161
- name: Checkout code
@@ -66,11 +66,11 @@ jobs:
6666
uses: actions/setup-python@v5
6767
with:
6868
python-version: ${{ matrix.python }}
69-
# - name: Install language-pack-de and tzdata
70-
# if: startsWith(matrix.os, 'ubuntu')
71-
# run: |
72-
# sudo apt-get update
73-
# sudo apt-get install language-pack-de tzdata graphviz
69+
- name: Install language-pack-de and tzdata
70+
if: startsWith(matrix.os, 'ubuntu')
71+
run: |
72+
sudo apt-get update
73+
sudo apt-get install graphviz
7474
- name: Install Python dependencies
7575
run: python -m pip install --upgrade tox
7676
- name: Run tests

pydl/pydlutils/yanny.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ def write(self, newfile=None, comments=None):
865865
"{0} exists, aborting write!".format(newfile))
866866
if comments is None:
867867
basefile = os.path.basename(newfile)
868-
timestamp = datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S UTC')
868+
timestamp = datetime.datetime.now(datetime.UTC).strftime('%Y-%m-%d %H:%M:%S UTC')
869869
comments = f"""#
870870
# {basefile}
871871
#
@@ -947,7 +947,7 @@ def append(self, datatable):
947947
if not isinstance(datatable, dict):
948948
raise ValueError("Data to append is not of the correct type. " +
949949
"Use a dict!")
950-
timestamp = datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S UTC')
950+
timestamp = datetime.datetime.now(datetime.UTC).strftime('%Y-%m-%d %H:%M:%S UTC')
951951
contents = ''
952952
#
953953
# Print any key/value pairs

0 commit comments

Comments
 (0)