Closed sransara closed 10 months ago
Solves:
Using environment markers: https://peps.python.org/pep-0508/#environment-markers
Test that it works:
❯ docker run --rm -it python:3.7 sh -c 'pip install git+https://github.com/sransara/ontobio.git@fix-dataclasses-req && python' [... docker & pip installer output removed for brevity ...] Python 3.7.16 (default, Mar 14 2023, 03:47:39) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/usr/local/lib/python37.zip', '/usr/local/lib/python3.7', '/usr/local/lib/python3.7/lib-dynload', '/usr/local/lib/python3.7/site-packages'] >>> # Simulate environment where pip installed site-packages comes before stdlib packages >>> sys.path.reverse() >>> sys.path ['/usr/local/lib/python3.7/site-packages', '/usr/local/lib/python3.7/lib-dynload', '/usr/local/lib/python3.7', '/usr/local/lib/python37.zip', ''] >>> >>> import ontobio >>>
No longer necessary since: https://github.com/biolink/ontobio/commit/34f4300497adc023dcd9b9f42ed9647eb62244ac where required Python version has been upgraded to > Python 3.9
Solves:
Using environment markers: https://peps.python.org/pep-0508/#environment-markers
Test that it works: