Skip to content

Commit

Permalink
Modernize Python compatibilities and bump lspopt version (#10)
Browse files Browse the repository at this point in the history
* fix README typo

* ignore local python environments

* workflow tests python 3.8-3.12

* add .toml file

* update python versions in setup.py

* remove __future__ and unused imports

* bump version and update changelog

* float --> str python versions

* bump all gh-action versions

* add windows and macos tests

* update changelog

* bump gh-action versions in pypi workflow
  • Loading branch information
remrama authored Jan 7, 2025
1 parent 255c200 commit 6a3508c
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 35 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip. setuptools and wheel
Expand All @@ -37,7 +37,7 @@ jobs:
run: |
pytest tests --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml --cov=com --cov-report=xml --cov-report=html
- name: Upload pytest test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,6 @@ docs/_build/
# PyBuilder
target/

# Environments
.conda/
.vscode/
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.4.0] - 2025-01-07

### Added

- Support for Python 3.12
- Support for `pip>=25`
- Support for `numpy>=2`
- Support for Windows and macOS

### Removed

- Support for Python 3.7 and 3.8
- Unused imports


## [1.3.0] - 2023-01-24

### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ To generate the taper windows only, use the `lspopt` method:

```python
from lspopt import lspopt
H, w = lspopt(N=256, c_parameter=20.0)
H, w = lspopt(n=256, c_parameter=20.0)
```

There is also a convenience method for using the [SciPy spectrogram method](https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.spectrogram.html#scipy.signal.spectrogram)
Expand Down
5 changes: 0 additions & 5 deletions generate_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"""

from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import

import six
import numpy as np
from scipy.signal import chirp, spectrogram
Expand Down
2 changes: 1 addition & 1 deletion lspopt/__version__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

version = "1.3.0"
version = "1.4.0"
__version__ = version
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools >= 64", "wheel"]
build-backend = "setuptools.build_meta"
9 changes: 2 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine

from __future__ import division
from __future__ import print_function
from __future__ import absolute_import

import io
import os
import sys
Expand All @@ -22,7 +18,7 @@
URL = 'https://github.com/hbldh/lspopt'
EMAIL = '[email protected]'
AUTHOR = 'Henrik Blidh'
REQUIRES_PYTHON = '>=3.7'
REQUIRES_PYTHON = '>=3.9'
VERSION = None

REQUIRED = [
Expand Down Expand Up @@ -114,11 +110,10 @@ def run(self):
'Operating System :: Unix',
'Operating System :: MacOS',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'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 :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy'
],
Expand Down
7 changes: 0 additions & 7 deletions tests/test_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
"""

from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import

import unittest

import pytest
import numpy as np
from numpy.testing import assert_allclose
Expand Down
7 changes: 0 additions & 7 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
"""

from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import

import pytest
import numpy as np
from numpy.testing import assert_allclose

from lspopt import utils
Expand Down

0 comments on commit 6a3508c

Please sign in to comment.