Skip to content
Merged
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
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Editor Configuration (http://editorconfig.org)
# This file is used to maintain consistent coding styles between different editors and IDEs
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 88

[*.{json,yml,yaml}]
indent_size = 2

[*.{md,rst}]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- [ ] fix #(issue number)
- [ ] description of feature/fix
- [ ] tests added/passed
- [ ] add an entry to the [changelog](../CHANGELOG.md)
4 changes: 4 additions & 0 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Support

* Start a [discussion topic](https://github.com/pyopensci/pyospackage/discussions)
* Email the authors or maintainers
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: monthly
labels:
- security
- dependency-update
commit-message:
prefix: "chore: bump GitHub Actions"
include: "scope"
open-pull-requests-limit: 5
rebase-strategy: auto
25 changes: 25 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build Documentation

on:
pull_request:
push:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4

- name: Set up Python 3.11
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
with:
python-version: '3.11'
- name: Install hatch
run: |
pipx install hatch

- name: Check docstrings
run: hatch run style:docstrings
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Run linters

on:
pull_request:
push:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4

- name: Set up Python 3.11
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
with:
python-version: '3.11'
- name: Install hatch
run: |
pipx install hatch

- name: Check code style
run: hatch run style:code

- name: Check docstrings
run: hatch run style:docstrings
14 changes: 7 additions & 7 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to PyPI
name: Build & Publish to PyPI
on:
release:
types: [published]
Expand All @@ -18,7 +18,7 @@ jobs:
environment: build
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
with:
# This fetch element is only important if you are use SCM based
# versioning (that looks at git tags to gather the version)
Expand All @@ -29,9 +29,9 @@ jobs:
run: git fetch origin 'refs/tags/*:refs/tags/*'

- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
with:
python-version: "3.10"
python-version: "3.11"
- name: Install Hatch
run: |
pipx install hatch
Expand All @@ -45,7 +45,7 @@ jobs:
ls -lh dist/
# Store an artifact of the build to use in the publish step below
- name: Store the distribution packages
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: python-package-distributions
path: dist/
Expand All @@ -66,11 +66,11 @@ jobs:
steps:
# Version 4 doesn't support GitHub enterprise yet
- name: Download all the dists
uses: actions/download-artifact@v4
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: python-package-distributions
path: dist/
- name: Publish package to PyPI
# Only publish to real PyPI on release
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
77 changes: 77 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Publish to PyPI

on:
release:
types: [published]

jobs:
prerequisites:
uses: ./.github/workflows/test.yml
# Setup build separate from publish for added security
# See https://github.com/pypa/gh-action-pypi-publish/issues/217#issuecomment-1965727093
build:
needs: [prerequisites]
runs-on: ubuntu-latest
# Environment is encouraged for increased security
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# This fetch element is only important if you are use SCM based
# versioning (that looks at git tags to gather the version).
# setuptools-scm needs tags to form a valid version number
fetch-tags: true

- name: Setup Python
uses: actions/setup-python@v5
with:
# You can modify what version of Python you want to use for your release
python-version: "3.11"

# Whenever possible, pin your project development dependencies to a specific version
- name: Install Hatch
run: |
pip install hatch==1.15.1

- name: Build package using Hatch
run: |
hatch build
echo ""
echo "Generated files:"
ls -lh dist/

# Store an artifact of the build to use in the publish step below
- name: Store the distribution packages
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 #v5.0.0
with:
name: python-package-distributions
path: dist/
if-no-files-found: error
publish:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
# Modify the repo name below to be your project's repo name.
if: github.repository_owner == "pyopensci"
needs:
- build
runs-on: ubuntu-latest
# Environment required here for trusted publisher
# You can set permissions for this environment so it can only be used by
# certain people
environment:
name: pypi
# Modify the url to be the name of your package
url: https://pypi.org/p/pyospackage
permissions:
id-token: write # this permission is mandatory for PyPI publishing
steps:
- name: Download dists
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 #v6.0.0
with:
name: python-package-distributions
path: dist/
merge-multiple: true
- name: Publish package to PyPI
# Only publish to real PyPI on release
if: github.event_name == 'release' && github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Run Test Suite

on:
pull_request:
push:
branches:
- main
schedule:
# run tests at 00:00 UTC on day 1 of every month
- cron: '0 0 1 * *'

jobs:
lint:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Hatch
run: |
pip install hatch==1.15.1

- name: Build documentation
run: hatch run docs:build
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.11", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v5
with:
python-version: ${{ matrix.python-version }}
- name: Install hatch
uses: pypa/hatch@install

- name: Check dependencies
run: hatch run audit:check

- name: Test suite
run: hatch run +py=${{ matrix.python-version }} test:run

- name: Report coverage
shell: bash
run: bash <(curl -s https://codecov.io/bash)
Loading
Loading