Skip to content
Open
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
27 changes: 14 additions & 13 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
name: Testing
name: Python package

on: [push]
on:
push:
pull_request:

jobs:
build:

test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["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: Install dependencies
- name: Install package and test tools
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install .
pip install pytest flake8 build
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
run: pytest
- name: Validate distribution build
run: python -m build
70 changes: 15 additions & 55 deletions .github/workflows/release-and-publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,24 @@
name: Create a Release on Tag
name: Release and publish to PyPI

on:
push:
tags:
- "v*"

permissions:
contents: write
packages: write

jobs:
release:
build-and-publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install dependencies
run: pip install build tomli tomli-w

# Optional (run a python script to sync versions with the tag)
- name: Extract tag version
id: tag
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT

- name: Set version from tag
run: python sync_version.py --set-version ${{ steps.tag.outputs.version }}

- name: Check if there are changes
id: diff
run: |
if git diff --quiet; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi

- name: Commit version sync (if needed)
if: steps.diff.outputs.changed == 'true'
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git commit -am "sync version to ${{ steps.tag.outputs.version }}"
git push origin HEAD:main
# ---

- name: Build distribution
run: python -m build

- name: Create GitHub Release and upload artifacts
uses: softprops/action-gh-release@v2
with:
files: dist/*.whl

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build sdist and wheel
run: |
python -m pip install --upgrade pip build
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,7 @@ venv.bak/
dmypy.json

# other
server_user_id.txt
server_user_id.txt

# Build artifacts
_build/
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ where **H** is reconstructed FRF matrix and **A** is a matrix of modal constants
.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4016671.svg?
:target: https://doi.org/10.5281/zenodo.4016671
.. |pytest| image:: https://github.com/sdypy/sdypy-EMA/actions/workflows/python-package.yml/badge.svg
:target: https://github.com/sdypy/sdypa-EMA/actions
:target: https://github.com/sdypy/sdypy-EMA/actions


.. _sdypy: https://github.com/sdypy/sdypy
Expand Down
3 changes: 0 additions & 3 deletions docs/requirements.txt

This file was deleted.

14 changes: 6 additions & 8 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
copyright = '2025, LADISK'
author = 'Klemen Zaletelj, Tomaž Bregar, Domen Gorjup, Janko Slavič, et al.'

# Version is sourced from the installed distribution metadata so the docs never
# drift from the package (RTD installs the package before building).
from importlib.metadata import version as _get_version
release = _get_version('sdypy-EMA')
# The short X.Y version
version = '0.29'
# The full version, including alpha/beta/rc tags
release = '0.29.1'
version = '.'.join(release.split('.')[:2])


# -- General configuration ---------------------------------------------------
Expand All @@ -42,10 +44,7 @@
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
# 'rinoh.frontend.sphinx',
'sphinx_copybutton',
]

Expand Down Expand Up @@ -82,8 +81,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = 'sphinx_rtd_theme'
html_theme = 'sphinx_book_theme'
html_theme = 'pydata_sphinx_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down
31 changes: 23 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"

[project]
name = "sdypy-EMA"
version = "0.29.1"
version = "0.30.0"
authors = [
{ name = "Janko Slavič et al.", email = "janko.slavic@fs.uni-lj.si" },
]
Expand Down Expand Up @@ -35,19 +35,25 @@ classifiers = [
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
]

[project.optional-dependencies]
dev = [
docs = [
"sphinx",
"pydata-sphinx-theme",
"sphinx-copybutton>=0.5.2",
]
dev = [
"sdypy-EMA[docs]",
"twine",
"wheel",
"pytest",
"build",
"sphinx-rtd-theme",
"sphinx-copybutton>=0.5.2",
"pyLump",
"flake8",
]

[project.urls]
Expand All @@ -56,11 +62,20 @@ documentation = "https://sdypy-EMA.readthedocs.io/en/latest/index.html"
source = "https://github.com/sdypy/sdypy-EMA"

[tool.hatch.build.targets.wheel]
include = [
"sdypy",
]
packages = ["sdypy"]

[tool.hatch.build.targets.sdist]
include = [
"sdypy/*",
"sdypy/",
"tests/",
"docs/",
"README.rst",
"LICENSE",
"pyproject.toml",
"readthedocs.yaml",
]
exclude = [
"docs/_build",
"docs/**/_build",
"data/",
]
21 changes: 5 additions & 16 deletions readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,19 @@ version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.11"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"
python: "3.12"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
extra: docs
10 changes: 0 additions & 10 deletions requirements.dev.txt

This file was deleted.

6 changes: 0 additions & 6 deletions requirements.txt

This file was deleted.

Loading