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

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yarnabrina committed Apr 12, 2023
0 parents commit 5bd37a7
Show file tree
Hide file tree
Showing 74 changed files with 3,702 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version = 1
exclude_patterns = [
"typing-stubs-for-package-name-to-install-with/**",
]
test_patterns = [
"**/tests/*.py",
]

[[analyzers]]
name = "python"
enabled = true
dependency_file_paths = [
"pyproject.toml",
"requirements/requirements.dev.txt",
"requirements/requirements.doc.txt",
"requirements/requirements.format.txt",
"requirements/requirements.lint.txt",
"requirements/requirements.release.txt",
"requirements/requirements.test.txt",
"requirements/requirements.txt",
]

[analyzers.meta]
runtime_version = "3.x.x"
max_line_length = 99
skip_doc_coverage = [
"init",
]
type_checker = "mypy"

[[analyzers]]
name = "secrets"
enabled = true

[[transformers]]
name = "black"
enabled = true

[[transformers]]
name = "isort"
enabled = true
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# References

## https://github.com/alexkaratarakis/gitattributes/blob/c9e0391fd0f045478a3d122979eeb23d2311e21a/.gitattributes
## https://github.com/alexkaratarakis/gitattributes/blob/bf082e21993dc589d27ac403b2c189f24c6e57a1/Common.gitattributes
## https://github.com/alexkaratarakis/gitattributes/blob/eeb2ca9a67e5985e1c9e00b3d20ae2842eaa8852/Markdown.gitattributes
## https://github.com/alexkaratarakis/gitattributes/blob/492d0bc3bb09d37cc36e6f1e346b4b61bd620197/Python.gitattributes

* text=auto

*.gitattributes text export-ignore linguist-detectable linguist-language=gitattributes
*.gitignore text export-ignore linguist-detectable linguist-language=gitignore
*.gitkeep export-ignore

