From 489999acd8e6bb13f1504d5ce63307a167b30d90 Mon Sep 17 00:00:00 2001 From: Guilherme Date: Fri, 26 May 2023 03:41:44 +0200 Subject: [PATCH 1/6] MAINT: dropping support for python 3.7 --- .github/workflows/publish-to-pypi.yml | 33 ++++++++++++------------ .github/workflows/test_pytest.yaml | 36 +++++++++++++-------------- docs/user/requirements.rst | 4 +-- requirements.txt | 4 +-- setup.py | 20 +++++---------- 5 files changed, 44 insertions(+), 53 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index e35ef8fd0..ae86b24e2 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -12,23 +12,22 @@ permissions: jobs: deploy: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.7' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build - - name: Build package - run: python -m build - - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.8" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/test_pytest.yaml b/.github/workflows/test_pytest.yaml index ebd84b465..2fb7bf6e6 100644 --- a/.github/workflows/test_pytest.yaml +++ b/.github/workflows/test_pytest.yaml @@ -12,23 +12,23 @@ jobs: - macos-latest - windows-latest python-version: - - 3.7 + - 3.8 - 3.11 steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements_test.txt - - name: Build RocketPy - run: | - pip install -e . - - name: Test with pytest - run: | - pytest - cd rocketpy - pytest --doctest-modules \ No newline at end of file + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements_test.txt + - name: Build RocketPy + run: | + pip install -e . + - name: Test with pytest + run: | + pytest + cd rocketpy + pytest --doctest-modules diff --git a/docs/user/requirements.rst b/docs/user/requirements.rst index a6a5c07ef..238fa5fa4 100644 --- a/docs/user/requirements.rst +++ b/docs/user/requirements.rst @@ -7,7 +7,7 @@ But read further if this is not your case! Python Version -------------- -RocketPy supports Python 3.7 and above. +RocketPy supports Python 3.8 and above. Sorry, there are currently no plans to support earlier versions. If you really need to run RocketPy on Python 3.6 or earlier, feel free to submit an issue and we will see what we can do! @@ -20,7 +20,7 @@ The following packages are needed in order to run RocketPy: - Numpy >= 1.0 - Scipy >= 1.0 - Matplotlib >= 3.0 -- netCDF4 >= 1.4, < 1.6 for Python 3.7+, netCDF4 >= 1.6.2 for Python 3.11 +- netCDF4 >= 1.4, < 1.6 for Python 3.8+, netCDF4 >= 1.6.2 for Python 3.11 - windrose >= 1.6.8 - requests - pytz diff --git a/requirements.txt b/requirements.txt index 96c685ec3..4e3e8a44c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ numpy>=1.0 scipy>=1.0 matplotlib>=3.0 -netCDF4>=1.4,<1.6; python_version == "3.7" -netCDF4>=1.6.2; python_version != "3.7" +netCDF4>=1.4,<1.6; python_version < "3.11" +netCDF4>=1.6.2; python_version >= "3.11" windrose>=1.6.8 ipywidgets>=7.6.3 requests diff --git a/setup.py b/setup.py index 591ae3447..ae757d196 100644 --- a/setup.py +++ b/setup.py @@ -7,21 +7,13 @@ # Manage different netCDF4 versions depending on system version and Google Colab netCDF4_requirement = "netCDF4>=1.6.2" -if sys.version_info[1] == 7: - # Support for Python 3.7 - netCDF4_requirement = "netCDF4>=1.4,<1.6" # Check if running on a linux system -elif sys.platform == "linux": - if sys.version_info[1] < 11: - # Support for Linux with Python < 3.11 - # Avoid problems due to netcdf4 issue linked below - netCDF4_requirement = "netCDF4>=1.4,<1.6" - else: - # Support for Linux with Python >= 3.11 - # Might have problems with openDAP in the Environment class due to - # https://github.com/Unidata/netcdf4-python/issues/1179 - netCDF4_requirement = "netCDF4>=1.6.2" +if sys.platform == "linux" and sys.version_info[1] < 11: + # Support for Linux with Python < 3.11 + # Avoid problems due to netCDF4 issue linked below + # https://github.com/Unidata/netcdf4-python/issues/1179 + netCDF4_requirement = "netCDF4>=1.4,<1.6" setuptools.setup( name="rocketpy", @@ -54,5 +46,5 @@ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], - python_requires=">=3.7", + python_requires=">=3.8", ) From 394877a349e79fa408f982cdf613442e416c0747 Mon Sep 17 00:00:00 2001 From: Guilherme Date: Fri, 9 Jun 2023 18:30:35 +0200 Subject: [PATCH 2/6] DOCS: adapt requirements files --- docs/user/requirements.rst | 2 +- requirements.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/user/requirements.rst b/docs/user/requirements.rst index 238fa5fa4..85b1a725c 100644 --- a/docs/user/requirements.rst +++ b/docs/user/requirements.rst @@ -20,7 +20,7 @@ The following packages are needed in order to run RocketPy: - Numpy >= 1.0 - Scipy >= 1.0 - Matplotlib >= 3.0 -- netCDF4 >= 1.4, < 1.6 for Python 3.8+, netCDF4 >= 1.6.2 for Python 3.11 +- netCDF4 >= 1.6.2 for Windows, MacOS or Python < '3.11'; netCDF4 >=1.4,<1.6 for Python 3.11+ in Linux - windrose >= 1.6.8 - requests - pytz diff --git a/requirements.txt b/requirements.txt index 4e3e8a44c..21864782a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ numpy>=1.0 scipy>=1.0 matplotlib>=3.0 -netCDF4>=1.4,<1.6; python_version < "3.11" -netCDF4>=1.6.2; python_version >= "3.11" +netCDF4>=1.6.2; sys_platform != 'linux' or python_version < '3.11' +netCDF4>=1.4,<1.6; sys_platform == 'lixux' and python_version >= '3.11' windrose>=1.6.8 ipywidgets>=7.6.3 requests From f0bec6e4988b486686a72404f6950611d54b1b62 Mon Sep 17 00:00:00 2001 From: Guilherme Date: Fri, 9 Jun 2023 18:53:33 +0200 Subject: [PATCH 3/6] MAINT: update netcdf4 requirement to version 1.6.4 --- docs/user/requirements.rst | 6 +++--- requirements.txt | 3 +-- setup.py | 14 +------------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/docs/user/requirements.rst b/docs/user/requirements.rst index 85b1a725c..46760c3f6 100644 --- a/docs/user/requirements.rst +++ b/docs/user/requirements.rst @@ -20,7 +20,7 @@ The following packages are needed in order to run RocketPy: - Numpy >= 1.0 - Scipy >= 1.0 - Matplotlib >= 3.0 -- netCDF4 >= 1.6.2 for Windows, MacOS or Python < '3.11'; netCDF4 >=1.4,<1.6 for Python 3.11+ in Linux +- netCDF4 >= 1.6.4 - windrose >= 1.6.8 - requests - pytz @@ -43,7 +43,7 @@ The packages needed can be installed via ``pip`` by running the following lines pip install "numpy>=1.0" pip install "scipy>=1.0" pip install "matplotlib>=3.0" - pip install "netCDF4>=1.6.2" + pip install "netCDF4>=1.6.4" pip install "windrose >= 1.6.8" pip install "ipywidgets>=7.6.3" pip install requests @@ -61,7 +61,7 @@ To update Scipy and install netCDF4 using Conda, the following code is used: .. code-block:: shell conda install "scipy>=1.0" - conda install -c anaconda "netcdf4>=1.6.2" + conda install -c anaconda "netcdf4>=1.6.4" Optional Packages diff --git a/requirements.txt b/requirements.txt index 21864782a..6da189cb3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,7 @@ numpy>=1.0 scipy>=1.0 matplotlib>=3.0 -netCDF4>=1.6.2; sys_platform != 'linux' or python_version < '3.11' -netCDF4>=1.4,<1.6; sys_platform == 'lixux' and python_version >= '3.11' +netCDF4>=1.6.4 windrose>=1.6.8 ipywidgets>=7.6.3 requests diff --git a/setup.py b/setup.py index ae757d196..8f031c2e8 100644 --- a/setup.py +++ b/setup.py @@ -1,20 +1,8 @@ -import os -import sys import setuptools with open("README.md", "r") as fh: long_description = fh.read() -# Manage different netCDF4 versions depending on system version and Google Colab -netCDF4_requirement = "netCDF4>=1.6.2" - -# Check if running on a linux system -if sys.platform == "linux" and sys.version_info[1] < 11: - # Support for Linux with Python < 3.11 - # Avoid problems due to netCDF4 issue linked below - # https://github.com/Unidata/netcdf4-python/issues/1179 - netCDF4_requirement = "netCDF4>=1.4,<1.6" - setuptools.setup( name="rocketpy", version="0.13.1", @@ -22,7 +10,7 @@ "numpy>=1.0", "scipy>=1.0", "matplotlib>=3.0", - netCDF4_requirement, + "netCDF4>=1.6.4", "windrose>=1.6.8", "ipywidgets>=7.6.3", "requests", From 339b615da050d56918f129d178cc5444069c7dfa Mon Sep 17 00:00:00 2001 From: Guilherme Date: Wed, 14 Jun 2023 10:04:40 +0200 Subject: [PATCH 4/6] MAINT: remove colab usage disclaimer --- docs/user/requirements.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/user/requirements.rst b/docs/user/requirements.rst index 46760c3f6..88e95e0ca 100644 --- a/docs/user/requirements.rst +++ b/docs/user/requirements.rst @@ -31,8 +31,6 @@ The following packages are needed in order to run RocketPy: All of these packages, are automatically installed when RocketPy is installed using either ``pip`` or ``conda``. However, in case the user wants to install these packages manually, they can do so by following the instructions bellow. -Note: Google Colab and netCDF4 don't play well together for netCDF4 >= 1.6 (see `this issue `_). If you are using Google Colab, you should install netCDF4 < 1.6 or use `condacolab `_) to install netCDF4 >= 1.6. - Installing Required Packages Using ``pip`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 106ae320b1d82000686be50f496709ce82e46b36 Mon Sep 17 00:00:00 2001 From: Guilherme Date: Wed, 14 Jun 2023 10:46:22 +0200 Subject: [PATCH 5/6] FIX: wrong optional packages left as required in docs Update requirements.rst --- docs/user/requirements.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/user/requirements.rst b/docs/user/requirements.rst index 28684b336..f75b04816 100644 --- a/docs/user/requirements.rst +++ b/docs/user/requirements.rst @@ -40,8 +40,6 @@ The packages needed can be installed via ``pip`` by running the following lines pip install "scipy>=1.0" pip install "matplotlib>=3.0" pip install "netCDF4>=1.6.4" - pip install "windrose >= 1.6.8" - pip install "ipywidgets>=7.6.3" pip install requests pip install pytz pip install simplekml From 2613b5e3a29b75704fe7ab5d46b452a559958319 Mon Sep 17 00:00:00 2001 From: Guilherme Date: Sun, 18 Jun 2023 02:33:13 +0200 Subject: [PATCH 6/6] Update docs/user/requirements.rst Co-authored-by: phmbressan <87212571+phmbressan@users.noreply.github.com> --- docs/user/requirements.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user/requirements.rst b/docs/user/requirements.rst index f75b04816..6a5e17d6d 100644 --- a/docs/user/requirements.rst +++ b/docs/user/requirements.rst @@ -9,7 +9,7 @@ Python Version RocketPy supports Python 3.8 and above. Sorry, there are currently no plans to support earlier versions. -If you really need to run RocketPy on Python 3.6 or earlier, feel free to submit an issue and we will see what we can do! +If you really need to run RocketPy on Python 3.7 or earlier, feel free to submit an issue and we will see what we can do! Required Packages -----------------