Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4

- name: Install python 3.9
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: x64
Expand Down Expand Up @@ -57,11 +57,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4

# General case
- name: Install python ${{ matrix.nox_session.python }} for tests (not 3.5 not 3.13)
if: ${{ ! contains(fromJson('["3.5", "3.13"]'), matrix.nox_session.python ) }}
- name: Install python ${{ matrix.nox_session.python }} for tests (not 3.5 not 3.14)
if: ${{ ! contains(fromJson('["3.5", "3.14"]'), matrix.nox_session.python ) }}
uses: MatteoH2O1999/setup-python@v4 # actions/setup-python@v5.0.0
id: set-py
with:
Expand All @@ -86,8 +86,8 @@ jobs:
PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org"


- name: Install python ${{ matrix.nox_session.python }} for tests (3.13)
if: contains(fromJson('["3.13"]'), matrix.nox_session.python )
- name: Install python ${{ matrix.nox_session.python }} for tests (3.14)
if: contains(fromJson('["3.14"]'), matrix.nox_session.python )
uses: actions/setup-python@v5
id: set-py-latest
with:
Expand All @@ -99,7 +99,7 @@ jobs:
cache-build: true

- name: Install python 3.12 for nox
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5
with:
python-version: 3.12
architecture: x64
Expand All @@ -118,7 +118,7 @@ jobs:
# Share ./docs/reports so that they can be deployed with doc in next job
- name: Share reports with other jobs
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4.3.1
uses: actions/upload-artifact@v4
with:
name: reports_dir
path: ./docs/reports
Expand All @@ -128,10 +128,10 @@ jobs:
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4

- name: Install python 3.9 for nox
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: x64
Expand All @@ -153,19 +153,20 @@ jobs:
run: echo "$GITHUB_CONTEXT"

- name: Checkout with no depth
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4
with:
fetch-depth: 0 # so that gh-deploy works
# persist-credentials: false # see https://github.com/orgs/community/discussions/25702

- name: Install python 3.9 for nox
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: x64

# 1) retrieve the reports generated previously
- name: Retrieve reports
uses: actions/download-artifact@v4.1.4
uses: actions/download-artifact@v4
with:
name: reports_dir
path: ./docs/reports
Expand Down Expand Up @@ -197,7 +198,7 @@ jobs:
EOF
- name: \[not on TAG\] Publish coverage report
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads')
uses: codecov/codecov-action@v4.1.1
uses: codecov/codecov-action@v4
with:
files: ./docs/reports/coverage/coverage.xml
- name: \[not on TAG\] Build wheel and sdist
Expand All @@ -209,7 +210,11 @@ jobs:
# 7) Create github release and build the wheel
- name: \[TAG only\] Build wheel and create github release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: nox -s release -- ${{ secrets.GITHUB_TOKEN }}
# We would have to use a PAT instead of GITHUB_TOKEN if we want the next job to trigger.
# See https://github.com/orgs/community/discussions/25702
# For now we will rather rely on a "workflow completed" trigger to avoid
# having a token expiration date to manage
run: nox -s release -- ${{ secrets.GITHUB_TOKEN }} # ${{ secrets.WORKFLOW_SECRET}}

# 8) Publish the wheel on PyPi
- name: \[TAG only\] Deploy on PyPi
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/ghpages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy Static Website from gh-pages branch

on:
# Runs on pushes targeting the default branch
push:
branches: ["gh-pages"]

# Since the pushes made by the workflow using GITHUB_TOKEN do not trigger the above,
# Add an explicit trigger for workflow completion
workflow_run:
workflows: ['Build']
types: [completed]
branches:
- 'main'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 2 additions & 2 deletions .github/workflows/updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v4
with:
# [Required] Access token with `workflow` scope.
token: ${{ secrets.WORKFLOW_SECRET }}

