Skip to content

Commit

Permalink
add pypi workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
scottprahl committed Sep 22, 2023
1 parent 3cadef0 commit e726e1f
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 48 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/citation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: citation

on: # yamllint disable-line rule:truthy
release:
types: [published]
workflow_dispatch:

jobs:
update-citation:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
with:
ref: master

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

- name: Install dependencies
run: |
pip install requests PyYAML
- name: Update CITATION.cff
run: |
python .github/scripts/update_citation.py
- name: Commit and Push CITATION.cff Update
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git diff --exit-code || (
git add CITATION.cff &&
git commit -m "Update CITATION.cff with latest release date" &&
git push
)
36 changes: 36 additions & 0 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: pypi

on: # yamllint disable-line rule:truthy
release:
types: [published]
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest

environment:
name: pypi repository
url: https://pypi.org/p/pygrin

permissions:
id-token: write

steps:
- uses: actions/checkout@master

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

- name: Build
run: |
pip install setuptools wheel twine build
pip install -r requirements.txt
python -m build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
13 changes: 7 additions & 6 deletions .github/workflows/test.yml → .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Test

on:
on: # yamllint disable-line rule:truthy
push:
branches: [master]
pull_request:
Expand All @@ -15,20 +16,20 @@ jobs:
strategy:
matrix:
python-version: ["3.8", "3.11"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@master

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}

- name: Install package and dependencies
run: |
pip install -U pip setuptools wheel
pip install -r requirements.txt
- name: Test with pytest
run: |
python -m pytest tests/test_back.py
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/update_citation.yaml

This file was deleted.

18 changes: 14 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ laserbeamsize

by Scott Prahl

.. image:: https://img.shields.io/pypi/v/laserbeamsize.svg
.. image:: https://img.shields.io/pypi/v/laserbeamsize?color=green
:target: https://pypi.org/project/laserbeamsize/
:alt: pypi

.. image:: https://img.shields.io/github/v/tag/scottprahl/laserbeamsize?label=github&color=green
:target: https://github.com/scottprahl/laserbeamsize
:alt: github

.. image:: https://img.shields.io/conda/v/conda-forge/laserbeamsize.svg
:target: https://github.com/conda-forge/laserbeamsize-feedstock
:alt: conda
Expand All @@ -21,8 +25,8 @@ by Scott Prahl
:target: https://github.com/scottprahl/laserbeamsize/blob/master/LICENSE.txt
:alt: License

.. image:: https://github.com/scottprahl/laserbeamsize/actions/workflows/test.yml/badge.svg
:target: https://github.com/scottprahl/laserbeamsize/actions/workflows/test.yml
.. image:: https://github.com/scottprahl/laserbeamsize/actions/workflows/test.yaml/badge.svg
:target: https://github.com/scottprahl/laserbeamsize/actions/workflows/test.yaml
:alt: testing

.. image:: https://readthedocs.org/projects/laserbeamsize/badge
Expand Down Expand Up @@ -56,6 +60,12 @@ or ``conda``::
conda install -c conda-forge laserbeamsize


or use immediately by clicking the Google Colaboratory button below

.. image:: https://colab.research.google.com/assets/colab-badge.svg
:target: https://colab.research.google.com/github/scottprahl/laserbeamsize/blob/master
:alt: Colab

Determining the beam size in an image
-------------------------------------

Expand Down Expand Up @@ -176,4 +186,4 @@ the semi-major axis 2.6±0.7 is consistent with the expected value of 3 for the
License
-------

`laserbeamsize` is licensed under the terms of the MIT license.
``laserbeamsize`` is licensed under the terms of the MIT license.
2 changes: 1 addition & 1 deletion laserbeamsize/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
__email__ = 'scott.prahl@oit.edu'
__copyright__ = 'Copyright 2017-23, Scott Prahl'
__license__ = 'MIT'
__url__ = 'https://github.com/scottprahl/laserbeamsize.git'
__url__ = 'https://github.com/scottprahl/laserbeamsize'

from .masks import *
from .image_tools import *
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ install_requires =
imageio

python_requires = >=3.5
zip_safe = True

[build-system]
requires = ["setuptools", "setuptools_scm", "wheel"]
Expand Down

0 comments on commit e726e1f

Please sign in to comment.