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

[python-package] add py312 #50

Merged
merged 12 commits into from
Jul 4, 2024
28 changes: 13 additions & 15 deletions .github/workflows/python-package.macos.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python [3.7,3.8,3.9,3.10,3.11] MacOs
name: Python [3.7,3.8,3.9,3.10,3.11,3.12] MacOs

on:
push:
Expand All @@ -23,7 +23,7 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest]
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
python-version: [3.7, 3.8, 3.9, '3.10', '3.11','3.12']
# Proposed workaround for legacy versions, see
# https://github.com/actions/setup-python/issues/856 and
# https://github.com/actions/runner-images/issues/9770#issuecomment-2085623315
Expand All @@ -44,24 +44,22 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov pytest-xdist
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install package
- name: Install package Python lt 3.12
if: matrix.python-version != '3.12'
run: |
pip install --upgrade pip
pip install --upgrade setuptools
pip install -e .
pip freeze
#- name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
#- name: Test with pytest and coverage MacOs one single thread and ignoring calls to scripts (WIP)
# if: runner.os == 'macOs'
# run: |
# pytest -vs --cov=./ --cov-report=xml --disable-warnings --ignore-glob="test_scripts.py"
# if: runner.os == 'macOs'
- name: Install package Python eq 3.12
if: matrix.python-version == '3.12'
run: |
pip install --upgrade pip
pip install --upgrade setuptools
pip install bezier
pip install mdtraj --use-deprecated=legacy-resolver
pip install -e . --use-deprecated=legacy-resolver
pip freeze
- name: Test with pytest and coverage macos
continue-on-error: true
run: |
Expand Down
30 changes: 14 additions & 16 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python [3.7,3.8,3.9,3.10,3.11] Linux
name: Python [3.7,3.8,3.9,3.10,3.11,3.12] Linux

on:
push:
Expand All @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
python-version: [3.7, 3.8, 3.9, '3.10', '3.11','3.12']

steps:
- uses: actions/checkout@v4
Expand All @@ -32,25 +32,23 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov pytest-xdist
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install package
pip install pytest pytest-cov pytest-xdist
- name: Install package Python lt 3.12
if: matrix.python-version != '3.12'
run: |
pip install --upgrade pip
pip install --upgrade setuptools
pip install -e .
pip freeze
#- name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
#- name: Test with pytest and coverage MacOs one single thread and ignoring calls to scripts (WIP)
# if: runner.os == 'macOs'
# run: |
# pytest -vs --cov=./ --cov-report=xml --disable-warnings --ignore-glob="test_scripts.py"
# if: runner.os == 'macOs'
- name: Install package Python eq 3.12
if: matrix.python-version == '3.12'
run: |
pip install --upgrade pip
pip install --upgrade setuptools
pip install bezier
pip install mdtraj --use-deprecated=legacy-resolver
pip install -e . --use-deprecated=legacy-resolver
pip freeze
- name: Test with pytest and coverage Linux 8 threads
run: |
echo -e '[run]\nomit = *dihedrals.py,*contact_matrix.py' > .coveragerc
Expand Down
23 changes: 22 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,35 @@ Currently, docs are hosted at `<http://proteinformatics.org/mdciao/>`_, but this

System Requirements
===================
``mdciao`` is developed in GNU/Linux, and CI-tested via `github actions <https://github.com/gph82/mdciao/actions?query=workflow%3A%22Python+package%22>`_ for GNU/Linux and MacOs. Tested python versions are:
``mdciao`` is developed in GNU/Linux, and CI-tested via `github actions <https://github.com/gph82/mdciao/actions>`_ for GNU/Linux and MacOs. Tested Python versions are:

* GNU/Linux: 3.7, 3.8, 3.9, 3.10, 3.11
* MacOs: 3.7, 3.8, 3.9, 3.10, 3.11. For Python 3.7, four CI-tests involving `mdtraj.compute_dssp <https://www.mdtraj.org/1.9.8.dev0/api/generated/mdtraj.compute_dssp.html?highlight=dssp#mdtraj.compute_dssp>`_ ,
are skipped because of a hard to repdroduce, random segmentation fault, which apparently wont fix, see here `<https://github.com/mdtraj/mdtraj/issues/1574>`_ and `here <https://github.com/mdtraj/mdtraj/issues/1473>`_.

So everything should work *out of the box* in these conditions.

.. admonition:: Python 3.12 users

If you try to install on Python 3.12, you will get a dependency error, because

* the module ``bezier`` `requires Numpy >= 2.0 for Python 3.12 <https://github.com/dhermes/bezier/releases/tag/2024.6.20>`_, but
* the module ``mdtraj`` `has pinned Numpy <= 2.0 <https://github.com/mdtraj/mdtraj/issues/1873/>`_.

