-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adopt tox-dev organization best practices (#87)
- Loading branch information
1 parent
b30bdc4
commit 06b078a
Showing
22 changed files
with
587 additions
and
934 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
name: check | ||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: "0 8 * * *" | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- uses: pre-commit/[email protected] | ||
|
||
test: | ||
name: test ${{ matrix.py }} - ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
py: | ||
- 3.10.0-rc.2 | ||
- 3.9 | ||
- 3.8 | ||
- 3.7 | ||
- 3.6 | ||
- 3.5 | ||
- pypy3 | ||
- 2.7 | ||
- pypy2 | ||
|
||
steps: | ||
- name: Setup python for tox | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install tox | ||
run: python -m pip install tox | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup python for test ${{ matrix.py }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.py }} | ||
- name: Pick environment to run | ||
run: | | ||
import platform; import os; import sys; import codecs | ||
cpy = platform.python_implementation() == "CPython" | ||
base =("{}{}{}" if cpy else "{}{}").format("py" if cpy else "pypy", *sys.version_info[0:2]) | ||
env = "TOXENV={}\n".format(base) | ||
print("Picked:\n{}for{}".format(env, sys.version)) | ||
with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler: | ||
file_handler.write(env) | ||
shell: python | ||
- name: Setup test suite | ||
run: tox -vv --notest | ||
- name: Run test suite | ||
run: tox --skip-pkg-install | ||
env: | ||
PYTEST_ADDOPTS: "-vv --durations=20" | ||
CI_RUN: "yes" | ||
DIFF_AGAINST: HEAD | ||
- name: Rename coverage report file | ||
run: | | ||
import os; os.rename('.tox/coverage.{}.xml'.format(os.environ['TOXENV']), '.tox/coverage.xml') | ||
shell: python | ||
- uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./.tox/coverage.xml | ||
flags: tests | ||
name: ${{ matrix.py }} - ${{ matrix.os }} | ||
|
||
check: | ||
name: ${{ matrix.tox_env }} - ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
tox_env: | ||
- dev | ||
- docs | ||
- readme | ||
exclude: | ||
- { os: windows-latest, tox_env: readme } | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install tox | ||
run: python -m pip install tox | ||
- name: Setup test suite | ||
run: tox -vv --notest -e ${{ matrix.tox_env }} | ||
- name: Run test suite | ||
run: tox --skip-pkg-install -e ${{ matrix.tox_env }} | ||
|
||
publish: | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
needs: [check, test, lint] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup python to build package | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install https://pypi.org/project/build | ||
run: python -m pip install build | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Build sdist and wheel | ||
run: python -m build -s -w . -o dist | ||
- name: Publish to PyPi | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
skip_existing: true | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,18 @@ | ||
*.py[cod] | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist | ||
build | ||
eggs | ||
parts | ||
bin | ||
var | ||
sdist | ||
develop-eggs | ||
.installed.cfg | ||
lib | ||
lib64 | ||
*__pycache__ | ||
MANIFEST | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
||
# Unit test / coverage reports | ||
.coverage | ||
dist | ||
*.egg | ||
.eggs | ||
*.py[codz] | ||
*$py.class | ||
.tox | ||
nosetests.xml | ||
|
||
# Translations | ||
*.mo | ||
|
||
# Mr Developer | ||
.mr.developer.cfg | ||
.project | ||
.pydevproject | ||
|
||
# py-filelock | ||
# ----------- | ||
|
||
# Docs | ||
docs/build | ||
|
||
.*_cache | ||
.DS_Store | ||
.idea | ||
.vscode | ||
/pip-wheel-metadata | ||
/src/filelock/version.py | ||
venv* | ||
.python-version | ||
test.lock | ||
test.softlock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
- id: check-docstring-first | ||
- id: check-merge-conflict | ||
- id: check-yaml | ||
- id: check-toml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.26.0 | ||
hooks: | ||
- id: pyupgrade | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.9.3 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/psf/black | ||
rev: 21.9b0 | ||
hooks: | ||
- id: black | ||
args: [ --safe ] | ||
- repo: https://github.com/asottile/blacken-docs | ||
rev: v1.11.0 | ||
hooks: | ||
- id: blacken-docs | ||
additional_dependencies: [ black==20.8b1 ] | ||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: v1.9.0 | ||
hooks: | ||
- id: rst-backticks | ||
- repo: https://github.com/tox-dev/tox-ini-fmt | ||
rev: "0.5.1" | ||
hooks: | ||
- id: tox-ini-fmt | ||
args: [ "-p", "fix_lint" ] | ||
- repo: https://github.com/asottile/setup-cfg-fmt | ||
rev: v1.17.0 | ||
hooks: | ||
- id: setup-cfg-fmt | ||
args: [ --min-py3-version, "3.5", "--max-py-version", "3.10" ] | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
- flake8-bugbear==21.9.1 | ||
- flake8-comprehensions==3.6.1 | ||
- flake8-pytest-style==1.5 | ||
- flake8-spellcheck==0.24 | ||
- flake8-unused-arguments==0.0.6 | ||
- flake8-noqa==1.1.0 | ||
- flake8-eradicate==1.1.0 | ||
- pep8-naming==0.12.1 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.