From e723f056817f794019ad031c4100eb3f026bd4e2 Mon Sep 17 00:00:00 2001 From: Wenjie Du Date: Sun, 26 Nov 2023 00:04:12 +0800 Subject: [PATCH] Testing with Python 3.11 and support it (#246) * feat: support Python 3.11 and update docs; --- .github/workflows/testing_ci.yml | 22 ++++++++++------------ README.md | 2 +- docs/faq.rst | 17 +++++------------ docs/index.rst | 2 +- docs/install.rst | 9 +++++++-- 5 files changed, 24 insertions(+), 28 deletions(-) diff --git a/.github/workflows/testing_ci.yml b/.github/workflows/testing_ci.yml index fb63ca0a..141dcd18 100644 --- a/.github/workflows/testing_ci.yml +++ b/.github/workflows/testing_ci.yml @@ -20,45 +20,43 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macOS-latest] - python-version: ["3.7", "3.10"] - torch-version: ["1.13.1"] + python-version: ["3.7", "3.10", "3.11"] steps: - name: Check out the repo code uses: actions/checkout@v3 - - name: Determine the Python version + - name: Determine the PyTorch version uses: haya14busa/action-cond@v1 - id: condval + id: determine_pytorch_ver with: - cond: ${{ matrix.python-version == 3.7 && matrix.os == 'macOS-latest' }} - # Note: the latest 3.7 subversion 3.7.17 for MacOS has "ModuleNotFoundError: No module named '_bz2'" - if_true: "3.7.16" - if_false: ${{ matrix.python-version }} + cond: ${{ matrix.python-version == 3.7 }} + if_true: "1.13.1" + if_false: "2.1.0" - name: Set up Python uses: actions/setup-python@v4 with: - python-version: ${{ steps.condval.outputs.value }} + python-version: ${{ matrix.python-version }} check-latest: true cache: pip cache-dependency-path: | setup.cfg - - name: Install PyTorch ${{ matrix.torch-version }}+cpu + - name: Install PyTorch ${{ steps.determine_pytorch_ver.outputs.value }}+cpu # we have to install torch in advance because torch_sparse needs it for compilation, # refer to https://github.com/rusty1s/pytorch_sparse/issues/156#issuecomment-1304869772 for details run: | which python which pip pip install --upgrade pip - pip install torch==${{ matrix.torch-version }} -f https://download.pytorch.org/whl/cpu + pip install torch==${{ steps.determine_pytorch_ver.outputs.value }} -f https://download.pytorch.org/whl/cpu python -c "import torch; print('PyTorch:', torch.__version__)" - name: Install other dependencies run: | pip install -r requirements.txt - pip install torch-geometric==2.3.1 torch-scatter==2.1.1 torch-sparse==0.6.17 -f "https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html" + pip install torch-geometric torch-scatter torch-sparse -f "https://data.pyg.org/whl/torch-${{ steps.determine_pytorch_ver.outputs.value }}+cpu.html" pip install pypots[dev] - name: Fetch the test environment details diff --git a/README.md b/README.md index 10818fd8..282b2daf 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@

- Python version + Python version powered by Pytorch diff --git a/docs/faq.rst b/docs/faq.rst index e506c817..0a0e6e54 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -14,11 +14,11 @@ Note this exception only applies if you commit to the maintenance of your model Join PyPOTS ^^^^^^^^^^^ -.. _becoming-a-maintainer: +.. _becoming-a-volunteer: -Becoming a Maintainer -""""""""""""""""""""" -To join the team and become a maintainer of PyPOTS, you should +Becoming a Volunteer Developer +"""""""""""""""""""""""""""""" +To become a member of PyPOTS volunteer development team, you should 1. love open-source science and be active on GitHub; 2. be familiar with the PyPOTS codebase and have made at least one pull request merged into branch ``main`` of PyPOTS, @@ -28,21 +28,14 @@ To join the team and become a maintainer of PyPOTS, you should and become a member of the channel ``#dev-team``. ``#dev-team`` currently is a public channel, and you don't need an invitation to join it; 5. commit to constantly maintain PyPOTS project and obey our development principles; -After meeting up with the above conditions, -you can propose to get a maintainer role by dropping an email to `team@pypots.com `_. -We will review your request and reply to you as soon as possible. Once you obtain the role, you'll be listed as a member on the ``About Us`` pages of `PyPOTS main site `_ and `PyPOTS docs site `_. -**NOTE**: The maintainer role is not permanent. The role is called "maintainer" because it actively maintains the project. -You can take a leave of absence from the role with notice at any time. -But if you're inactive for a long time (more than three months. With reasons, a longer period is allowed for sure), your role may be deactivated. - Becoming a Lead """"""""""""""" -To become a lead at PyPOTS, surely you have to already obtain a maintainer role first, i.e. you've met all requirements in the section :ref:`becoming-a-maintainer`. +To become a lead at PyPOTS, surely you have to already be a volunteer developer first, i.e. you've met all requirements in the section :ref:`becoming-a-volunteer`. Your research should be highly related to data mining/machine learning on POTS data, and you need to prove that you're capable of proposing a research plan solely and conducting it. You're willing to take developing PyPOTS as your responsibility and commit to constantly and regularly diff --git a/docs/index.rst b/docs/index.rst index 595e2250..7655c44d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -12,7 +12,7 @@ Welcome to PyPOTS docs! **A Python Toolbox for Data Mining on Partially-Observed Time Series** -.. image:: https://img.shields.io/badge/Python-v3.7--3.10-E97040?logo=python&logoColor=white +.. image:: https://img.shields.io/badge/Python-v3.7--3.11-E97040?logo=python&logoColor=white :alt: Python version :target: https://docs.pypots.com/en/latest/install.html#reasons-of-version-limitations-on-dependencies diff --git a/docs/install.rst b/docs/install.rst index 5d0ba779..f62032fe 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -25,7 +25,7 @@ Alternatively, you can install from the latest source code which may be not offi Required Dependencies """"""""""""""""""""" -* Python >=3.7, <=3.10 +* Python >=3.7, <=3.11 * numpy * scipy * scikit-learn @@ -49,9 +49,14 @@ Reasons of Version Limitations on Dependencies * **Why we need python >=3.7?** Python v3.6 and before versions have no longer been supported officially (check out `status of Python versions here `_). -Besides, PyG (torch-geometric) is available starting from Python v3.7, please refer to https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html#installation-via-anaconda. +Besides, PyG (torch-geometric) is available for Python v3.7 to v3.11 (refer to https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html#installation-via-anaconda ), +and this is also why we need Python version to be lower than 3.12 so far. Although torch-geometric is an optional dependency, we hope things go smoothly when our users opt to install it. +In addition, note that Python v.3.7 has also been in the end-of-life status since 2023-06-27. +Hence, we will raise the minimum support Python version to v3.8 in the future. +Please use Python v3.8 or above if possible also for the security of your development environment. + * **Why we need pandas <2.0.0?** Because v2 may cause ``ModuleNotFoundError: No module named 'pandas.core.indexes.numeric'``,