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

Preparing public release #24

Merged
merged 3 commits into from
Oct 6, 2023
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
5 changes: 3 additions & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 7a70b18
_src_path: gh:Matgenix/Matgenix-copier-template
_commit: d0e6447
_src_path: [email protected]:Matgenix/Matgenix-copier-template
author_email: [email protected]
author_fullname: David Waroquiers
author_username: davidwaroquiers
Expand All @@ -15,3 +15,4 @@ repository_namespace: matgenix
repository_provider: https://github.com
short_description: QToolKit is a python wrapper interfacing with job queues (e.g.
PBS, SLURM, ...).

89 changes: 89 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Publish and Deploy

on:
release:
types:
- published

env:
PUBLISH_UPDATE_BRANCH: main
GIT_USER_NAME: Matgenix
GIT_USER_EMAIL: "[email protected]"

jobs:

publish:
name: Publish package
runs-on: ubuntu-latest
if: github.repository == 'matgenix/qtoolkit' && startsWith(github.ref, 'refs/tags/v')

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install Python dependencies
run: |
python -m pip install -U pip
pip install -U setuptools wheel
pip install -e .[all]

- name: Update changelog
uses: CharMixer/auto-changelog-action@v1
with:
token: ${{ secrets.RELEASE_PAT_BOT }}
release_branch: ${{ env.PUBLISH_UPDATE_BRANCH }}
exclude_labels: "duplicate,question,invalid,wontfix,dependency_updates,skip_changelog"

- name: Update '${{ env.PUBLISH_UPDATE_BRANCH }}'
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.RELEASE_PAT_BOT }}
branch: ${{ env.PUBLISH_UPDATE_BRANCH }}
unprotect_reviews: true
sleep: 15
force: true
tags: true

- name: Get tagged versions
run: echo "PREVIOUS_VERSION=$(git tag -l --sort -version:refname | sed -n 2p)" >> $GITHUB_ENV

- name: Create release-specific changelog
uses: CharMixer/auto-changelog-action@v1
with:
token: ${{ secrets.RELEASE_PAT_BOT }}
release_branch: ${{ env.PUBLISH_UPDATE_BRANCH }}
since_tag: "${{ env.PREVIOUS_VERSION }}"
output: "release_changelog.md"
exclude_labels: "duplicate,question,invalid,wontfix,dependency_updates,skip_changelog"

- name: Append changelog to release body
run: |
gh api /repos/${{ github.repository }}/releases/${{ github.event.release.id }} --jq '.body' > release_body.md
cat release_changelog.md >> release_body.md
gh api /repos/${{ github.repository }}/releases/${{ github.event.release.id }} -X PATCH -F body='@release_body.md'
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT_BOT }}

- name: Build source distribution
run: python -m build

- name: Publish package to Test PyPI first
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository-url: https://test.pypi.org/legacy/

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
42 changes: 21 additions & 21 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'
cache: pip
cache-dependency-path: pyproject.toml

Expand All @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3
Expand All @@ -49,22 +49,22 @@ jobs:
- name: Test
run: pytest --cov=qtoolkit --cov-report=xml

# docs:
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v3
#
# - uses: actions/setup-python@v4
# with:
# python-version: '3.11'
# cache: pip
# cache-dependency-path: pyproject.toml
#
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install .[strict,docs]
#
# - name: Build
# run: jupyter-book build docs --path-output docs_build
docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: pip
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[strict,docs]

- name: Build
run: jupyter-book build docs --path-output docs_build
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ repos:
- id: fix-encoding-pragma
args: [--remove]
- id: end-of-file-fixer
exclude: .copier-answers.yml
- id: trailing-whitespace
- repo: https://github.com/myint/autoflake
rev: v2.0.0
Expand Down Expand Up @@ -67,4 +68,4 @@ repos:
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py38-plus]
args: [--py39-plus]
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Contributing to QToolKit

Full name is Queue Tool Kit

We love your input! We want to make contributing to as easy and
transparent as possible, whether it's:

