Skip to content

Commit

Permalink
Merge pull request #1 from YannickAlex07/prepare-for-launch
Browse files Browse the repository at this point in the history
Prepare for Launch
  • Loading branch information
YannickAlex07 authored Aug 6, 2024
2 parents 7b934cb + b25092c commit a63c83a
Show file tree
Hide file tree
Showing 13 changed files with 441 additions and 52 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @yannickalex07
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "

labels: ["type: bug"]

assignees:
- yannickalex07

body:
- type: markdown
attributes:
value: |
Thank you for supporting this crate by reporting a bug!
Please make sure that you check if any issue related to the issue already exists.
- type: input
id: version
attributes:
label: Version
description: "Which version of the package are you using?"
placeholder: "1.0.0"
validations:
required: true

- type: textarea
id: description
attributes:
label: Describe the Bug
description: What happened and what did you expect?
validations:
required: true

- type: dropdown
id: platform
validations:
required: true
attributes:
label: On which platform did you observe this bug?
multiple: true
options:
- MacOS
- Windows
- Linux
- Other
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Feature Request
description: Request a new feature
title: "[Feature]: "

labels: ["type: feature"]

assignees:
- yannickalex07

body:
- type: markdown
attributes:
value: |
Thank you for supporting this package by requesting a new feature!
- type: textarea
id: description
attributes:
label: Describe the Feature
description: Please describe the feature you would like to see implemented and why.
validations:
required: true
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/optimization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Optimization
description: Point out something that should be optimized
title: "[Optimization]: "

labels: ["type: optimization"]

assignees:
- yannickalex07

body:
- type: markdown
attributes:
value: |
Thank you for supporting this package by pointing out an optimization!
- type: textarea
id: description
attributes:
label: Describe the Optimization
description: Please describe what could be optimized and why. If possible, provide a solution.
validations:
required: true
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/other.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Other Issues
description: Anything else that you would like to discuss
title: "[Other]: "

labels: ["type: unspecified"]

assignees:
- yannickalex07

body:
- type: markdown
attributes:
value: |
Thank you for supporting this package by creating a new issue!
This is an unspecified issue, so feel free to discuss anything you would like.
Just make sure you are thorough in your description.
- type: textarea
id: description
attributes:
label: What is on your mind?
description: Please describe what you would like to discuss.
validations:
required: true
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Overview

<!-- Describe what this PR is adding / changing and why it is done -->

## Checklist

- [ ] Tests
- [ ] Documentation
- [ ] Updated Version in `pyproject.toml`

## Related Tasks

<!-- Link the task that is related to this if applicable. If not, remove this section. -->

*
86 changes: 86 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Checks

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- name: Setup Poetry
uses: Gr1N/setup-poetry@v8

- name: Install Dependencies
run: poetry install

- name: Compile Bindings
run: poetry run maturin develop

- name: Run Tests
run: poetry run pytest tests/

lint:
name: Linting
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Setup Poetry
uses: Gr1N/setup-poetry@v8

- name: Install Dependencies
run: poetry install

- name: Run Ruff Linter
run: poetry run ruff check -v

format:
name: Formatting
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Setup Poetry
uses: Gr1N/setup-poetry@v8

- name: Install Dependencies
run: poetry install

- name: Run Ruff Linter
run: poetry run ruff format --check -v
151 changes: 151 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: Release

on:
release:
types:
- published

permissions:
contents: read

jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
- runner: ubuntu-latest
target: x86
- runner: ubuntu-latest
target: aarch64
- runner: ubuntu-latest
target: armv7
- runner: ubuntu-latest
target: s390x
- runner: ubuntu-latest
target: ppc64le
python:
- 3.10
- 3.11
- 3.12
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Build Wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
manylinux: auto

- name: Upload Wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}-${{ matrix.python }}
path: dist

windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: windows-latest
target: x64
- runner: windows-latest
target: x86
python:
- 3.10
- 3.11
- 3.12
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.platform.target }}

- name: Build Wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'

- name: Upload Wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.platform.target }}-${{ matrix.python }}
path: dist

macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: macos-latest
target: x86_64
- runner: macos-14
target: aarch64
python:
- 3.10
- 3.11
- 3.12
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Build Wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'

- name: Upload Wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}-${{ matrix.python }}
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist

- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist

release:
name: Release
runs-on: ubuntu-latest
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v4

- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ __pycache__/
*.py[cod]
*$py.class

# Ruff Cache
.ruff_cache/

# C extensions
*.so

Expand Down
Loading

0 comments on commit a63c83a

Please sign in to comment.