- name: Run GitHub Actions Version Updater
uses: saadmk11/github-actions-version-updater@v0.8.1
uses: saadmk11/github-actions-version-updater@v0.8
with:
# [Required] Access token with `workflow` scope.
token: ${{ secrets.WORKFLOW_SECRET }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

*Store data created during your `pytest` tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes.*

[![Python versions](https://img.shields.io/pypi/pyversions/pytest-harvest.svg)](https://pypi.python.org/pypi/pytest-harvest/) [![Build Status](https://github.com/smarie/python-pytest-harvest/actions/workflows/base.yml/badge.svg)](https://github.com/smarie/python-pytest-harvest/actions/workflows/base.yml) [![Tests Status](https://smarie.github.io/python-pytest-harvest/reports/junit/junit-badge.svg?dummy=8484744)](https://smarie.github.io/python-pytest-harvest/reports/junit/report.html) [![codecov](https://codecov.io/gh/smarie/python-pytest-harvest/branch/master/graph/badge.svg)](https://codecov.io/gh/smarie/python-pytest-harvest)
[![Python versions](https://img.shields.io/pypi/pyversions/pytest-harvest.svg)](https://pypi.python.org/pypi/pytest-harvest/) ![Pytest versions](https://img.shields.io/badge/pytest-6%20%7C%207%20%7C%208-blue) [![Build Status](https://github.com/smarie/python-pytest-harvest/actions/workflows/base.yml/badge.svg)](https://github.com/smarie/python-pytest-harvest/actions/workflows/base.yml) [![Tests Status](https://smarie.github.io/python-pytest-harvest/reports/junit/junit-badge.svg?dummy=8484744)](https://smarie.github.io/python-pytest-harvest/reports/junit/report.html) [![codecov](https://codecov.io/gh/smarie/python-pytest-harvest/branch/master/graph/badge.svg)](https://codecov.io/gh/smarie/python-pytest-harvest)

[![Documentation](https://img.shields.io/badge/doc-latest-blue.svg)](https://smarie.github.io/python-pytest-harvest/) [![PyPI](https://img.shields.io/pypi/v/pytest-harvest.svg)](https://pypi.python.org/pypi/pytest-harvest/) [![Downloads](https://pepy.tech/badge/pytest-harvest)](https://pepy.tech/project/pytest-harvest) [![Downloads per week](https://pepy.tech/badge/pytest-harvest/week)](https://pepy.tech/project/pytest-harvest) [![GitHub stars](https://img.shields.io/github/stars/smarie/python-pytest-harvest.svg)](https://github.com/smarie/python-pytest-harvest/stargazers)

Expand Down
29 changes: 4 additions & 25 deletions ci_tools/nox_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from pathlib import Path
import shutil
import os
import re

from typing import Sequence, Dict, Union

Expand All @@ -13,8 +12,9 @@
nox_logger = logging.getLogger("nox")


PY27, PY35, PY36, PY37, PY38, PY39, PY310, PY311, PY312, PY313 = ("2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10",
"3.11", "3.12", "3.13")
PY27, PY35, PY36, PY37, PY38, PY39, PY310, PY311, PY312, PY313, PY314 = (
"2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"
)
DONT_INSTALL = "dont_install"


Expand Down Expand Up @@ -104,28 +104,7 @@ def install_any(session,
# use the provided versions dictionary to update the versions
if versions_dct is None:
versions_dct = dict()

_pkgs = pkgs
pkgs = []
for pkg in _pkgs:
# Find version specifiers if any
try:
separator = next(re.finditer(r"[>=<~!]", pkg)).start()
p_name, p_version = pkg[:separator], pkg[separator:]
except StopIteration:
p_name, p_version = pkg, ""

# Is there something to override them in our versions_dct ?
specifier_override = versions_dct.get(p_name, "")
if specifier_override == DONT_INSTALL:
print(f"NOT INSTALLING {p_name}{p_version} as described in the nox parametrization grid")
continue
if specifier_override:
print(f"OVERRIDING {p_name}{p_version} to {p_name}{specifier_override} as described in the nox parametrization grid")
p_version = specifier_override

# Store the definitive package name and version specifier
pkgs.append(f"{p_name}{p_version}")
pkgs = [pkg + versions_dct.get(pkg, "") for pkg in pkgs if versions_dct.get(pkg, "") != DONT_INSTALL]

nox_logger.debug("\nAbout to install *%s* requirements: %s.\n "
"Conda pkgs are %s" % (phase_name, pkgs, use_conda_for))
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

### 1.11.0 - dropped support for python < 3.9 and fixed - pytest 8.4.0 (in progress)

- Dropped support for python <3.9 and added a proper github pages workflow (explicit). Removed `six` from dependencies.
Fixed [#79](https://github.com/smarie/python-pytest-harvest/issues/79)

### 1.10.6 - bugfixes and maintenance chores

- Refactored layout and CI. Fixed [#56](https://github.com/smarie/python-pytest-harvest/issues/56).
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

*Store data created during your `pytest` tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes.*

[![Python versions](https://img.shields.io/pypi/pyversions/pytest-harvest.svg)](https://pypi.python.org/pypi/pytest-harvest/) [![Build Status](https://github.com/smarie/python-pytest-harvest/actions/workflows/base.yml/badge.svg)](https://github.com/smarie/python-pytest-harvest/actions/workflows/base.yml) [![Tests Status](https://smarie.github.io/python-pytest-harvest/reports/junit/junit-badge.svg?dummy=8484744)](https://smarie.github.io/python-pytest-harvest/reports/junit/report.html) [![codecov](https://codecov.io/gh/smarie/python-pytest-harvest/branch/master/graph/badge.svg)](https://codecov.io/gh/smarie/python-pytest-harvest)
[![Python versions](https://img.shields.io/pypi/pyversions/pytest-harvest.svg)](https://pypi.python.org/pypi/pytest-harvest/) ![Pytest versions](https://img.shields.io/badge/pytest-6%20%7C%207%20%7C%208-blue) [![Build Status](https://github.com/smarie/python-pytest-harvest/actions/workflows/base.yml/badge.svg)](https://github.com/smarie/python-pytest-harvest/actions/workflows/base.yml) [![Tests Status](https://smarie.github.io/python-pytest-harvest/reports/junit/junit-badge.svg?dummy=8484744)](https://smarie.github.io/python-pytest-harvest/reports/junit/report.html) [![codecov](https://codecov.io/gh/smarie/python-pytest-harvest/branch/master/graph/badge.svg)](https://codecov.io/gh/smarie/python-pytest-harvest)

[![Documentation](https://img.shields.io/badge/doc-latest-blue.svg)](https://smarie.github.io/python-pytest-harvest/) [![PyPI](https://img.shields.io/pypi/v/pytest-harvest.svg)](https://pypi.python.org/pypi/pytest-harvest/) [![Downloads](https://pepy.tech/badge/pytest-harvest)](https://pepy.tech/project/pytest-harvest) [![Downloads per week](https://pepy.tech/badge/pytest-harvest/week)](https://pepy.tech/project/pytest-harvest) [![GitHub stars](https://img.shields.io/github/stars/smarie/python-pytest-harvest.svg)](https://github.com/smarie/python-pytest-harvest/stargazers)

Expand Down
Loading
Loading