Skip to content
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
4 changes: 4 additions & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
*

# Except
!actions/
!actions/*
!ISSUE_TEMPLATE/
!ISSUE_TEMPLATE/*
!workflows/
!workflows/*

!.gitignore
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
*

# Except
!bug_report.yaml
!feature_request.yaml
!bug_report.yml
!feature_request.yml
!question.md

!.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug report
description: Are you experiencing a problem? Create a report to help us improve!
labels: "bug"
labels: ["bug"]
body:
- type: markdown
attributes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Feature Request
description: Want a feature? Ask; we don't bite!
labels: 'enhancement'
labels: ["enhancement"]
body:
- type: markdown
attributes:
Expand All @@ -24,4 +24,4 @@ body:
description: If so, specify
- type: input
attributes:
label: Additional context
label: Additional context
12 changes: 12 additions & 0 deletions .github/actions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Ignore everything
*

# Except
!build_regex_toolkit/
!build_regex_toolkit/*
!run-tests/
!run-tests/*
!setup-conda/
!setup-conda/*

!.gitignore
7 changes: 7 additions & 0 deletions .github/actions/build_regex_toolkit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ignore everything
*

# Except
!action.yml

!.gitignore
15 changes: 15 additions & 0 deletions .github/actions/build_regex_toolkit/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build regex_toolkit
description: Build regex_toolkit
runs:
using: composite
steps:
- name: Environment Detail
run: |
micromamba info
micromamba list
shell: bash -el {0}

- name: Build Regex-Toolkit
run: |
python -m pip install -e . --no-build-isolation --no-index
shell: bash -el {0}
7 changes: 7 additions & 0 deletions .github/actions/run-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ignore everything
*

# Except
!action.yml

!.gitignore
31 changes: 31 additions & 0 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run tests and report results
description: Run tests and report results
# inputs:
# codecov-token:
# description: Codecov token for private repo.

runs:
using: composite
steps:
- name: Test
run: ci/run_tests.sh
shell: bash -el {0}

- name: Publish Test Results
uses: actions/upload-artifact@v2
with:
name: Test results
path: test-data.xml

- name: Report Coverage
run: coverage report -m
shell: bash -el {0}

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
# token: ${{ inputs.codecov-token }}
files: ./coverage.xml
flags: unittests
name: regex_toolkit
fail_ci_if_error: false
7 changes: 7 additions & 0 deletions .github/actions/setup-conda/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ignore everything
*

# Except
!action.yml

!.gitignore
23 changes: 23 additions & 0 deletions .github/actions/setup-conda/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Set up Conda environment
description: Set up Conda environment
inputs:
environment-file:
description: Conda environment file to use.
default: environment.yml
environment-name:
description: Name to use for the Conda environment.
default: test

runs:
using: composite
steps:
- name: Install ${{ inputs.environment-file }}
uses: mamba-org/provision-with-micromamba@v12
with:
environment-file: ${{ inputs.environment-file }}
environment-name: ${{ inputs.environment-name }}
channels: conda-forge
channel-priority: ${{ runner.os == 'macOS' && 'flexible' || 'strict' }}
condarc-file: ci/condarc.yml
cache-env: true
cache-downloads: true
9 changes: 9 additions & 0 deletions .github/workflows/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Ignore everything
*

# Except
!stale-pr.yml
!ubuntu.yml
windows-macos.yml

!.gitignore
26 changes: 26 additions & 0 deletions .github/workflows/stale-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Stale PRs"
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 0 * * *"

permissions:
contents: read

jobs:
stale:
permissions:
pull-requests: write
runs-on: ubuntu-22.04
steps:
- uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: "This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this."
stale-pr-label: "Stale"
exempt-pr-labels: "Needs Review,Blocked,Needs Discussion"
days-before-issue-stale: -1
days-before-pr-stale: 30
days-before-close: -1
remove-stale-when-updated: false
debug-only: false
54 changes: 54 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Ubuntu

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
paths-ignore: ["docs/**"]

env:
REGEX_TOOLKIT_CI: 1

permissions:
contents: read

jobs:
pytest:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -el {0}
timeout-minutes: 60
strategy:
matrix:
env_file: [actions-310.yml, actions-311.yml]
fail-fast: false
# name: ${{ matrix.name || matrix.env_file }}
name: ${{ matrix.env_file }}
env:
ENV_FILE: ci/deps/${{ matrix.env_file }}
IS_PYPY: ${{ contains(matrix.env_file, 'pypy') }}
concurrency:
# https://github.community/t/concurrecy-not-work-for-push/183068/7
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.env_file }}
cancel-in-progress: true

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Conda
uses: ./.github/actions/setup-conda
with:
environment-file: ${{ env.ENV_FILE }}

- name: Build Regex-Toolkit
uses: ./.github/actions/build_regex_toolkit

- name: Test
uses: ./.github/actions/run-tests
# with:
# codecov-token: ${{ secrets.CODECOV_TOKEN }}
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
!setup.py
!pyproject.toml
!Makefile
!environment.yml
!codecov.yml
!requirements-doc.txt

!src/
!src/*

!tests/
!tests/*
!ci/
!ci/*
!docs/
!docs/*

!LICENSE
!README.md
Expand Down
29 changes: 26 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,34 @@ PYTHON=python3
install:
${PYTHON} -m pip install .

install-dev:
${PYTHON} -m pip install -e .

test:
${PYTHON} setup.py test
${PYTHON} -m pytest tests

lint:
${PYTHON} -m pylint src

format:
${PYTHON} -m isort src tests docs/render_readme.py
${PYTHON} -m black src tests docs/render_readme.py

build:
${PYTHON} setup.py build
@echo 'Building package'
${PYTHON} -m build
@echo 'Done'

publish:
${PYTHON} setup.py publish
@echo 'Building package'
${PYTHON} -m build
@echo 'Uploading package'
${PYTHON} -m twine upload dist/yogger-*.tar.gz dist/yogger-*.whl
@echo 'Done'

readme:
@echo 'Generating README.md'
@cd docs && ${PYTHON} render_readme.py
@echo 'Copying README.md'
@cp ./docs/README.md ./README.md
@echo 'Done'
Loading