Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions .appveyor.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .coveragerc.in

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on: [ push, pull_request ]

jobs:
test:
strategy:
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
pip install --upgrade pip
pip install tox-gh-actions
pip install -e '.[dev]'
- name: Test with tox
run: tox -vv
env:
PLATFORM: ${{ matrix.platform }}
65 changes: 65 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=61.2"]

[project]
name = "flake8-executable"
description="A Flake8 plugin for checking executable permissions and shebangs."
readme="README.md"
keywords=["flake8", "linter","qa", "shebang"]
authors = [
{name = "Hong Xu", email = "hong@topbug.net"},
{name = "Simon Brugman", email = "sfbbrugman@gmail.com"},
]
license={text = 'LGPL v3+'}
requires-python=">=3.7"
classifiers=[
"Environment :: Console",
"Framework :: Flake8",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
]
dependencies = [
"flake8>=5",
]
dynamic = ["version"]

[project.urls]
url="https://github.com/xuhdev/flake8-executable"

[tool.setuptools.packages]
find = {}

[project.optional-dependencies]
dev = [
"tox>=3",
"flake8-executable[test]",
"flake8-executable[lint]",
]
lint = [
"pre-commit",
]
test = [
"pytest",
"coverage",
]

[project.entry-points]
"flake8.extension" = {EXE00 = "flake8_executable:ExecutableChecker"}

[tool.setuptools.dynamic]
version = {attr = "flake8_executable.__version__"}

[tool.bandit]
exclude_dirs = ["/.eggs", "/tests"]
58 changes: 40 additions & 18 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020 Hong Xu <hong@topbug.net>
# Copyright (c) 2020 Hong Xu <hong@topbug.net>, 2023 Simon Brugman

# This file is part of flake8-executable.

Expand All @@ -16,9 +16,25 @@
# along with flake8-executable. If not, see <https://www.gnu.org/licenses/>.

[tox]
minversion = 3.20
envlist = py{36,37,38,39}-{linux,macos,windows}
minversion = 4.0
envlist = py{37,38,39,310,311}-{linux,macos,windows}, lint
skipsdist = True
isolated_build = true
skip_missing_interpreters = true

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39, lint
3.10: py310
3.11: py311

[gh-actions:env]
PLATFORM =
ubuntu-latest: linux
macos-latest: macos
windows-latest: windows

[testenv]
download = True
Expand All @@ -30,30 +46,36 @@ setenv =
linux: PLATFORM = linux
macos: PLATFORM = macos
windows: PLATFORM = windows
allowlist_externals =
coverage
pre-commit

[testenv:py{36,37,38,39}-{linux,macos,windows}]
deps = -rrequirements/test.txt
[testenv:py{37,38,39,310,311}-{linux,macos,windows}]
extras = test
setenv =
{[testenv]setenv}
COVERAGE_RCFILE = {envtmpdir}/coveragerc
commands_pre =
{envpython} -c 'from pathlib import Path; Path(r"{env:COVERAGE_RCFILE}").write_text(Path(".coveragerc.in").read_text().format(platform="{env:PLATFORM}"))'
commands =
coverage run -m pytest -v
coverage report

[coverage:run]
source = flake8_executable

[coverage:report]
fail_under = 100
show_missing = True
exclude_lines =
pragma: no cover {platform}

[testenv:lint]
deps = -rrequirements/lint.txt
commands =
flake8 .
bandit -r .
mypy flake8_executable
description = lint using pre-commit
passenv =
{[testenv]passenv}
extras = lint
skip_install = true
commands = pre-commit run --all-files --show-diff-on-failure

[testenv:dev]
description = development environment with all deps at {envdir}
deps = -rrequirements-dev.txt
extras = dev
commands = python -c "print(r'{envpython}')"

[flake8]
max-line-length = 120
exclude = .eggs,.git,__pycache__,to-be-tested,.tox