Expand Down Expand Up @@ -64,6 +62,9 @@ We have a few tips for writing good PRs that are accepted into the main repo:
to python](https://docs.python-guide.org/writing/tests) for some good
resources on writing good tests.
- Understand your contributions will fall under the same license as this repo.
- This project uses `pre-commit` for uniform linting across many developers. You can install
it through the extra dev dependencies with `pip install -e .[dev]` and then run `pre-commit install`
to activate it for you local repository.

When you submit your PR, our CI service will automatically run your tests.
We welcome good discussion on the best ways to write your code, and the comments
Expand Down
20 changes: 20 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Installation

Clone this repository and then install with `pip` in the virtual environment of your choice.

```
git clone git@https://github.com:matgenix/qtoolkit
cd qtoolkit
pip install .
```

## Development installation

You can use

```
pip install -e .[dev,tests]
```

to perform an editable installation with additional development and test dependencies.
You can then activate `pre-commit` in your local repository with `pre-commit install`.
38 changes: 10 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,20 @@
# QToolKit

[![tests](https://img.shields.io/github/actions/workflow/status/matgenix/qtoolkit/testing.yml?branch=main&label=tests)](https://github.com/matgenix/qtoolkit/actions?query=workflow%3Atesting)
[![tests](https://img.shields.io/github/actions/workflow/status/matgenix/qtoolkit/testing.yml?branch=main&label=tests)](https://github.com/matgenix/qtoolkit/actions/workflows/testing.yml)
[![code coverage](https://img.shields.io/codecov/c/gh/matgenix/qtoolkit)](https://codecov.io/gh/matgenix/qtoolkit)
[![pypi version](https://img.shields.io/pypi/v/qtoolkit?color=blue)](https://pypi.org/project/qtoolkit)
![supported python versions](https://img.shields.io/pypi/pyversions/qtoolkit)

** [Full Documentation][docs] **
**[Full Documentation][docs]**

QToolKit is a python software for ... Features of QToolKit include

- Feature A
- Feature B
- ...

## Quick start

How to get started.

## Installation

How to install.

## User guide

How to use the software.
> **Warning**:
> :construction: This repository is still under construction. :construction:

## Need help?

Ask questions about QToolKit on the [QToolKit support forum][help-forum].
If you've found an issue with QToolKit, please submit a bug report on [GitHub Issues][issues].

## Reference

Full reference

## What’s new?

Track changes to qtoolkit through the [changelog][changelog].
Expand All @@ -60,11 +41,12 @@ QToolKit is developed and maintained by Matgenix SRL.

A full list of all contributors can be found [here][contributors].

[help-forum]: https://github.com/materialsproject/atomate2/issues
[issues]: https://github.com/materialsproject/atomate2/issues
[installation]: https://matgenix.github.io/qtoolkit/user/install.html
[help-forum]: https://https://github.com/matgenix/qtoolkit/issues
[issues]: https://https://github.com/matgenix/qtoolkit/issues
[installation]: https://https://github.com/matgenix/qtoolkit/blob/main/INSTALL.md
[contributing]: https://github.com/matgenix/qtoolkit/blob/main/CONTRIBUTING.md
[codeofconduct]: https://github.com/matgenix/qtoolkit/blob/main/CODE_OF_CONDUCT.md
[contributors]: https://matgenix.github.io/qtoolkit/about/contributors.html
[license]: https://raw.githubusercontent.com/matgenix//main/LICENSE
[changelog]: https://https://github.com/matgenix/qtoolkit/blob/main/CHANGELOG.md
[contributors]: https://matgenix.github.io/qtoolkit/graphs/contributors
[license]: https://raw.githubusercontent.com/matgenix/qtoolkit/main/LICENSE
[docs]: https://matgenix.github.io/qtoolkit/
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ authors = [{ name = "David Waroquiers", email = "[email protected]"
dynamic = ["version"]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -24,8 +23,8 @@ classifiers = [
"Topic :: Other/Nonlisted Topic",
"Topic :: Scientific/Engineering",
]
requires-python = ">=3.8"
dependencies = []
requires-python = ">=3.9"
dependencies =[]

[project.optional-dependencies]
dev = [
Expand Down Expand Up @@ -73,7 +72,7 @@ max-line-length = 88
max-doc-length = 88
select = "C, E, F, W, B"
extend-ignore = "E203, W503, E501, F401, RST21"
min-python-version = "3.8.0"
min-python-version = "3.9.0"
docstring-convention = "numpy"
rst-roles = "class, func, ref, obj"

Expand Down