8000 Autorelease by staticdev · Pull Request #2 · staticdev/github4.py · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 22, 2021. It is now read-only.

Autorelease #2

Merged
merged 11 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Next Next commit
Autorelease
  • Loading branch information
staticdev committed Feb 18, 2021
commit 650dc9d66fd5892535c203e46606419264230a11
7 changes: 7 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
select = B,B9,C,D,E,F,N,RST,S,W
ignore = E203,E501,RST201,RST203,RST301,W503
max-line-length = 80
max-complexity = 10
docstring-convention = google
per-file-ignores = tests/*:S101, src/github4/structs.py:C901
26 changes: 0 additions & 26 deletions .github/pull_request_template.md

This file was deleted.

12 changes: 7 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ on: [push, pull_request]

jobs:
test:

runs-on: ubuntu-latest
strategy:
matrix:
python:
- { VERSION: "3.6", TOXENV: "py36", ALLOW_FAILURE: false }
- { VERSION: "3.7", TOXENV: "py37", ALLOW_FAILURE: false }
- { VERSION: "3.8", TOXENV: "py38",ALLOW_FAILURE: false }
- { VERSION: "3.9", TOXENV: "py39-flake8,readme,doclint,docs,commitlint",ALLOW_FAILURE: false }
- { VERSION: "3.9", TOXENV: "docstrings", ALLOW_FAILURE: true}
- { VERSION: "3.8", TOXENV: "py38", ALLOW_FAILURE: false }
- {
VERSION: "3.9",
TOXENV: "py39-flake8,readme,doclint,docs,commitlint",
ALLOW_FAILURE: false,
}
- { VERSION: "3.9", TOXENV: "docstrings", ALLOW_FAILURE: true }
- { VERSION: "pypy3", TOXENV: "pypy", ALLOW_FAILURE: false }

steps:
Expand All @@ -37,4 +40,3 @@ jobs:
TOXENV: ${{ matrix.PYTHON.TOXENV }}
GH_RECORD_MODE: "none"
continue-on-error: ${{ matrix.PYTHON.ALLOW_FAILURE }}

4 changes: 3 additions & 1 deletion .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
pip==20.3.3
pip==21.0.1
tox==3.20.1
poetry==1.1.4
virtualenv==20.4.2
79 changes: 79 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Release

on:
push:
branches:
- main
- master

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v2.3.4
with:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v2.2.1
with:
python-version: "3.9"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version

- name: Install Poetry
run: |
pip install --constraint=.github/workflows/constraints.txt poetry
poetry --version

- name: Check if there is a parent commit
id: check-parent-commit
run: |
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"

- name: Detect and tag new version
id: check-version
if: steps.check-parent-commit.outputs.sha
uses: salsify/action-detect-and-tag-new-version@v2.0.1
with:
version-command: |
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"

- name: Bump version for developmental release
if: "! steps.check-version.outputs.tag"
run: |
poetry version patch &&
version=$(poetry version | awk '{ print $2 }') &&
poetry version $version.dev.$(date +%s)

- name: Build package
run: |
poetry build --ansi

- name: Publish package on PyPI
if: steps.check-version.outputs.tag
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

- name: Publish package on TestPyPI
if: "! steps.check-version.outputs.tag"
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish the release notes
uses: release-drafter/release-drafter@v5.14.0
with:
publish: ${{ steps.check-version.outputs.tag != '' }}
tag: ${{ steps.check-version.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
139 changes: 139 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: Tests

on:
- push
- pull_request

jobs:
tests:
name: ${{ matrix.session }} ${{ matrix.python-version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { python-version: 3.9, os: ubuntu-latest, session: "pre-commit" }
- { python-version: 3.9, os: ubuntu-latest, session: "safety" }
# - { python-version: 3.9, os: ubuntu-latest, session: "mypy" }
# - { python-version: 3.8, os: ubuntu-latest, session: "mypy" }
# - { python-version: 3.7, os: ubuntu-latest, session: "mypy" }
- { python-version: 3.9, os: ubuntu-latest, session: "tests" }
- { python-version: 3.8, os: ubuntu-latest, session: "tests" }
- { python-version: 3.7, os: ubuntu-latest, session: "tests" }
- { python-version: 3.9, os: windows-latest, session: "tests" }
- { python-version: 3.9, os: macos-latest, session: "tests" }
# - { python-version: 3.9, os: ubuntu-latest, session: "typeguard" }
- { python-version: 3.9, os: ubuntu-latest, session: "xdoctest" }
- { python-version: 3.8, os: ubuntu-latest, session: "docs-build" }

env:
NOXSESSION: ${{ matrix.session }}

steps:
- name: Check out the repository
uses: actions/checkout@v2.3.4

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

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version

- name: Install Poetry
run: |
pip install --constraint=.github/workflows/constraints.txt poetry
poetry --version

- name: Install Nox
run: |
pip install --constraint=.github/workflows/constraints.txt nox nox-poetry
nox --version

- name: Compute pre-commit cache key
if: matrix.session == 'pre-commit'
id: pre-commit-cache
shell: python
run: |
import hashlib
import sys

python = "py{}.{}".format(*sys.version_info[:2])
payload = sys.version.encode() + sys.executable.encode()
digest = hashlib.sha256(payload).hexdigest()
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8])

print("::set-output name=result::{}".format(result))

- name: Restore pre-commit cache
uses: actions/cache@v2.1.4
if: matrix.session == 'pre-commit'
with:
path: ~/.cache/pre-commit
key: ${{ steps.pre-commit-cache.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ steps.pre-commit-cache.outputs.result }}-

- name: Run Nox
run: |
nox --force-color --python=${{ matrix.python-version }}

- name: Upload coverage data
if: always() && matrix.session == 'tests'
uses: "actions/upload-artifact@v2.2.2"
with:
name: coverage-data
path: ".coverage.*"

- name: Upload documentation
if: matrix.session == 'docs-build'
uses: actions/upload-artifact@v2.2.2
with:
name: docs
path: docs/_build

coverage:
runs-on: ubuntu-latest
needs: tests
steps:
- name: Check out the repository
uses: actions/checkout@v2.3.4

- name: Set up Python 3.9
uses: actions/setup-python@v2.2.1
with:
python-version: 3.9

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version

- name: Install Poetry
run: |
pip install --constraint=.github/workflows/constraints.txt poetry
poetry --version

- name: Install Nox
run: |
pip install --constraint=.github/workflows/constraints.txt nox nox-poetry
nox --version

- name: Download coverage data
uses: actions/download-artifact@v2.0.8
with:
name: coverage-data

- name: Combine coverage data and display human readable report
run: |
nox --force-color --session=coverage

- name: Create coverage report
run: |
nox --force-color --session=coverage -- xml

- name: Upload coverage report
uses: codecov/codecov-action@v1.2.1
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ tests/id_rsa
.pytest_cache/
t.py
*.pem
/.python-version
/.python-version
51 changes: 51 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
repos:
- repo: local
hooks:
- id: black
name: black
entry: black
language: system
types: [python]
require_serial: true
- id: check-added-large-files
name: Check for added large files
entry: check-added-large-files
language: system
- id: check-toml
name: Check Toml
entry: check-toml
language: system
types: [toml]
- id: check-yaml
name: Check Yaml
entry: check-yaml
language: system
types: [yaml]
- id: end-of-file-fixer
name: Fix End of Files
entry: end-of-file-fixer
language: system
types: [text]
stages: [commit, push, manual]
- id: flake8
name: flake8
entry: flake8
language: system
types: [python]
require_serial: true
- id: reorder-python-imports
name: Reorder python imports
entry: reorder-python-imports
language: system
types: [python]
args: [--application-directories=src]
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
language: system
types: [text]
stages: [commit, push, manual]
- repo: https://github.com/prettier/pre-commit
rev: v2.1.2
hooks:
- id: prettier
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"restructuredtext.confPath": ""
}
12 changes: 6 additions & 6 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ We are committed to making participation in this project a harassment-free exper

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
* Other unethical or unprofessional conduct.
- The use of sexualized language or imagery
- Personal attacks
- Trolling or insulting/derogatory comments
- Public or private harassment
- Publishing other's private information, such as physical or electronic addresses, without explicit permission
- Other unethical or unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.

Expand Down
Loading
0