From bf1805ce52624e7a6abdcd0df8e33384b974fd42 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 15:28:53 +0200 Subject: [PATCH 1/6] build and tests run in separate workflows. Only last three Python versions are used. --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 8 ++------ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..64aade12 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: build + +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + + tests: + name: Run template tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] + python-version: ['3.10', '3.11', '3.12'] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Python info + shell: bash -e {0} + run: | + which python + python --version + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools + python -m pip install .[dev] diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f709f3d0..8c74ba21 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,10 +13,10 @@ jobs: name: Run template tests runs-on: ${{ matrix.os }} strategy: - fail-fast: false + fail-fast: true matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -28,10 +28,6 @@ jobs: run: | which python python --version - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools - python -m pip install .[dev] - name: Run pytest run: | python -m pytest -v --durations=0 From 73092a9d6d6cfa2d071ebe549718b4cf237dae10 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 15:47:57 +0200 Subject: [PATCH 2/6] remove Python 3.8 and 3.9 from setup.cfg --- setup.cfg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 67b1efdd..ef1b53ab 100644 --- a/setup.cfg +++ b/setup.cfg @@ -12,8 +12,6 @@ classifiers = License :: OSI Approved :: Apache Software License Natural Language :: English Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 @@ -30,7 +28,7 @@ version = 0.4.0 [options] zip_safe = False include_package_data = True -python_requires = >=3.8 +python_requires = >=3.10 packages = install_requires = copier==9.2.0 From 7d53e8d42aecb6844578c588ac121215b2b32a64 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 15:48:48 +0200 Subject: [PATCH 3/6] remove Python 3.8 and 3.9 from the generated package --- .../workflows/{% if AddGitHubActions %}build.yml{% endif %} | 4 ++-- template/project_setup.md.jinja | 2 -- template/pyproject.toml.jinja | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/template/.github/workflows/{% if AddGitHubActions %}build.yml{% endif %} b/template/.github/workflows/{% if AddGitHubActions %}build.yml{% endif %} index 97c648cf..1d4df162 100644 --- a/template/.github/workflows/{% if AddGitHubActions %}build.yml{% endif %} +++ b/template/.github/workflows/{% if AddGitHubActions %}build.yml{% endif %} @@ -14,10 +14,10 @@ jobs: name: Build for (${{ '{{ ' -}} matrix.python-version }}, ${{ '{{ ' -}} matrix.os }}) runs-on: ${{ '{{ ' -}} matrix.os }} strategy: - fail-fast: false + fail-fast: true matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ '{{ ' -}} matrix.python-version }} diff --git a/template/project_setup.md.jinja b/template/project_setup.md.jinja index 3fa94112..6d4a4b46 100644 --- a/template/project_setup.md.jinja +++ b/template/project_setup.md.jinja @@ -11,8 +11,6 @@ checklist](https://guide.esciencecenter.nl/#/best_practices/checklist). This repository is set up with Python versions: -- 3.8 -- 3.9 - 3.10 - 3.11 - 3.12 diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index 2d868d06..1c7062d7 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -24,8 +24,6 @@ classifiers = [ }[license] }}", "Natural Language :: English", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", From 9ed2cf7199f2c0011108cf9291b7f8bdc2cf008a Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 15:54:47 +0200 Subject: [PATCH 4/6] install the dependencies to run the tests --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c74ba21..7de55161 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,6 +28,10 @@ jobs: run: | which python python --version + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools + python -m pip install .[dev] - name: Run pytest run: | python -m pytest -v --durations=0 From e86d2ad2e3252767a394754a135741fd4a05baf5 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 16:06:01 +0200 Subject: [PATCH 5/6] update the name of the build job --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64aade12..12767382 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,8 @@ on: - main jobs: - tests: - name: Run template tests + build: + name: Run pip install runs-on: ${{ matrix.os }} strategy: fail-fast: true From 6c4e9980ab479dd0703b532f4e36bcb478323558 Mon Sep 17 00:00:00 2001 From: "Faruk D." Date: Mon, 26 Aug 2024 16:46:50 +0200 Subject: [PATCH 6/6] update the changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce14ec11..4c0410a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,12 +14,12 @@ ### Changed +* Droped Python 3.8 and 3.9 support [#551](https://github.com/NLeSC/python-template/pull/551) * pre-commit script is optional ([#457](https://github.com/NLeSC/python-template/issues/457)) * CHANGELOG.md is now optional ([#462](https://github.com/NLeSC/python-template/issues/462)) ### Removed -* ## [0.5.0]