Skip to content

Commit 2a71946

Browse files
author
Andrew J Westlake
committed
Added more .github templates/workflows, added some badges to README, testing gh-pages deployment
1 parent 5d67922 commit 2a71946

File tree

5 files changed

+116
-2
lines changed

5 files changed

+116
-2
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "cargo" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/issue_template.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## 🐛 Bug Reports
2+
3+
When reporting a bug, please provide the following information. If this is not a bug report you can just discard this template.
4+
5+
### 🌍 Environment
6+
7+
- Your operating system and version:
8+
- Your python version:
9+
- How did you install python (e.g. apt or pyenv)? Did you use a virtualenv?:
10+
- Your Rust version (`rustc --version`):
11+
- Your PyO3 version:
12+
- Have you tried using latest PyO3 master (replace `version = "0.x.y"` with `git = "https://github.com/awestlake87/pyo3-asyncio")?`:
13+
14+
### 💥 Reproducing
15+
16+
Please provide a [minimal working example](https://stackoverflow.com/help/mcve). This means both the Rust code and the Python.
17+
18+
Please also write what exact flags are required to reproduce your results.

.github/pull_request_template.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Thank you for contributing to pyo3-asyncio!
2+
3+
Please consider adding the following to your pull request:
4+
- an entry in CHANGELOG.md
5+
- docs to all new functions and / or detail in the guide
6+
- tests for all new or changed functions
7+
8+
Be aware the CI pipeline will check your pull request for the following:
9+
- Rust tests (Just `cargo test`)
10+
- Rust lints (`make clippy`)
11+
- Rust formatting (`cargo fmt`)
12+
- Python formatting (`black . --check`. You can install black with `pip install black`)

.github/workflows/guide.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: gh-pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
release:
8+
types: [published]
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
tag_name: ${{ steps.prepare_tag.outputs.tag_name }}
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
# This adds the docs to gh-pages-build/doc
22+
- name: Build the doc
23+
run: |
24+
cargo doc --features="default num-bigint num-complex" --no-deps
25+
cp -r target/doc gh-pages-build/doc
26+
echo "<meta http-equiv=refresh content=0;url=pyo3/index.html>" > gh-pages-build/doc/index.html
27+
28+
- name: Prepare tag
29+
id: prepare_tag
30+
run: |
31+
TAG_NAME="${GITHUB_REF##*/}"
32+
echo "::set-output name=tag_name::${TAG_NAME}"
33+
34+
- name: Deploy
35+
uses: peaceiris/[email protected]
36+
with:
37+
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
publish_dir: ./gh-pages-build/
39+
destination_dir: ${{ steps.prepare_tag.outputs.tag_name }}
40+
full_commit_message: 'Upload documentation for ${{ steps.prepare_tag.outputs.tag_name }}'
41+
42+
release:
43+
needs: deploy
44+
runs-on: ubuntu-latest
45+
if: ${{ github.event_name == 'release' }}
46+
steps:
47+
- name: Create latest tag redirect
48+
env:
49+
TAG_NAME: ${{ needs.deploy.outputs.tag_name }}
50+
run: |
51+
mkdir public
52+
echo "<meta http-equiv=refresh content=0;url='$TAG_NAME/'>" > public/index.html
53+
54+
- name: Deploy
55+
uses: peaceiris/[email protected]
56+
with:
57+
github_token: ${{ secrets.GITHUB_TOKEN }}
58+
publish_dir: ./public/
59+
full_commit_message: 'Release ${{ needs.deploy.outputs.tag_name }}'
60+
keep_files: true

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
# Overview
1+
# PyO3 Asyncio
2+
3+
[![Actions Status](https://github.com/awestlake87/pyo3-asyncio/workflows/Test/badge.svg)](https://github.com/awestlake87/pyo3-asyncio/actions)
4+
[![codecov](https://codecov.io/gh/awestlake87/pyo3-asyncio/branch/master/graph/badge.svg)](https://codecov.io/gh/awestlake87/pyo3-asyncio)
5+
[![crates.io](http://meritbadge.herokuapp.com/pyo3-asyncio)](https://crates.io/crates/pyo3-asyncio)
6+
[![minimum rustc 1.45](https://img.shields.io/badge/rustc-1.45+-blue.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html)
7+
8+
[Rust](http://www.rust-lang.org/) bindings for [Python](https://www.python.org/). This includes running and interacting with Python code from a Rust binary, as well as writing native Python modules.
9+
10+
* API Documentation: [stable](https://docs.rs/pyo3-asyncio/)
11+
12+
* Contributing Notes: [github](https://github.com/awestlake87/pyo3-asyncio/blob/master/Contributing.md)
13+
14+
## Overview
215

316
This project contains an example of Python 3 asyncio and Tokio interop. It's
417
designed to allow Python complete control over the main thread and facilitate
@@ -22,7 +35,7 @@ awaits a Python coroutine that awaits a Rust future that panics.
2235

2336
> These scenarios are currently untested in this crate.
2437
25-
# Running the Test
38+
## Running the Test
2639

2740
You can run the example test the same way you'd run any other Cargo integration
2841
test.

0 commit comments

Comments
 (0)