Still, you can install mdciao in Python 3.12 **if you don't mind a somewhat inconsistent environment**:

>>> pip install bezier
>>> pip install mdtraj --use-deprecated=legacy-resolver
>>> pip install mdciao --use-deprecated=legacy-resolver

What we are doing is installing ``bezier`` normally (using ``numpy>=2.0``) and then installing ``mdtraj`` using ``pip``'s legacy resolver, which will install ``numpy-1.26.4`` even if that yields an inconsistent environment. You will get the notification:

>>> ERROR: pip's legacy dependency resolver does not consider dependency conflicts when selecting packages. This behaviour is the source of the following dependency conflicts.
>>> mdtraj 1.10.0 requires numpy<2.0.0a0,>=1.23, but you'll have numpy 2.0.0 which is incompatible.

Since ``mdciao`` installs and passes the CI-tests for Python 3.12 in such an environment, you can use it **at your own risk**. Please report on any issues you might find. Please note that the ``--use-deprecated=legacy-resolver`` option `might not be available in the future <https://pip.pypa.io/en/stable/user_guide/#deprecation-timeline>`_.


Authors
=======
``mdciao`` is written and maintained by Guillermo Pérez-Hernández (`ORCID <http://orcid.org/0000-0002-9287-8704>`_) currently at the `Institute of Medical Physics and Biophysics <https://biophysik.charite.de/ueber_das_institut/team/>`_ in the
Expand Down
22 changes: 21 additions & 1 deletion doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@ We recommend you install ``mdciao`` via the `pip <https://pypi.org/project/pip/>

>>> pip install mdciao

.. admonition:: Python 3.12 users

If you try to install on Python 3.12, you will get a dependency error, because

* the module ``bezier`` `requires Numpy >= 2.0 for Python 3.12 <https://github.com/dhermes/bezier/releases/tag/2024.6.20>`_, but
* the module ``mdtraj`` `has pinned Numpy <= 2.0 <https://github.com/mdtraj/mdtraj/issues/1873/>`_.

Still, you can install mdciao in Python 3.12 **if you don't mind a somewhat inconsistent environment**:

>>> pip install bezier
>>> pip install mdtraj --use-deprecated=legacy-resolver
>>> pip install mdciao --use-deprecated=legacy-resolver

What we are doing is installing ``bezier`` normally (using ``numpy>=2.0``) and then installing ``mdtraj`` using ``pip``'s legacy resolver, which will install ``numpy-1.26.4`` even if that yields an inconsistent environment. You will get the notification:

>>> ERROR: pip's legacy dependency resolver does not consider dependency conflicts when selecting packages. This behaviour is the source of the following dependency conflicts.
>>> mdtraj 1.10.0 requires numpy<2.0.0a0,>=1.23, but you'll have numpy 2.0.0 which is incompatible.

Since ``mdciao`` installs and passes the CI-tests for Python 3.12 in such an environment, you can use it **at your own risk**. Please report on any issues you might find. Please note that the ``--use-deprecated=legacy-resolver`` option `might not be available in the future <https://pip.pypa.io/en/stable/user_guide/#deprecation-timeline>`_.

Getting started
~~~~~~~~~~~~~~~
For the impatient, you can directly issue afterwards::
Expand Down Expand Up @@ -98,7 +118,7 @@ Installation from source

Operating systems and Python versions
-------------------------------------
``mdciao`` is developed in GNU/Linux, and CI-tested via `github actions <https://github.com/gph82/mdciao/actions?query=workflow%3A%22Python+package%22>`_ for GNU/Linux and MacOs. Tested python versions are:
``mdciao`` is developed in GNU/Linux, and CI-tested via `github actions <https://github.com/gph82/mdciao/actions>`_ for GNU/Linux and MacOs. Tested python versions are:

* GNU/Linux: 3.7, 3.8, 3.9, 3.10, 3.11
* MacOs: 3.7, 3.8, 3.9, 3.10, 3.11. For Python 3.7, four CI-tests involving `mdtraj.compute_dssp <https://www.mdtraj.org/1.9.8.dev0/api/generated/mdtraj.compute_dssp.html?highlight=dssp#mdtraj.compute_dssp>`_ ,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ classifiers = [ "Development Status :: 4 - Beta",
requires-python = ">=3.6"
dependencies = [ "cython",
"numpy>=1.18.1",
"bezier",
"mdtraj>=1.9.8",
"astunparse; python_version!='3.8'",
"astunparse<1.6.3; python_version=='3.8'",
Expand All @@ -36,7 +37,6 @@ dependencies = [ "cython",
"tqdm",
"ipywidgets",
"natsort",
"bezier",
"mpl_chord_diagram>=0.3.2",
"docstring_parser",
]
Expand Down
Loading