Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use reusable CI workflow for automated PyPI/GitHub release, add pre-commit for each PR, simplify issue templates #46

Merged
merged 13 commits into from
Oct 27, 2024
Merged
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Bug Report or Feature Request
about: Report a bug or suggest a new feature!
title: ""
labels: ""
assignees: ""
---

### Problem

<!--
For a bug report, please copy and paste any error messages from the application or command-line here.
For a feature request, please state how the new functionality could benefit the community.
-->

### Proposed solution
27 changes: 0 additions & 27 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

19 changes: 0 additions & 19 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Release
about: Checklist and communication channel for PyPI and GitHub release
title: "Ready for <version-number> PyPI/GitHub release"
labels: "release"
assignees: ""
---

### Release checklist for GitHub contributors

- [ ] All PRs/issues attached to the release are merged.
- [ ] All the badges on the README are passing.
- [ ] License information is verified as correct. If you are unsure, please comment below.
- [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are
missing), tutorials, and other human written text is up-to-date with any changes in the code.
- [ ] Installation instructions in the README, documentation and on the website (e.g., diffpy.org) are updated and
tested
- [ ] Successfully run any tutorial examples or do functional testing in some other way.
- [ ] Grammar and writing quality have been checked (no typos).

Please mention @sbillinge when you are ready for release. Include any additional comments necessary, such as
version information and details about the pre-release.
21 changes: 0 additions & 21 deletions .github/pull_request_template.md

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/build-wheel-release-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ jobs:
with:
project: cifkit
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
35 changes: 0 additions & 35 deletions .github/workflows/build-wheels-publish.yml

This file was deleted.

28 changes: 4 additions & 24 deletions .github/workflows/check-news-item.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
name: Check News Item
name: Check for News

on:
pull_request_target:
branches:
- main

permissions:
pull-requests: write
contents: read

jobs:
build:
runs-on: ubuntu-latest
name: Check News item
steps:

# note: the checkout will pull code from the base branch. This step should not pull code from the merge commit
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: 'pyproject.toml'
- run: pip install PyGithub
- run: python .github/workflows/check-news.py
env:
PR_NUMBER: "${{ github.event.number }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_REPOSITORY: "${{ env.GITHUB_REPOSITORY }}"
uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@{{ VERSION/v0 }}
with:
project: cifkit
64 changes: 0 additions & 64 deletions .github/workflows/check-news.py

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/release.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/tests-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches:
- main
pull_request:

jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

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

- name: Create virtual environment and install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install .

- name: Test with pytest and generate coverage report
run: |
source venv/bin/activate
pip install pytest pytest-cov
python -m pytest -m "not pyvista" --cov=./ --cov-report=xml

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ repos:
hooks:
- id: check-yaml
- id: end-of-file-fixer
exclude: '\.cif$'
- id: trailing-whitespace
exclude: '\.cif$'
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
[![PyPi version](https://img.shields.io/pypi/v/cifkit.svg)](https://pypi.python.org/pypi/cifkit)
[![Conda version](https://img.shields.io/conda/vn/conda-forge/cifkit)](https://anaconda.org/conda-forge/cifkit)


<a href="https://joss.theoj.org/papers/9016ae27b8c6fddffaae5aeb8be18d19"><img src="https://joss.theoj.org/papers/9016ae27b8c6fddffaae5aeb8be18d19/status.svg"></a>

![Logo light mode](docs/assets/img/logo-black.png#gh-light-mode-only "cifkit logo light")
Expand Down
24 changes: 24 additions & 0 deletions news/pre-commit.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
**Added:**

* pre-commit hook for each pull request
* automated PyPI

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* Simpler issue templates used in Billinge Group

**Security:**

* <news item>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "cifkit"
dynamic=['version', 'dependencies']
requires-python = ">=3.10"
requires-python = ">=3.10, <3.13"
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
Expand Down
Loading