Skip to content

Commit

Permalink
Merge branch 'apply-cookiecutter' into fix-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ahms5 committed Dec 12, 2024
2 parents 83bc35c + c18cf79 commit b85ec7b
Show file tree
Hide file tree
Showing 60 changed files with 8,352 additions and 6,856 deletions.
150 changes: 108 additions & 42 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,14 @@ jobs:
executor:
name: python-docker
version: <<parameters.version>>

steps:
- checkout
# - run:
# name: Install System Dependencies
# command: sudo apt-get update && sudo apt-get install -y libsndfile1
- python/install-packages:
pkg-manager: pip
# app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory.
pip-dependency-file: requirements_dev.txt
- run:
name: install dependencies
command: pip install ".[tests]"
- run:
name: Run tests
command: pytest
Expand All @@ -57,17 +55,14 @@ jobs:
executor:
name: python-docker
version: <<parameters.version>>

steps:
- checkout
- python/install-packages:
pkg-manager: pip
# app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory.
pip-dependency-file: requirements_dev.txt
- run:
name: Ruff
command: ruff spharpy tests

name: install dependencies
command: pip install ".[tests]"
- run:
name: ruff
command: ruff check

test_documentation_build:
parameters:
Expand All @@ -78,23 +73,41 @@ jobs:
executor:
name: python-docker
version: <<parameters.version>>

steps:
- checkout
# - run:
# name: Install System Dependencies
# command: sudo apt-get update && sudo apt-get install -y libsndfile1 texlive-latex-extra dvipng
- python/install-packages:
pkg-manager: pip
# app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory.
pip-dependency-file: requirements_dev.txt
- run:
name: Sphinx
command: |
pip install -e .
pip install ".[docs]"
cd docs/
make html SPHINXOPTS="-W"
test_deprecation_warnings:
parameters:
version:
description: "version tag"
default: "latest"
type: string
executor:
name: python-docker
version: <<parameters.version>>
steps:
- checkout
# - run:
# name: Install System Dependencies
# command: sudo apt-get update && sudo apt-get install -y libsndfile1 texlive-latex-extra dvipng
- run:
name: install dependencies
command: pip install ".[tests]"
- run: |
python --version
- run:
name: Run tests
command: pytest tests -W error::DeprecationWarning

test_pypi_publish:
parameters:
version:
Expand All @@ -104,20 +117,42 @@ jobs:
executor:
name: python-docker
version: <<parameters.version>>
steps:
- checkout
# - run:
# name: Install System Dependencies
# command: sudo apt-get update && sudo apt-get install -y libsndfile1
- run:
name: install dependencies
command: pip install ".[deploy]"
- run:
name: deploy
command: | # create whl, install twine and publish to Test PyPI
python -m build
twine check dist/*
run_pypi_publish:
parameters:
version:
description: "version tag"
default: "latest"
type: string
executor:
name: python-docker
version: <<parameters.version>>
steps:
- checkout
# - run:
# name: Install System Dependencies
# command: sudo apt-get update && sudo apt-get install -y libsndfile1
- python/install-packages:
pkg-manager: pip
# app-dir: ~/project/package-directory/ # If you're requirements.txt isn't in the root directory.
pip-dependency-file: requirements_dev.txt
- run:
name: Install System Dependencies
command: sudo apt-get update && sudo apt-get install -y libsndfile1
- run:
name: install dependencies
command: pip install ".[deploy]"
- run:
name: deploy
command: | # create whl, install twine and publish to Test PyPI
python setup.py sdist bdist_wheel
python -m build
twine check dist/*
twine upload dist/*
# Invoke jobs via workflows
Expand All @@ -130,12 +165,13 @@ workflows:
matrix:
parameters:
version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"

- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"

- ruff:
matrix:
parameters:
Expand All @@ -144,7 +180,6 @@ workflows:
requires:
- build_and_test


- test_documentation_build:
matrix:
parameters:
Expand All @@ -153,21 +188,37 @@ workflows:
requires:
- build_and_test

- test_deprecation_warnings:
matrix:
parameters:
version:
- "3.9"
requires:
- build_and_test

test_and_publish:
- test_pypi_publish:
matrix:
parameters:
version:
- "3.9"
requires:
- build_and_test

test_and_publish:
# Test and publish on new git version tags
# This requires its own workflow to successfully trigger the test and build
jobs:
- build_and_test:
matrix:
parameters:
version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"

- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"

filters:
branches:
ignore: /.*/
Expand Down Expand Up @@ -203,7 +254,21 @@ test_and_publish:
tags:
only: /^v[0-9]+(\.[0-9]+)*$/

