Skip to content

Commit

Permalink
Publish to PyPI and RTD
Browse files Browse the repository at this point in the history
  • Loading branch information
nichollsh committed Sep 9, 2024
1 parent 86c2285 commit 75da4f0
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish on PyPI

on:
release:
types: [published]
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build setuptools>=61.2 wheel
python -m build --no-isolation
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
24 changes: 24 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the docs/ directory with Sphinx
mkdocs:
configuration: mkdocs.yml

# Optionally declare the Python requirements required to build your docs
python:
install:
- method: pip
path: .
extra_requirements:
- docs
1 change: 1 addition & 0 deletions docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{!../CODE_OF_CONDUCT.md!}
1 change: 1 addition & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{!../CONTRIBUTING.md!}
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{!../README.md!}
Empty file added docs/stylesheets/extra.css
Empty file.
67 changes: 67 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
site_name: CALLIOPE
site_url: https://fwl-calliope.readthedocs.io
repo_url: https://github.com/FormingWorlds/CALLIOPE
repo_name: GitHub

nav:
- Home: index.md
- Getting started: getting_started.md
- Contributing: CONTRIBUTING.md
- Code of Conduct: CODE_OF_CONDUCT.md
- 🔗 Source code: https://github.com/FormingWorlds/CALLIOPE
- 🔗 Issues: https://github.com/FormingWorlds/CALLIOPE/issues

theme:
name: material
palette:
primary: black
accent: deep orange

extra_css:
- stylesheets/extra.css

markdown_extensions:
- admonition
- attr_list
- markdown_include.include:
base_path: docs
- pymdownx.extra
- pymdownx.arithmatex:
generic: true

extra_javascript:
- https://polyfill.io/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

plugins:
- search
- mkdocstrings:
# https://mkdocstrings.github.io/usage/
handlers:
python:
paths: [src]
import:
- https://installer.readthedocs.io/en/stable/objects.inv
- https://numpy.org/doc/stable/objects.inv
- https://docs.scipy.org/doc/scipy/objects.inv
- https://pandas.pydata.org/docs/objects.inv
- https://matplotlib.org/stable/objects.inv
options:
docstring_style: numpy
docstring_options:
ignore_init_summary: yes
show_submodules: no
show_source: true
show_root_heading: false
show_root_full_path: false
docstring_section_style: list
members_order: alphabetical
merge_init_into_class: yes
filters: ["!^_"]

watch:
- src/
- docs/
- README.md
- CONTRIBUTING.md
- CODE_OF_CONDUCT.md

0 comments on commit 75da4f0

Please sign in to comment.