10000 Merge pull request #2 from staticdev/autorelease · staticdev/github4.py@4dabeef · 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.

Commit 4dabeef

Browse files
author
Thiago C. D'Ávila
authored
Merge pull request #2 from staticdev/autorelease
Autorelease
2 parents 6572d75 + 953c50c commit 4dabeef

File tree

668 files changed

+59722
-6293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

668 files changed

+59722
-6293
lines changed

.flake8

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[flake8]
2+
select = B,B9,C,D,E,F,N,RST,S,W
3+
ignore = E203,E501,RST201,RST203,RST301,W503
4+
max-line-length = 80
5+
max-complexity = 10
6+
docstring-convention = google
7+
per-file-ignores = tests/*:S101, src/github4/structs.py:C901

.github/pull_request_template.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/constraints.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
pip==20.3.3
2-
tox==3.20.1
1+
pip==21.0.1
2+
nox==2020.12.31
3+
nox-poetry==0.8.1
4+
poetry==1.1.4
5+
virtualenv==20.4.2

.github/workflows/release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
jobs:
10+
release:
11+
name: Release
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out the repository
15+
uses: actions/checkout@v2.3.4
16+
with:
17+
fetch-depth: 2
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v2.2.1
21+
with:
22+
python-version: "3.9"
23+
24+
- name: Upgrade pip
25+
run: |
26+
pip install --constraint=.github/workflows/constraints.txt pip
27+
pip --version
28+
29+
- name: Install Poetry
30+
run: |
31+
pip install --constraint=.github/workflows/constraints.txt poetry
32+
poetry --version
33+
34+
- name: Check if there is a parent commit
35+
id: check-parent-commit
36+
run: |
37+
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"
38+
39+
- name: Detect and tag new version
40+
id: check-version
41+
if: steps.check-parent-commit.outputs.sha
42+
uses: salsify/action-detect-and-tag-new-version@v2.0.1
43+
with:
44+
version-command: |
45+
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
46+
47+
- name: Bump version for developmental release
48+
if: "! steps.check-version.outputs.tag"
49+
run: |
50+
poetry version patch &&
51+
version=$(poetry version | awk '{ print $2 }') &&
52+
poetry version $version.dev.$(date +%s)
53+
54+
- name: Build package
55+
run: |
56+
poetry build --ansi
57+
58+
- name: Publish package on PyPI
59+
if: steps.check-version.outputs.tag
60+
uses: pypa/gh-action-pypi-publish@v1.4.2
61+
with:
62+
user: __token__
63+
password: ${{ secrets.PYPI_TOKEN }}
64+
65+
- name: Publish package on TestPyPI
66+
if: "! steps.check-version.outputs.tag"
67+
uses: pypa/gh-action-pypi-publish@v1.4.2
68+
with:
69+
user: __token__
70+
password: ${{ secrets.TEST_PYPI_TOKEN }}
71+
repository_url: https://test.pypi.org/legacy/
72+
73+
- name: Publish the release notes
74+
uses: release-drafter/release-drafter@v5.14.0
75+
with:
76+
publish: ${{ steps.check-version.outputs.tag != '' }}
77+
tag: ${{ steps.check-version.outputs.tag }}
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tests.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: Tests
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
tests:
9+
name: ${{ matrix.session }} ${{ matrix.python-version }} / ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- { python-version: 3.9, os: ubuntu-latest, session: "pre-commit" }
16+
- { python-version: 3.9, os: ubuntu-latest, session: "safety" }
17+
# - { python-version: 3.9, os: ubuntu-latest, session: "mypy" }
18+
# - { python-version: 3.8, os: ubuntu-latest, session: "mypy" }
19+
# - { python-version: 3.7, os: ubuntu-latest, session: "mypy" }
20+
- { python-version: 3.9, os: ubuntu-latest, session: "tests" }
21+
- { python-version: 3.8, os: ubuntu-latest, session: "tests" }
22+
- { python-version: 3.7, os: ubuntu-latest, session: "tests" }
23+
- { python-version: 3.9, os: windows-latest, session: "tests" }
24+
- { python-version: 3.9, os: macos-latest, session: "tests" }
25+
# - { python-version: 3.9, os: ubuntu-latest, session: "typeguard" }
26+
- { python-version: 3.9, os: ubuntu-latest, session: "xdoctest" }
27+
- { python-version: 3.8, os: ubuntu-latest, session: "docs-build" }
28+
29+
env:
30+
NOXSESSION: ${{ matrix.session }}
31+
32+
steps:
33+
- name: Check out the repository
34+
uses: actions/checkout@v2.3.4
35+
36+
- name: Set up Python ${{ matrix.python-version }}
37+
uses: actions/setup-python@v2.2.1
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
41+
- name: Upgrade pip
42+
run: |
43+
pip install --constraint=.github/workflows/constraints.txt pip
44+
pip --version
45+
46+
- name: Install Poetry
47+
run: |
48+
pip install --constraint=.github/workflows/constraints.txt poetry
49+
poetry --version
50+
51+
- name: Install Nox
52+
run: |
53+
pip install --constraint=.github/workflows/constraints.txt nox nox-poetry
54+
nox --version
55+
56+
- name: Compute pre-commit cache key
57+
if: matrix.session == 'pre-commit'
58+
id: pre-commit-cache
59+
shell: python
60+
run: |
61+
import hashlib
62+
import sys
63+
64+
python = "py{}.{}".format(*sys.version_info[:2])
65+
payload = sys.version.encode() + sys.executable.encode()
66+
digest = hashlib.sha256(payload).hexdigest()
67+
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8])
68+
69+
print("::set-output name=result::{}".format(result))
70+
71+
- name: Restore pre-commit cache
72+
uses: actions/cache@v2.1.4
73+
if: matrix.session == 'pre-commit'
74+
with:
75+
path: ~/.cache/pre-commit
76+
key: ${{ steps.pre-commit-cache.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }}
77+
restore-keys: |
78+
${{ steps.pre-commit-cache.outputs.result }}-
79+
80+
- name: Run Nox
81+
run: |
82+
nox --force-color --python=${{ matrix.python-version }}
83+
84+
- name: Upload coverage data
85+
if: always() && matrix.session == 'tests'
86+
uses: "actions/upload-artifact@v2.2.2"
87+
with:
88+
name: coverage-data
89+
path: ".coverage.*"
90+
91+
- name: Upload documentation
92+
if: matrix.session == 'docs-build'
93+
uses: actions/upload-artifact@v2.2.2
94+
with:
95+
name: docs
96+
path: docs/_build
97+
98+
coverage:
99+
runs-on: ubuntu-latest
100+
needs: tests
101+
steps:
102+
- name: Check out the repository
103+
uses: actions/checkout@v2.3.4
104+
105+
- name: Set up Python 3.9
106+
uses: actions/setup-python@v2.2.1
107+
with:
108+
python-version: 3.9
109+
110+
- name: Upgrade pip
111+
run: |
112+
pip install --constraint=.github/workflows/constraints.txt pip
113+
pip --version
114+
115+
- name: Install Poetry
116+
run: |
117+
pip install --constraint=.github/workflows/constraints.txt poetry
118+
poetry --version
119+
120+
- name: Install Nox
121+
run: |
122+
pip install --constraint=.github/workflows/constraints.txt nox nox-poetry
123+
nox --version
124+
125+
- name: Download coverage data
126+
uses: actions/download-artifact@v2.0.8
127+
with:
128+
name: coverage-data
129+
130+
- name: Combine coverage data and display human readable report
131+
run: |
132+
nox --force-color --session=coverage
133+
134+
- name: Create coverage report
135+
run: |
136+
nox --force-color --session=coverage -- xml
137+
138+
- name: Upload coverage report
139+
uses: codecov/codecov-action@v1.2.1

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ tests/id_rsa
2424
.pytest_cache/
2525
t.py
2626
*.pem
27-
/.python-version
27+
/.python-version

.pre-commit-config.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: black
5+
name: black
6+
entry: black
7+
language: system
8+
types: [python]
9+
require_serial: true
10+
- id: check-added-large-files
11+
name: Check for added large files
12+
entry: check-added-large-files
13+
language: system
14+
- id: check-toml
15+
name: Check Toml
16+
entry: check-toml
17+
language: system
18+
types: [toml]
19+
- id: check-yaml
20+
name: Check Yaml
21+
entry: check-yaml
22+
language: system
23+
types: [yaml]
24+
- id: end-of-file-fixer
25+
name: Fix End of Files
26+
entry: end-of-file-fixer
27+
language: system
28+
types: [text]
29+
stages: [commit, push, manual]
30+
- id: flake8
31+
name: flake8
32+
entry: flake8
33+
language: system
34+
types: [python]
35+
require_serial: true
36+
- id: reorder-python-imports
37+
name: Reorder python imports
38+
entry: reorder-python-imports
39+
language: system
40+
types: [python]
41+
args: [--application-directories=src]
42+
- id: trailing-whitespace
43+
name: Trim Trailing Whitespace
44+
entry: trailing-whitespace-fixer
45+
language: system
46+
types: [text]
47+
stages: [commit, push, manual]
48+
- repo: https://github.com/prettier/pre-commit
49+
rev: v2.1.2
50+
hooks:
51+
- id: prettier

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"restructuredtext.confPath": ""
3+
}

CODE_OF_CONDUCT.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ We are committed to making participation in this project a harassment-free exper
66

77
Examples of unacceptable behavior by participants include:
88

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

1616
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.
1717

0 commit comments

Comments
 (0)
0