Skip to content

Commit 7177cfa

Browse files
authored
Merge pull request #10 from jurgenwigg/basic-ci
Add Basic CI
2 parents e95736a + e9de809 commit 7177cfa

5 files changed

Lines changed: 86 additions & 24 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python Static Analysis
5+
6+
on: [push, pull_request]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: ["3.14"]
15+
check: ["formatting"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip tox
26+
- name: Test with tox
27+
run: |
28+
tox -e ${{ matrix.check }} || true

.github/workflows/python-test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python Package Test
5+
6+
on: [push, pull_request]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
python-version: ["3.11", "3.12", "3.13", "3.14"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip tox
25+
- name: Test with tox
26+
run: |
27+
export py_ver=$( echo "${{ matrix.python-version }}" | sed 's/\.//')
28+
tox -e py${py_ver}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*__pycache__*
2+
*venv*
3+
*coverage*

pyproject.toml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"] # This tells Hatch that version is dynamically determined
88
description = 'A modern Python security source code analyzer (SAST) based on distrust.'
99
readme = "README.md"
1010
dependencies = ["fire>=0.7.0","pandas>=2.3","altair>=5.5"]
11-
requires-python = ">=3.8"
11+
requires-python = ">=3.11"
1212
license = "GPL-3.0-or-later"
1313
keywords = ["SAST", "Python SAST", "SAST API", "Complexity Checker"]
1414
authors = [
@@ -17,17 +17,19 @@ authors = [
1717
classifiers = [
1818
"Environment :: Console",
1919
"Intended Audience :: Developers",
20-
"Intended Audience :: Science/Research",
20+
"Intended Audience :: Science/Research",
2121
"Topic :: Security",
2222
"Topic :: Software Development :: Quality Assurance",
2323
"Development Status :: 4 - Beta",
2424
"Programming Language :: Python",
2525
"Programming Language :: Python :: 3.11",
2626
"Programming Language :: Python :: 3.12",
27-
"Programming Language :: Python :: 3.13",
28-
"Programming Language :: Python :: 3.14",
27+
"Programming Language :: Python :: 3.13",
28+
"Programming Language :: Python :: 3.14",
2929
]
3030

31+
[project.optional-dependencies]
32+
test = ["pytest", "pytest-cov", "tox", "pylint", "black"]
3133

3234
[project.urls]
3335
Documentation = "https://github.com/nocomplexity/codeaudit#readme"
@@ -53,24 +55,8 @@ extra-dependencies = [
5355
check = "mypy --install-types --non-interactive {args:src/codeaudit tests}"
5456

5557
[[tool.hatch.envs.hatch-test.matrix]]
56-
python = ["3.14","3.13","3.12", "3.11"]
58+
python = ["3.14", "3.13", "3.12", "3.11"]
5759

58-
59-
[tool.coverage.run]
60-
source_pkgs = ["codeaudit", "tests"]
61-
branch = true
62-
parallel = true
63-
omit = [
64-
"src/codeaudit/__about__.py",
65-
]
66-
67-
[tool.coverage.paths]
68-
codeaudit = ["src/codeaudit", "*/codeaudit/src/codeaudit"]
69-
tests = ["tests", "*/codeaudit/tests"]
70-
71-
[tool.coverage.report]
72-
exclude_lines = [
73-
"no cov",
74-
"if __name__ == .__main__.:",
75-
"if TYPE_CHECKING:",
76-
]
60+
[tool.black]
61+
target-version = ["py311", "py312", "py313"]
62+
extend-exclude ='(python2_file_willnotwork|dunderexec_with_parsing_error).py'

tox.ini

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[tox]
2+
min_version = 4.0
3+
env_list = py{38,39,310,311,312,313,314}
4+
skip_missing_interpreters = true
5+
6+
[testenv]
7+
deps = .[test]
8+
allowlist_externals = pytest
9+
commands = pytest --cov codeaudit --cov-report term-missing --cov-branch -v tests
10+
11+
[testenv:lint]
12+
deps = .[test]
13+
commands = pylint --max-line-length=88 src tests
14+
15+
[testenv:formatting]
16+
deps = .[test]
17+
commands = black --target-version py313 --check src tests

0 commit comments

Comments
 (0)