*.md text diff=markdown linguist-detectable
*.py text diff=python linguist-detectable
*.toml text diff=toml linguist-detectable
*.yaml text diff=yaml linguist-detectable
33 changes: 33 additions & 0 deletions .github/actions/nox-sessions-action-identifier/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: nox-session-action-name
description: run nox session
inputs:
session-name-input-identifier:
description: name of nox session
required: true
python-version-input-identifier:
description: python version to run session
required: false
default: none
runs:
using: composite
steps:
- id: nox-step-identifier
name: install nox
run: python3 -m pip install nox
shell: bash
- id: session-all-versions-step-identifier
name: run provided nox session for all configured python versions
if: env.PYTHON_VERSION == 'none'
run: nox --sessions ${{env.SESSION_NAME}} --force-venv-backend venv
shell: bash
env:
SESSION_NAME: ${{ inputs.session-name-input-identifier }}
PYTHON_VERSION: ${{ inputs.python-version-input-identifier }}
- id: session-single-version-step-identifier
name: run provided nox session for provided python version
if: env.PYTHON_VERSION != 'none'
run: nox --sessions ${{env.SESSION_NAME}} --pythons ${{env.PYTHON_VERSION}} --force-venv-backend venv
shell: bash
env:
SESSION_NAME: ${{ inputs.session-name-input-identifier }}
PYTHON_VERSION: ${{ inputs.python-version-input-identifier }}
33 changes: 33 additions & 0 deletions .github/actions/nox-tags-action-identifier/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: nox-tag-action-name
description: run nox tag
inputs:
tag-name-input-identifier:
description: name of nox tag
required: true
python-version-input-identifier:
description: python version to run tag
required: false
default: none
runs:
using: composite
steps:
- id: nox-step-identifier
name: install nox
run: python3 -m pip install nox
shell: bash
- id: tag-all-versions-step-identifier
name: run provided nox tag for all configured python versions
if: env.PYTHON_VERSION == 'none'
run: nox --tags ${{env.TAG_NAME}} --force-venv-backend venv
shell: bash
env:
TAG_NAME: ${{ inputs.tag-name-input-identifier }}
PYTHON_VERSION: ${{ inputs.python-version-input-identifier }}
- id: tag-single-version-step-identifier
name: run provided nox tag for provided python version
if: env.PYTHON_VERSION != 'none'
run: nox --pythons ${PYTHON_VERSION} --tags ${{env.TAG_NAME}} --force-venv-backend venv
shell: bash
env:
TAG_NAME: ${{ inputs.tag-name-input-identifier }}
PYTHON_VERSION: ${{ inputs.python-version-input-identifier }}
29 changes: 29 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: docs-workflow-name
run-name: docs workflow run name
on: workflow_dispatch
defaults:
run:
shell: bash
jobs:
docs-job-identifier:
name: docs job name
runs-on: ubuntu-latest
steps:
- name: checkout commit
uses: actions/checkout@v3
- name: set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
check-latest: true
architecture: x64
cache: pip
- name: build documentation
uses: ./.github/actions/nox-sessions-action-identifier
with:
session-name-input-identifier: sphinx
- name: upload documentation
uses: actions/upload-artifact@v3
with:
name: docs
path: ./docs/build
37 changes: 37 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: format-workflow-name
run-name: format workflow run name
on:
pull_request:
branches:
- main
types:
- opened
- synchronize
defaults:
run:
shell: bash
jobs:
format-job-identifier:
name: format job name
strategy:
fail-fast: false
matrix:
runner-platform:
- ubuntu-latest
python-version:
- "3.10"
runs-on: ${{ matrix.runner-platform }}
steps:
- name: checkout commit
uses: actions/checkout@v3
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
check-latest: true
architecture: x64
cache: pip
- name: run formatters on python ${{ matrix.python-version }}
uses: ./.github/actions/nox-tags-action-identifier
with:
tag-name-input-identifier: format
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: lint-workflow-name
run-name: lint workflow run name
on:
pull_request:
branches:
- main
types:
- opened
- synchronize
defaults:
run:
shell: bash
jobs:
lint-job-identifier:
name: lint job name
strategy:
fail-fast: false
matrix:
runner-platform:
- ubuntu-latest
python-version:
- "3.10"
- "3.11"
runs-on: ${{ matrix.runner-platform }}
steps:
- name: checkout commit
uses: actions/checkout@v3
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
check-latest: true
architecture: x64
cache: pip
- name: run linters on python ${{ matrix.python-version }}
uses: ./.github/actions/nox-tags-action-identifier
with:
tag-name-input-identifier: lint
python-version-input-identifier: ${{ matrix.python-version }}
26 changes: 26 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: pre-commit-workflow-name
run-name: pre-commit workflow run name
on: push
defaults:
run:
shell: bash
jobs:
pre-commit-job-identifier:
name: pre-commit job name
runs-on: ubuntu-latest
steps:
- name: checkout commit
uses: actions/checkout@v3
- name: set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
check-latest: true
architecture: x64
cache: pip
- name: run all pre-commit hooks
env:
SKIP: no-commit-to-branch
uses: ./.github/actions/nox-sessions-action-identifier
with:
session-name-input-identifier: pre_commit
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release-workflow-name
run-name: release workflow run name
on: workflow_dispatch
defaults:
run:
shell: bash
jobs:
release-job-identifier:
name: release job name
runs-on: ubuntu-latest
steps:
- name: checkout commit
uses: actions/checkout@v3
- name: set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
check-latest: true
architecture: x64
cache: pip
- name: build and release wheel
env:
TWINE_REPOSITORY: ${{ secrets.PYPI_REPOSITORY }}
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
uses: ./.github/actions/nox-sessions-action-identifier
with:
session-name-input-identifier: build
- name: upload wheel
uses: actions/upload-artifact@v3
with:
name: release
path: ./dist
50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: test-workflow-name
run-name: test workflow run name
on:
pull_request:
branches:
- main
types:
- opened
- synchronize
push:
branches:
- main
defaults:
run:
shell: bash
jobs:
test-job-identifier:
name: test job name
strategy:
fail-fast: false
matrix:
runner-platform:
- macos-latest
- ubuntu-latest
- windows-latest
python-version:
- "3.10"
- "3.11"
max-parallel: 2
runs-on: ${{ matrix.runner-platform }}
steps:
- name: checkout commit
uses: actions/checkout@v3
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
check-latest: true
architecture: x64
cache: pip
- name: run unit tests on python ${{ matrix.python-version }} in runner ${{ matrix.runner-platform }}
uses: ./.github/actions/nox-sessions-action-identifier
with:
session-name-input-identifier: pytest
python-version-input-identifier: ${{ matrix.python-version }}
- name: upload coverage reports
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage_xml_report.xml
Loading

0 comments on commit 5bd37a7

Please sign in to comment.