Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: datetime giving warning when using Python 3.12.0 #212

Closed
trevorb1 opened this issue Dec 15, 2023 · 0 comments
Closed

[Bug]: datetime giving warning when using Python 3.12.0 #212

trevorb1 opened this issue Dec 15, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@trevorb1
Copy link
Member

The Issue

If I install otoole from a new environment, python 3.12.0 is installed by default. When running tests, the warnings shown below are produced from the datetime module. If I use python 3.11.5, these warnings are not produced.

Expected Behavior

Tests pass without warnings

Steps To Reproduce

  1. Create new conda environment conda create -n otoole
  2. Check python version is 3.12.0 with conda list python
  3. Install otoole via pip install otoole
  4. Install tox via pip install tox
  5. Run tests with tox

Log output

============================================================ warnings summary ============================================================
.tox/default/lib/python3.12/site-packages/dateutil/tz/tz.py:37
  /home/trevorb1/master/otoole/.tox/default/lib/python3.12/site-packages/dateutil/tz/tz.py:37: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    EPOCH = datetime.datetime.utcfromtimestamp(0)

tests/test_convert.py: 7 warnings
tests/test_read_strategies.py: 2 warnings
tests/test_utils.py: 2 warnings
tests/test_write_strategies.py: 1 warning
  /home/trevorb1/master/otoole/.tox/default/lib/python3.12/site-packages/openpyxl/packaging/core.py:99: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    now = datetime.datetime.utcnow()

tests/test_convert.py::TestWrite::test_write_excel
tests/test_write_strategies.py::TestWriteExcel::test_write_out_empty_dataframe
  /home/trevorb1/master/otoole/.tox/default/lib/python3.12/site-packages/openpyxl/writer/excel.py:292: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    workbook.properties.modified = datetime.datetime.utcnow()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

---------- coverage: platform linux, python 3.12.0-final-0 -----------
Coverage HTML written to dir htmlcov

============================================== 209 passed, 1 skipped, 15 warnings in 50.15s ==============================================

Operating System

Linux

What version of otoole are you running?

1.1.2

Possible Solution

No response

Anything else?

Issue was originally flagged in PR #211

@trevorb1 trevorb1 added the bug Something isn't working label Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant