From e255fe76cade270272c2f6026823610d80339c94 Mon Sep 17 00:00:00 2001 From: Mi! Date: Mon, 21 Nov 2022 11:39:57 +0100 Subject: [PATCH] Features/setuptools scm (#2) * setup: adapting setuptools-scm * ci: workflow adaption * ci: update maturin Co-authored-by: Marius Isken --- .github/workflows/build.yml | 44 ++++++++++++++----------------------- .github/workflows/lint.yml | 6 ++++- README.md | 7 +++--- pyproject.toml | 11 +++++++--- setup.py | 17 -------------- 5 files changed, 34 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 21ab3f7..b7b6c61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,21 +2,24 @@ name: build on: push: + branches: [main] + tags: + - v* pull_request: jobs: linux: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: messense/maturin-action@v1 + - uses: actions/checkout@v3 + - uses: PyO3/maturin-action@v1 with: manylinux: auto command: build - args: --release -o dist + args: --release --sdist -o dist --find-interpreter - name: Upload wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: dist @@ -24,40 +27,27 @@ jobs: windows: runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - uses: messense/maturin-action@v1 + - uses: actions/checkout@v3 + - uses: PyO3/maturin-action@v1 with: command: build - args: --release --no-sdist -o dist + args: --release -o dist --find-interpreter - name: Upload wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: dist - build_sdist: - name: Build source distribution - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Build sdist - run: pipx run build --sdist - - - uses: actions/upload-artifact@v3 - with: - path: dist/*.tar.gz - # macos: # runs-on: macos-latest # steps: - # - uses: actions/checkout@v2 - # - uses: messense/maturin-action@v1 + # - uses: actions/checkout@v3 + # - uses: PyO3/maturin-action@v1 # with: # command: build - # args: --release --no-sdist -o dist --universal2 + # args: --release -o dist --universal2 --find-interpreter # - name: Upload wheels - # uses: actions/upload-artifact@v2 + # uses: actions/upload-artifact@v3 # with: # name: wheels # path: dist @@ -69,11 +59,11 @@ jobs: # needs: [ macos, windows, linux ] needs: [ windows, linux ] steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels - name: Publish to PyPI - uses: messense/maturin-action@v1 + uses: PyO3/maturin-action@v1 env: MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9bbcbe5..79d23d1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,6 +1,10 @@ name: Lint -on: [push, pull_request] +on: + push: + tags: + - v* + pull_request: jobs: pre-commit: diff --git a/README.md b/README.md index ef62481..399c2c5 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,9 @@ ![PyPI](https://img.shields.io/pypi/v/lightguide) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/lightguide)](https://pypi.org/project/lightguide) -[![CI](https://github.com/pyrocko/lightguide/actions/workflows/build.yml/badge.svg)](https://github.com/pyrocko/lightguide/actions/workflows/build.yml) +[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/) Code style: black +[![CI](https://github.com/pyrocko/lightguide/actions/workflows/build.yml/badge.svg)](https://github.com/pyrocko/lightguide/actions/workflows/build.yml) Lightguide is a package for handling, filtering and modelling distributed acoustic sensing (DAS) data. The package interfaces handling and processing routines of DAS data to the [Pyrocko framework](https://pyrocko.org). Through Pyrocko's I/O engine :rocket: lightguide supports handling the following DAS data formats: @@ -54,13 +55,13 @@ The filtering performance of the AFK filter, applied to an earthquake recording Lightguide can be cited as: -> Marius Paul Isken, Sebastian Heimann, Christopher Wollin, Hannes Bathke, & Torsten Dahm. (2022). Lightguide - Seismological Tools for DAS data. Zenodo. https://doi.org/10.5281/zenodo.6580579 +> Marius Paul Isken, Sebastian Heimann, Christopher Wollin, Hannes Bathke, & Torsten Dahm. (2022). Lightguide - Seismological Tools for DAS data. Zenodo. [![DOI](https://zenodo.org/badge/495774991.svg)](https://zenodo.org/badge/latestdoi/495774991) Details of the adaptive frequency filter are published here: -> Marius Paul Isken, Hannes Vasyura-Bathke, Torsten Dahm, Sebastian Heimann, De-noising distributed acoustic sensing data using an adaptive frequency-wavenumber filter, Geophysical Journal International, 2022;, ggac229, https://doi.org/10.1093/gji/ggac229 +> Marius Paul Isken, Hannes Vasyura-Bathke, Torsten Dahm, Sebastian Heimann, De-noising distributed acoustic sensing data using an adaptive frequency-wavenumber filter, Geophysical Journal International, 2022;, ggac229, [![DOI](https://img.shields.io/badge/DOI-10.1093%2Fgji%2Fggac229-blue)](https://doi.org/10.1093/gji/ggac229) diff --git a/pyproject.toml b/pyproject.toml index c422cf7..1a0a42d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,11 @@ [build-system] -requires = ["maturin>=0.12,<0.13"] +requires = ["maturin>=0.14,<0.15", "setuptools_scm[toml]>=6.2"] build-backend = "maturin" [project] name = "lightguide" description = "Tools for distributed acoustic sensing and modelling." +dynamic = ["version"] requires-python = ">=3.8" authors = [ {name = "Marius Paul Isken"}, @@ -26,5 +27,9 @@ GitHub = "https://github.com/pyrocko/lightguide" Issues = "https://github.com/pyrocko/lightguide/issues" [project.optional-dependencies] -formating = ["flake8", "black"] -tests = ["pytest-benchmark", "pytest"] +dev = [ + "flake8", + "black", + "pytest-benchmark", + "pytest" +] diff --git a/setup.py b/setup.py index b484e98..087ce31 100644 --- a/setup.py +++ b/setup.py @@ -5,23 +5,7 @@ long_description = fh.read() setuptools.setup( - name="lightguide", - version="0.2.1", - author="Marius Paul Isken", - author_email="mi@gfz-potsdam.de", - description="DAS Tools for Pyrocko", zip_safe=False, - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/pyrocko/lightguide", - project_urls={ - "Bug Tracker": "https://github.com/pyrocko/lightguide/issues", - }, - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], rust_extensions=[ RustExtension( "lightguide.afk_filter", @@ -31,5 +15,4 @@ ) ], packages=["lightguide"], - python_requires=">=3.8", )