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

DIG-1144: Update to Python 3.12 #47

Merged
merged 4 commits into from
Dec 19, 2023
Merged

DIG-1144: Update to Python 3.12 #47

merged 4 commits into from
Dec 19, 2023

Conversation

daisieh
Copy link
Member

@daisieh daisieh commented Dec 19, 2023

While I'm updating packages, these should be updated as well. You can install and test locally by:

cd clinical_ETL_code
pip install build
python -m build
pip install -e .
pytest

@daisieh daisieh requested a review from mshadbolt December 19, 2023 05:25
@daisieh daisieh changed the title Package updates DIG-1144: Update to Python 3.12 Dec 19, 2023
@mshadbolt
Copy link
Contributor

Seems to be a problem with the tests for me:

========================================================================= test session starts ==========================================================================
platform darwin -- Python 3.11.5, pytest-7.4.0, pluggy-1.0.0
rootdir: /Users/marionshadbolt/Documents/GitHub/clinical_ETL_code
plugins: anyio-3.5.0
collected 0 items / 1 error                                                                                                                                            

================================================================================ ERRORS ================================================================================
______________________________________________________________ ERROR collecting tests/test_data_ingest.py ______________________________________________________________
ImportError while importing test module '/Users/marionshadbolt/Documents/GitHub/clinical_ETL_code/tests/test_data_ingest.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/homebrew/anaconda3/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_data_ingest.py:3: in <module>
    from clinical_etl import CSVConvert
E   ModuleNotFoundError: No module named 'clinical_etl'
======================================================================= short test summary info ========================================================================
ERROR tests/test_data_ingest.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=========================================================================== 1 error in 0.15s ===========================================================================
(venv) marionshadbolt@Marions-Air clinical_ETL_code % ls
LICENSE                 _local                  mapping_functions.md    pyproject.toml          sample_inputs           tests                   venv
README.md               dist                    moh_template.csv        requirements.txt        src                     update_moh_template.sh
(venv) marionshadbolt@Marions-Air clinical_ETL_code % python --version
Python 3.12.1

@mshadbolt
Copy link
Contributor

actually looking at this error message maybe there is something weird going on with my conda, not sure if it is using 3.11 or 3.12

@mshadbolt
Copy link
Contributor

ok running with the right python version:

(venv) marionshadbolt@Marions-Air clinical_ETL_code % python3.12 -m pytest
========================================================================= test session starts ==========================================================================
platform darwin -- Python 3.12.1, pytest-7.4.3, pluggy-1.3.0
rootdir: /Users/marionshadbolt/Documents/GitHub/clinical_ETL_code
collected 6 items                                                                                                                                                      

tests/test_data_ingest.py ......                                                                                                                                 [100%]

=========================================================================== warnings summary ===========================================================================
venv/lib/python3.12/site-packages/dateutil/tz/tz.py:37
  /Users/marionshadbolt/Documents/GitHub/clinical_ETL_code/venv/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)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
==================================================================== 6 passed, 1 warning in 13.44s =====================================================================

Should we update the datetime.datetime now to avoid having to do it when it gets deprecated

Copy link
Contributor

@mshadbolt mshadbolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed, approving for now, we can think about the update another time

@daisieh daisieh merged commit f23bd22 into develop Dec 19, 2023
@daisieh daisieh deleted the daisieh/updates branch December 19, 2023 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants