Skip to content

Commit

Permalink
Drop support for Python 3.8 and 3.9 and add support for Python 3.13 (#…
Browse files Browse the repository at this point in the history
…451)

* update copyright

* cis: update ci config

* drop support for Python 3.8 and 3.9

* cis: update release workflow
  • Loading branch information
MatthieuDartiailh authored Sep 17, 2024
1 parent db87594 commit 29d3048
Show file tree
Hide file tree
Showing 24 changed files with 76 additions and 77 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
exclude:
- python-version: '3.9'
os: macos-latest
python-version: ["3.10", "3.11", "3.12", "3.13-dev"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
89 changes: 51 additions & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: artifact-sdist
path: dist/*.tar.gz
name: cibw-sdist
path: dist/*

build_wheel:
name: Build wheel
Expand All @@ -61,53 +61,66 @@ jobs:
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: artifact-wheel
path: dist/*.whl
name: cibw-wheel
path: dist/*

release_upload:
name: Create Release and Upload Release Asset
runs-on: ubuntu-latest
if: github.event_name == 'push'
needs: [build_wheel, build_sdist]
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'a') || contains(github.ref, 'b')}}
- uses: actions/download-artifact@v4
with:
pattern: articfact-*
path: dist
merge-multiple: true
- name: Upload Release Asset
id: upload-release-asset
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/*

upload_pypi:
publish:
if: github.event_name == 'push'
needs: [build_wheel, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- name: Download all the dists
uses: actions/[email protected]
with:
pattern: artifact-*
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@master
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
# To test:
# repository_url: https://test.pypi.org/legacy/

github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and create a GitHub Release
runs-on: ubuntu-latest
needs:
- publish

permissions:
contents: write
id-token: write

steps:
- name: Download all the dists
uses: actions/[email protected]
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
password: ${{ secrets.pypi_password }}
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--generate-notes
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
7 changes: 1 addition & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@
import datetime
import os
import sys

if sys.version_info >= (3, 8):
from importlib.metadata import version as get_version
else:
from importlib_metadata import version as get_version

from importlib.metadata import version as get_version

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "PyVISA-py"
description = "Pure Python implementation of a VISA library."
readme = "README.rst"
requires-python = ">=3.8"
requires-python = ">=3.10"
license = { file = "LICENSE" }
authors = [{ name = "Hernan E. Grecco", email = "[email protected]" }]
maintainers = [{ name = "Matthieu C. Dartiailh", email = "[email protected]" }]
Expand All @@ -18,11 +18,10 @@
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator",
"Topic :: Software Development :: Libraries :: Python Modules",
"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",
"Programming Language :: Python :: 3.13",
]
dependencies = ["pyvisa>=1.13.0", "typing_extensions"]
dynamic = ["version"]
Expand Down
9 changes: 2 additions & 7 deletions pyvisa_py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@
"""Pure Python backend for PyVISA.
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""

import sys

if sys.version_info >= (3, 8):
from importlib.metadata import PackageNotFoundError, version
else:
from importlib_metadata import PackageNotFoundError, version # type: ignore
from importlib.metadata import PackageNotFoundError, version

__version__ = "unknown"
try:
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
For additional information and VISA attributes see pyvisa.constants
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""

Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/common.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Common code.
:copyright: 2014-2020 by PyVISA-sim Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-sim Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/gpib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""GPIB Session implementation using linux-gpib or gpib-ctypes.
:copyright: 2015-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2015-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/highlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Highlevel wrapper of the VISA Library.
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/protocols/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Implements protocols on top of lower level libraries to talk to instruments.
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
2 changes: 1 addition & 1 deletion pyvisa_py/protocols/hislip.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Python implementation of HiSLIP protocol. Based on the HiSLIP spec:
http://www.ivifoundation.org/downloads/Class%20Specifications/IVI-6.1_HiSLIP-1.1-2011-02-24.pdf
http://www.ivifoundation.org/downloads/Class%20Specifications/IVI-6.1_HiSLIP-1.1-2024-02-24.pdf
"""

import socket
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/protocols/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
http://svn.python.org/projects/python/trunk/Demo/rpc/rpc.py
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/protocols/usbraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This file is an offspring of the Lantz Project.
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/protocols/usbtmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
This file is an offspring of the Lantz Project.
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/protocols/usbutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
This file is an offspring of the Lantz Project.
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/protocols/vxi11.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
This file is an offspring of the Lantz project.
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Serial Session implementation using PySerial.
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Base Session class.
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/tcpip.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""TCPIP Session implementation using Python Standard library.
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/testsuite/keysight_assisted_tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
See pyvisa/testsuite/keysight_assisted_tests/__init__.py for more details.
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
2 changes: 1 addition & 1 deletion pyvisa_py/testsuite/test_highlevel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test creating a resource manager using PyVISA-Py as a backend.
:copyright: 2014-2023 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/testsuite/test_serial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test creating a resource manager using PyVISA-Py as a backend.
:copyright: 2014-2023 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/testsuite/test_sessions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test loading resources.
:copyright: 2014-2023 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down
2 changes: 1 addition & 1 deletion pyvisa_py/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Serial Session implementation using PyUSB.
:copyright: 2014-2020 by PyVISA-py Authors, see AUTHORS for more details.
:copyright: 2014-2024 by PyVISA-py Authors, see AUTHORS for more details.
:license: MIT, see LICENSE for more details.
"""
Expand Down

0 comments on commit 29d3048

Please sign in to comment.