-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add continuous integration using github actions (#6)
- Loading branch information
1 parent
c3c91c7
commit be04374
Showing
10 changed files
with
229 additions
and
38 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,12 @@ | ||
# These are supported funding model platforms | ||
|
||
github: [Pierre-Sassoulas] | ||
patreon: # Replace with a single Patreon username | ||
open_collective: # Replace with a single Open Collective username | ||
ko_fi: # Replace with a single Ko-fi username | ||
tidelift: "pypi/black-disable-checker" | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: Pierre-Sassoulas | ||
otechie: # Replace with a single Otechie username | ||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] |
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,3 @@ | ||
# Coordinated Disclosure Plan | ||
|
||
[Coordinated Disclosure Plan](https://tidelift.com/security) |
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,101 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: ~ | ||
|
||
env: | ||
CACHE_VERSION: 4 | ||
DEFAULT_PYTHON: 3.9 | ||
PRE_COMMIT_CACHE: ~/.cache/pre-commit | ||
|
||
jobs: | ||
pylint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- name: Install dependencies | ||
run: | | ||
pip install -e ".[test]" | ||
- name: Lint | ||
run: | | ||
# We need to run pylint as it can't be run with pre-commit-ci | ||
pre-commit run pylint --all-files | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- name: Install dependencies | ||
run: | | ||
pip install -e ".[test]" | ||
- name: Coverage | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
coverage run -m pytest . --cov=black_disable_checker --cov-report html | ||
coveralls debug --service=github | ||
linux-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9, "3.10"] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install -e ".[test]" | ||
- name: Test | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
pytest . | ||
windows-tests: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9, "3.10"] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install -e ".[test]" | ||
- name: Test | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
pytest . | ||
mac-tests: | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9, "3.10"] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install -e ".[test]" | ||
- name: Test | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
pytest . |
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,37 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
DEFAULT_PYTHON: 3.9 | ||
|
||
jobs: | ||
release-pypi: | ||
name: Upload release to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code from Github | ||
uses: actions/[email protected] | ||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
- name: Install requirements | ||
run: | | ||
python -m pip install -U pip twine wheel | ||
python -m pip install -U "setuptools>=56.0.0" | ||
- name: Build distributions | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
- name: Upload to PyPI | ||
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags') | ||
env: | ||
TWINE_REPOSITORY: pypi | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
twine upload --verbose dist/* |
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,11 +1,28 @@ | ||
ci: | ||
skip: [pylint] | ||
|
||
repos: | ||
- repo: https://github.com/Pierre-Sassoulas/black-disable-checker/ | ||
- repo: https://github.com/Pierre-Sassoulas/black-disable-checker/ | ||
rev: 1.0.1 | ||
hooks: | ||
- id: black-disable-checker | ||
exclude: black_disable_checker/__main__.py|tests/* | ||
- repo: https://github.com/psf/black | ||
- id: black-disable-checker | ||
exclude: black_disable_checker/__main__.py|tests/ | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
args: [--safe, --quiet] | ||
- id: black | ||
args: [--safe, --quiet] | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v2.5.1 | ||
hooks: | ||
- id: prettier | ||
args: [--prose-wrap=always, --print-width=88] | ||
- repo: local | ||
hooks: | ||
- id: pylint | ||
name: pylint | ||
entry: pylint | ||
language: system | ||
exclude: tests | ||
args: ["-sn", "-rn", "--disable=C0111,C0103"] | ||
types: [python] |
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,5 +1,5 @@ | ||
- id: black-disable-checker | ||
name: black-disable-checker | ||
entry: black-disable-checker | ||
language: python | ||
'types': [python] | ||
- id: black-disable-checker | ||
name: black-disable-checker | ||
entry: black-disable-checker | ||
language: python | ||
"types": [python] |
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
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,31 @@ | ||
[metadata] | ||
author = Pierre Sassoulas | ||
author_email = [email protected] | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
name = black-disable-checker | ||
version = 1.1.0 | ||
description = That little door knob on your blackened bike shed can also be any color you like; as long as it's black. | ||
classifiers = | ||
Operating System :: OS Independent | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: MIT License | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: 3.10 | ||
Development Status :: 5 - Production/Stable | ||
url = https://github.com/Pierre-Sassoulas/black-disable-checker/ | ||
[options.entry_points] | ||
console_scripts = | ||
black-disable-checker=black_disable_checker.__main__:main | ||
|
||
[options.extras_require] | ||
test = | ||
pytest-cov | ||
pytest-vcr | ||
coverage | ||
python-coveralls | ||
coveralls | ||
pylint==2.13.9 | ||
pre-commit |
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,20 +1,5 @@ | ||
from setuptools import setup | ||
|
||
with open("README.md", "r", encoding="utf-8") as r: | ||
README = r.read() | ||
|
||
setup( | ||
author="Pierre Sassoulas", | ||
author_email="[email protected]", | ||
long_description=README, | ||
long_description_content_type="text/markdown", | ||
name="black-disable-checker", | ||
version="1.1.0", | ||
packages=["black_disable_checker"], | ||
entry_points={ | ||
"console_scripts": ["black-disable-checker=black_disable_checker.__main__:main"] | ||
}, | ||
install_requires=[], | ||
url="https://github.com/Pierre-Sassoulas/black-disable-checker/", | ||
zip_safe=True, | ||
) |
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