Skip to content

Commit

Permalink
Merge ce9962a into 5c3432d
Browse files Browse the repository at this point in the history
  • Loading branch information
aymgal committed Apr 17, 2024
2 parents 5c3432d + ce9962a commit faeea38
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 16 deletions.
80 changes: 72 additions & 8 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Written following the guide:
# Modified from the original version of:
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
name: Publish 📦 to PyPI and TestPyPI

on: push

jobs:
build:
name: Build distribution 📦
name: Build distribution
runs-on: ubuntu-latest

steps:
Expand All @@ -30,27 +30,91 @@ jobs:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/coolest # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: >-
Sign the distribution with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v1.2.3
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
name: Publish distribution to TestPyPI # unlike for PyPI, releases on any push on TestPyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/<package-name>
url: https://test.pypi.org/p/coolest

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
- name: Download the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
- name: Upload to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

16 changes: 11 additions & 5 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# CHANGELOG
# Official releases

## 04/10/22
## v0.1.0 (2023-08-02)

- Version corresponding to the JOSS publication

# Older changes

## 04-10-22

- The `ExternalShear` object has been replaced ba a more general `MassField` object. This is for supporting higher-order lensing fields such as flexion in the future. The two supported types of `LensingEntity` are thus `Galaxy` and `MassField`.

Expand All @@ -9,7 +15,7 @@
- The single parameter of the `GaussianPSF` has changed from the standard deviation `std_dev` to the more widely used full width at half maximum `fwhm`.


## 14/10/22
## 14-10-22

### Major changes:

Expand All @@ -23,7 +29,7 @@
- a 'DOC' mode has been added to the root COOLEST class (for usage with the documentation website, see separate repository)


## 02/06/22
## 02-06-22

### Major changes

Expand All @@ -44,7 +50,7 @@ These affect the template structure:
- COOLEST standard now supports two distinct modes: 'MAP' to store model results, and 'MOCK' for simulating an observation


## 31/05/22
## 31-05-22

### Major changes
Theese affect the template structure:
Expand Down
6 changes: 3 additions & 3 deletions coolest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
"""

# Set the package release version
version_info = (0, 1, 0)
version_info = (0, 1, 2)
__version__ = '.'.join(str(c) for c in version_info)

# Set the package details
__author__ = 'COOLEST developers'
__email__ = 'aymeric.galan@gmail.com'
__year__ = '2021-2023'
__year__ = '2021-2024'
__credits__ = 'COOLEST developers'
__url__ = 'https://github.com/aymgal/COOLEST'
__description__ = 'Standard for Strong Gravitational Lens Modeling'

# Default package properties
__license__ = 'MIT'
__license__ = 'GPL-3.0'
__about__ = ('{} Author: {}, Email: {}, Year: {}, {}'
''.format(__name__, __author__, __email__, __year__,
__description__))
Expand Down
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"]
build-backend = "setuptools.build_meta"
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
readme = f.read()

# Python version
python_requires = '>=3.7'
Expand Down

0 comments on commit faeea38

Please sign in to comment.