Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
feat: Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
iwishiwasaneagle committed Mar 5, 2023
1 parent 5efb48d commit 29ad640
Show file tree
Hide file tree
Showing 22 changed files with 1,235 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# .coveragerc to control coverage.py
[run]
branch = True
source = pytest-extra-markers
# omit = bad_file.py

[paths]
source =
src/
*/site-packages/

[report]
# Regexes for lines to exclude from consideration
omit =
*/_argparse_utils.py

exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
pragma: no branch

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
pass

# Don't complain if a argparse function is hit
def add_subparser
def add_args

# Typpe checking related
if TYPE_CHECKING:
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!src/extra_markers.py
!requirements.txt
16 changes: 16 additions & 0 deletions .docstr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2023 Jan-Hendrik Ewers
# SPDX-License-Identifier: GPL-3.0-only

paths:
- src/
badge: docstr-cov
verbose: 2 # (0-4)
skip_magic: True
skip_file_doc: False
skip_init: True
skip_class_def: False
skip_private: False
follow_links: False
accept_empty: False
fail_under: 95
percentage_only: False
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2023 Jan-Hendrik Ewers
# SPDX-License-Identifier: GPL-3.0-only

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
123 changes: 123 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Copyright 2023 Jan-Hendrik Ewers
# SPDX-License-Identifier: GPL-3.0-only

name: CD

on:
workflow_dispatch:
push:
tags:
- "v*.*.*"

jobs:
setup-envs:
name: Set up the build names and such
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Version
id: version
shell: bash
run: |
v=${GITHUB_REF##*/}
echo "Version: $v"
echo "::set-output name=version::$v"
- name: Check version
shell: bash
run: |
rx='^v([0-9]+\.){0,2}(\*|[0-9]+)$'
VERSION=${{steps.version.outputs.version}}
if [[ $VERSION =~ $rx ]]; then
echo "INFO:<-->Version $VERSION"
else
echo "ERROR:<->Unable to validate package version: '$VERSION'"
exit 1
fi
generate-changelog:
name: Generate latest changelog
needs: setup-envs
runs-on: ubuntu-latest
outputs:
release_body: ${{ steps.release.outputs.release_body }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Generate latest changelog
uses: orhun/git-cliff-action@v2
id: git-cliff-latest
with:
args: -vv --latest --strip header
env:
OUTPUT: CHANGELOG.md

- name: Check CHANGELOG isn't empty
run: |
if [ -z "$(cat CHANGELOG.md)" ]
then
exit 1
fi
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: changelog
path: CHANGELOG.md

build-python:
name: Build python
needs: setup-envs
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true

- name: Build wheels
run: pip wheel .

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: pytest-extra-markers*.whl

publish-github:
name: Publish on GitHub
needs: [generate-changelog,build-python,setup-envs]
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: dist

- name: Download changelog
uses: actions/download-artifact@v3
with:
name: changelog

- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body_path: CHANGELOG.md
files: |
dist/**
name: "Release ${{needs.setup-envs.outputs.version}}"
generate_release_notes: false
58 changes: 58 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2023 Jan-Hendrik Ewers
# SPDX-License-Identifier: GPL-3.0-only

name: CI

on:
push:
branches: [master, dev]
pull_request:
workflow_dispatch:

jobs:
run-tests:
name: Run tests
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash -l {0}

strategy:
max-parallel: 1
matrix:
python-versioin: ["3.11", "3.10", "3.9"]
platform: ["ubuntu-latest", "windows-latest", "macos-latest"]

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
cache: "pip"
python-version: ${{ matrix.python-version }}
cache-dependency-path: |
**/requirements*.txt
- name: Install pytest-extra-markers
run: |
pip install -e ".[test]"
- name: Run tests
run: |
pytest tests \
--cov-report=xml \
--cov-branch \
--cov pytest-markers \
--cov-report term-missing
- name: Upload code test coverage report
uses: codecov/codecov-action@v3.1.1
if: ${{ (github.actor != 'dependabot[bot]') && ( !env.ACT ) }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml,./coverage.info
fail_ci_if_error: true
3 changes: 3 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[settings]
profile = black
known_first_party = pytest-extra-markers
3 changes: 3 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contributors

* iwishiwasaneagle <jh.ewers@gmail.com>
Loading

0 comments on commit 29ad640

Please sign in to comment.