- test_pypi_publish:
- test_deprecation_warnings:
matrix:
parameters:
version:
- "3.9"
requires:
- build_and_test
filters:
branches:
ignore: /.*/
# only act on version tags
tags:
only: /^v[0-9]+(\.[0-9]+)*$/

- run_pypi_publish:
matrix:
parameters:
version:
Expand All @@ -212,6 +277,7 @@ test_and_publish:
- build_and_test
- ruff
- test_documentation_build
- test_deprecation_warnings
filters:
branches:
ignore: /.*/
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/has_version_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PR Check Label for version Label

on:
pull_request:
types:
- opened
- labeled
- unlabeled
- synchronize

jobs:
check-labels:
runs-on: ubuntu-latest
steps:
- name: Check for version label
run: |
echo "Checking for version label on pull request..."
PR_DATA=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }})
LABEL_NAMES=$(echo "$PR_DATA" | jq -r '.labels[].name')
echo "Labels: $LABEL_NAMES"
REGEX="^v[0-9]+\.[0-9]+\.[0-9]+$"
MATCHES=$(echo "$LABEL_NAMES" | grep -E "$REGEX")
if [ -z "$MATCHES" ]; then
echo "Error: No version label found on this pull request. Please add a label in the format vX.Y.Z."
exit 1
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,7 @@ docs/_static/favicon.ico
docs/_static/header.rst
docs/_static/css/custom.css
docs/resources/logos/pyfar_logos_fixed_size_spharpy.png

# external data that is loaded from the web
spharpy/samplings/_eqsp/samplings_extremal*
spharpy/samplings/_eqsp/samplings_t_design*
7 changes: 5 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.12"
# apt_packages:
# - libsndfile1

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand All @@ -21,4 +23,5 @@ formats:
# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: requirements_dev.txt
- method: pip
path: ".[docs]"
6 changes: 2 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ Ready to contribute? Here's how to set up `spharpy` for local development using

$ conda create --name spharpy python
$ conda activate spharpy
$ conda install pip
$ pip install -e .
$ pip install -r requirements_dev.txt
$ pip install -e ".[dev]"

4. Create a branch for local development. Indicate the intention of your branch in its respective name (i.e. `feature/branch-name` or `bugfix/branch-name`)::

Expand All @@ -59,7 +57,7 @@ Ready to contribute? Here's how to set up `spharpy` for local development using
5. When you're done making changes, check that your changes pass ruff and the
tests::

$ ruff pyfar tests
$ ruff check
$ pytest

ruff must pass without any warnings for `./spharpy` and `./tests` using the default or a stricter configuration. Ruff ignores a couple of PEP Errors (see `./pyproject.toml`). If necessary, adjust your linting configuration in your IDE accordingly.
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.rst
include README.md

recursive-include tests *
recursive-exclude * __pycache__
Expand Down
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<h1 align="center">
<img src="https://github.com/pyfar/gallery/raw/main/docs/resources/logos/pyfar_logos_fixed_size_spharpy.png" width="300">
</h1><br>



[![PyPI version](https://badge.fury.io/py/spharpy.svg)](https://badge.fury.io/py/spharpy)
[![Documentation Status](https://readthedocs.org/projects/spharpy/badge/?version=latest)](https://spharpy.readthedocs.io/en/latest/?badge=latest)
[![CircleCI](https://circleci.com/gh/pyfar/spharpy.svg?style=shield)](https://circleci.com/gh/pyfar/spharpy)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pyfar/gallery/main?labpath=docs/gallery/interactive/pyfar_introduction.ipynb)

Spherical array processing in python.

Getting Started
===============

The [pyfar workshop](https://mybinder.org/v2/gh/pyfar/gallery/main?labpath=docs/gallery/interactive/pyfar_introduction.ipynb)
gives an overview of the most important pyfar functionality and is a good
starting point. It is part of the [pyfar example gallery](https://pyfar-gallery.readthedocs.io/en/latest/examples_gallery.html)
that also contains more specific and in-depth
examples that can be executed interactively without a local installation by
clicking the mybinder.org button on the respective example. The
[pyfar documentation](https://pyfar.readthedocs.io) gives a detailed and complete overview of pyfar. All
these information are available from [pyfar.org](https://pyfar.org).

Installation
============

Use pip to install spharpy

pip install spharpy

(Requires Python 3.8 or higher)


Contributing
============

Check out the [contributing guidelines](https://pyfar.readthedocs.io/en/stable/contributing.html) if you want to become part of pyfar.
Loading

0 comments on commit b85ec7b

Please sign in to comment.