Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.
Merged
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
6 changes: 6 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
coverage:
status:
project:
default:
target: 0%
threshold: null
48 changes: 9 additions & 39 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,25 @@ jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/statick-web
permissions:
id-token: write

steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- uses: actions/cache@v3
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- uses: actions/cache@v3
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- uses: actions/cache@v3
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install tools
run: |
python -m pip install --upgrade setuptools
python -m pip install --upgrade wheel
cache: 'pip'

- name: Build a binary wheel and a source tarball
run: |
python setup.py sdist bdist_wheel

- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TEST_TOKEN }}
repository_url: https://test.pypi.org/legacy/
pip install -q build
python -m build

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
55 changes: 11 additions & 44 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,62 +14,29 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-20.04, ubuntu-22.04, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
os: [macos-latest, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, windows-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '20'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v3
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- uses: actions/cache@v3
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- uses: actions/cache@v3
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install --upgrade wheel
python -m pip install --upgrade coverage
python -m pip install --upgrade mypy
python -m pip install --upgrade statick
python -m pip install --upgrade statick-md
python -m pip install --upgrade tox
python -m pip install --upgrade tox-gh-actions
python -m pip install --upgrade virtualenv
python -m pip install -r requirements.txt
pip install --upgrade pip
pip install .[docs,test]

# Have to install newer version from non-apt source due to SSL library compatibility issues.
- name: Install tools (Linux)
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
if: runner.os == 'Linux'
run: |
npm install -g eslint
# eslint plugins and configs should be installed locally
Expand All @@ -95,7 +62,7 @@ jobs:
mypy --ignore-missing-imports --strict src/

- name: Tox
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
if: runner.os == 'Linux'
run: |
npm list
npm list --prefix $HOME/.node_modules
Expand All @@ -108,12 +75,12 @@ jobs:
fail_ci_if_error: false

- name: Statick Documentation
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
if: runner.os == 'Linux'
run: |
statick . --check --profile documentation.yaml

- name: Self check
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
if: runner.os == 'Linux'
run: |
mkdir statick-output
statick . --output-directory statick-output --check --profile self_check.yaml
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## Unreleased

### Added

- Support for Python 3.12 and 3.13.
- Use of `pyproject.toml` instead of `setup.py` and `requirements.txt`.
- Supports new plugin discovery mechanism for the main Statick tool.
- Switched from yapsy to setuptools for plugin mechanism. (sscpac/statick#508)

### Changed

- Disabled code coverage requirements in CI for now.
- Unable to get line coverage working with new plugin mechanism.
Unit tests still work to find problems.
- Rename plugin modules so they are shorter and less redundant.

### Removed

- No longer support Python 3.8.

## v0.2.0 - 2025-01-03

### Changed
Expand Down
67 changes: 67 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "statick-web"
authors = [{name = "NIWC Pacific"}]
description="Statick analysis plugins for Web (css, html, js) files."
version = "0.2.0"
readme = "README.md"
requires-python = ">=3.9"
license = {text = "CC0-1.0"}
classifiers = [
"License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Typing :: Typed",
]

dependencies = [
"importlib_metadata",
"statick",
]

[tool.setuptools.package-data]
statick_tool = [
"rsc/*",
"rsc/.*",
]

[project.entry-points."statick_tool.plugins.discovery"]
css = "statick_tool.plugins.discovery.css:CSSDiscoveryPlugin"
html = "statick_tool.plugins.discovery.html:HTMLDiscoveryPlugin"
javascript = "statick_tool.plugins.discovery.javascript:JavaScriptDiscoveryPlugin"

[project.entry-points."statick_tool.plugins.tool"]
eslint = "statick_tool.plugins.tool.eslint:ESLintToolPlugin"
htmllint = "statick_tool.plugins.tool.htmllint:HTMLLintToolPlugin"
jshint = "statick_tool.plugins.tool.jshint:JSHintToolPlugin"
stylelint = "statick_tool.plugins.tool.stylelint:StylelintToolPlugin"

[project.urls]
"Homepage" = "https://github.com/sscpac/statick-web"
"Bug Tracker" = "https://github.com/sscpac/statick-web/issues"

[project.optional-dependencies]
test = [
"coverage",
"mock",
"pytest",
"pytest-cov",
"statick-md@git+https://github.com/tdenewiler/statick-md@stdlib-plugins",
"tox",
"tox-gh-actions",
]
docs = [
"yaml-1.3",
]

[tool.isort]
profile = "black"
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

51 changes: 0 additions & 51 deletions setup.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/statick_web/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion src/statick_web/plugins/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion src/statick_web/plugins/discovery/__init__.py

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/statick_web/plugins/tool/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions src/statick_web/plugins/tool/eslint_tool_plugin.yapsy-plugin

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions src/statick_web/plugins/tool/jshint_tool_plugin.yapsy-plugin

This file was deleted.

This file was deleted.

Loading