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

Add ci for wheels and .pyi #4

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
158 changes: 158 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: CI

on:
push:
branches:
- main
tags:
- "*.*.*"
pull_request:

jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
manylinux: auto
command: build
args: --release -o dist --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

# Docker with Apple Silicon
manylinux-aarch64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
target: aarch64-unknown-linux-gnu
command: build
args: --release -o dist --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

# ARM7
armv7:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
target: armv7
command: build
args: --release -o dist --find-interpreter
container: messense/manylinux_2_24-cross:armv7
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

musllinux-x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
target: x86_64
command: build
args: --release -o dist --find-interpreter
manylinux: musllinux_1_1
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

musllinux-aarch64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
target: aarch64
command: build
args: --release -o dist --find-interpreter
manylinux: musllinux_1_1
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
command: build
args: --release -o dist --universal2 --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: Swatinem/rust-cache@v2
- uses: messense/maturin-action@v1
with:
command: build
args: --release -o dist --universal2 --find-interpreter
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

# release:
# name: Release
# runs-on: ubuntu-latest
# if: "startsWith(github.ref, 'refs/tags/')"
# needs:
# [
# macos,
# linux,
# windows,
# manylinux-aarch64,
# armv7,
# musllinux-x86_64,
# musllinux-aarch64,
# ]
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: wheels
# - name: Publish to PyPI
# uses: messense/maturin-action@v1
# env:
# MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
# with:
# command: upload
# args: --skip-existing *
20 changes: 0 additions & 20 deletions .github/workflows/rust.yml

This file was deleted.

18 changes: 18 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[build-system]
requires = ["maturin>=0.13,<0.14"]
build-backend = "maturin"

[project]
name = "regex"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
description = "A port of the Rust regex library to python for super speed linear matching."

[project.urls]
"Source Code" = "https://github.com/litmus-web/Python-Regex"
Issues = "https://github.com/litmus-web/Python-Regex/issues"
Documentation = "https://github.com/litmus-web/Python-Regex"
28 changes: 28 additions & 0 deletions regex.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from typing import Optional, List

from typing_extensions import Tuple

class Regex(object):
...

def is_match(self, other: str) -> bool: ...

def is_match_at(self, other: str, start: int) -> bool: ...

def find(self, other: str) -> Optional[str]: ...

def findall(self, other: str) -> List[str]: ...

def all_captures(self, other: str) -> List[List[Optional[str]]]: ...

def captures(self, other: str) -> Optional[List[Optional[str]]]: ...

def matches(self, other: str) -> List[Tuple[int, int]]: ...


class RegexSet(object):
...

def is_match(self, other: str) -> bool: ...

def find(self, other: str) -> List[int]: ...
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
maturin
typing-extensions