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
Show all changes
43 commits
Select commit Hold shift + click to select a range
0129ecd
Convert to pyproject.toml configuration.
tdenewiler Oct 5, 2023
d175fef
Slim down package data, install mock for tox.
tdenewiler Oct 5, 2023
e14422e
Move tox dependencies to pyproject.toml.
tdenewiler Oct 5, 2023
77e1c5c
Fix install command.
tdenewiler Oct 5, 2023
8e0752b
Move mypy dependency to optional test section.
tdenewiler Oct 5, 2023
89f99d5
Move flake8 max line length to correct spot.
tdenewiler Oct 5, 2023
5f53668
Rename src directory. Move resource files into package.
tdenewiler Oct 10, 2023
108ba11
Remove pydocstyle, pycodestyle, flake8, isort from running with tox. …
tdenewiler Nov 1, 2023
63e4b9e
Remove install text files. Each had a single package. They are listed…
tdenewiler Nov 1, 2023
45c61ed
Add new entry when cleaning untracked files.
tdenewiler Nov 1, 2023
1cbf55e
Remove unused configurations for flake8 and isort.
tdenewiler Nov 1, 2023
82575a0
Minimize --cov flags used for tox.
tdenewiler Nov 7, 2023
e2f939f
Switch from yapsy to stdlib entry points for plugins.
tdenewiler Nov 22, 2023
c51ea5c
Use stdlib entry points version of Statick from github for now.
tdenewiler Nov 22, 2023
a569bb7
Update github workflow configs.
tdenewiler Nov 23, 2023
c526934
Update publish workflow.
tdenewiler Nov 23, 2023
208b893
Dependency cleanup.
tdenewiler Nov 26, 2023
71c650f
Update clean script. Pin pytest version.
tdenewiler Apr 22, 2024
ef93aed
Update GitHub actions versions. Remove __init__.py files from src/ di…
tdenewiler Sep 10, 2024
f0c3b68
Use stdlib-plugins branch for statick dependency.
tdenewiler Sep 10, 2024
332e884
Drop Python 3.8, add Python 3.13.
tdenewiler Oct 15, 2024
2fd6b26
Minor cleanup.
tdenewiler Oct 15, 2024
86b67b6
Add ubuntu-24.04.
tdenewiler Oct 15, 2024
5a41f43
Ignore proselint type hint warnings about missing attributes.
tdenewiler Nov 5, 2024
07102fc
Remove proselint plugin. Not used as far as I know, and causing too m…
tdenewiler Nov 5, 2024
bb3d133
Remove proselint unit tests.
tdenewiler Nov 5, 2024
120f844
isort formatting
tdenewiler Nov 5, 2024
afb6323
Merge in main.
tdenewiler Nov 19, 2024
32b4705
Update README.
tdenewiler Jan 2, 2025
0605458
Merge in main branch.
tdenewiler Jan 3, 2025
ba2793b
Simplify pip install command.
tdenewiler Jan 3, 2025
3c3df43
Update readme.
tdenewiler Jan 3, 2025
a01153e
Unpin pytest dependency version.
tdenewiler Jan 4, 2025
9db9da9
Use newer codecov action.
tdenewiler Jan 4, 2025
27534fa
Bump node version to 20 in CI.
tdenewiler Jan 4, 2025
8b1e4c0
Adding codecov configuration file to allow lower unit test line cover…
tdenewiler Jan 4, 2025
9f5b121
Add newline to end of yaml file.
tdenewiler Jan 4, 2025
ee8610c
Be explicit that we are ignoring unit test line coverage for now.
tdenewiler Jan 4, 2025
4fffcad
Use runner.os to simplify Linux-specific action steps.
tdenewiler Jan 6, 2025
beacbee
Update changelog.
tdenewiler Jan 9, 2025
ed88d06
Update changelog.
tdenewiler Jan 9, 2025
dd3bb87
Use latest statick release as dependency.
tdenewiler Jan 20, 2025
588117f
Merge remote-tracking branch 'tdenewiler/stdlib-plugins' into stdlib-…
tdenewiler Jan 20, 2025
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
46 changes: 10 additions & 36 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI

on: # NOLINT
on: # NOLINT
push:
tags:
- "*"
Expand All @@ -10,6 +10,11 @@ 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-md
permissions:
id-token: write

steps:
- uses: actions/checkout@v3
Expand All @@ -18,47 +23,16 @@ jobs:
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-
cache: 'pip'

- name: Install tools
run: |
python -m pip install --upgrade setuptools
python -m pip install --upgrade wheel
pip install .[dist]

- 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 }}
59 changes: 14 additions & 45 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,86 +14,55 @@ 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: '16'
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-
cache: '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 types-docutils
python -m pip install --upgrade tox
python -m pip install --upgrade tox-gh-actions
python -m pip install --upgrade virtualenv
pip install .[docs,test]

# Have to install newer version from non-apt source due to SSL library compatibility issues.
- name: Install Node and node-based tools (Linux)
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
- name: Install Node tools (Linux)
if: runner.os == 'Linux'
run: |
npm install -g markdownlint-cli
npm install -g write-good

- name: Mypy
run: |
mypy --ignore-missing-imports --strict src/
mypy --ignore-missing-imports --strict src/statick_tool/

- name: Tox
run: |
python -m tox

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: false

- name: Statick Documentation
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
if: runner.os == 'Linux'
uses: sscpac/statick-action@v0.9.2
with:
profile: documentation.yaml
timings: true

- name: Self check
if: matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04'
if: runner.os == 'Linux'
uses: sscpac/statick-action@v0.9.2
with:
profile: self_check.yaml
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@ 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.
- Updated README to use more modern approach to installing Python and NPM packages.
- Rename plugin modules so they are shorter and less redundant.

### Removed

- No longer support Python 3.8.
- Proselint tool removed.
- Unable to resolve type hint and unit test issues.
Tool not used as far as Statick developers are aware.

## v0.2.0 - 2025-01-03

### Removed
Expand Down
96 changes: 45 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,61 @@ Custom exceptions can be applied the same way they are with

## Table of Contents

* [Installation](#installation)
* [Usage](#usage)
* [Existing Plugins](#existing-plugins)
* [Discovery Plugins](#discovery-plugins)
* [Tool Plugins](#tool-plugins)
* [Contributing](#contributing)
* [Mypy](#mypy)
* [Formatting](#formatting)
- [Statick Markdown Plugins](#statick-markdown-plugins)
- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Usage](#usage)
- [Dependency Versions](#dependency-versions)
- [Pip Install](#pip-install)
- [Pip Install and Custom Configuration](#pip-install-and-custom-configuration)
- [Existing Plugins](#existing-plugins)
- [Discovery Plugins](#discovery-plugins)
- [Tool Plugins](#tool-plugins)
- [Contributing](#contributing)
- [Mypy](#mypy)
- [Formatting](#formatting)

## Installation

The recommended method to install these Statick plugins is via pip:

```shell
python3 -m pip install statick-md
pip install statick-md
```

You can also clone the repository and use it locally.

## Usage

Make sure you install all the dependencies from apt/npm:
Make sure you install all the dependencies from apt/npm.
See <https://github.com/nodesource/distributions> for Node/npm installation instructions.

Configure npm to allow a non-root user to install packages.

```shell
npm config set prefix '~/.local/'
```

Make sure `~/.local/bin` exists.
Check your `PATH` with `echo $PATH`.
If `~/.local/bin` is not listed then add it to your `PATH`.

```shell
cat install.txt | xargs sudo apt-get install -y
cat npm-deps.txt | xargs sudo npm install -g
mkdir -p ~/.local/bin
echo 'export PATH="$HOME/.local/bin/:$PATH"' >> ~/.bashrc
```

Install packages.

```shell
npm install -g markdownlint-cli
npm install -g write-good
```

### Dependency Versions

Markdownlint-cli has occasionally changed defaults via an upgrade that results in lots of new warnings.
To mitigate this you can pin the version of markdownlint-cli in npm-deps.txt by changing `markdownlint-cli` to `markdownlint-cli@0.19`.
To mitigate this you can pin the version of markdownlint-cli when installing by changing `markdownlint-cli` to `markdownlint-cli@0.19`.

### Pip Install

Expand All @@ -59,13 +82,12 @@ In that case your directory structure will look like the following:
```shell
project-root
|- md-project
|- statick-output
```

To run with the default configuration for the statick-md tools use:

```shell
statick md-project/ --output-directory statick-output/ --profile md-profile.yaml --config md-config.yaml
statick md-project/ -o /tmp/statick-output/ --level md --log info
```

### Pip Install and Custom Configuration
Expand All @@ -77,40 +99,16 @@ This example will have custom exceptions in the md-project, such that the direct

```shell
project-root
|- md-project
|- statick-config
|- rsc
|- exceptions.yaml
|- statick-output
|- md-project
|- statick-config
|- rsc
|- exceptions.yaml
```

For this setup you will run the following:

```shell
statick md-project/ --output-directory statick-output/ --user-paths md-project/statick-config/ --profile md-profile.yaml --config md-config.yaml
```

### Source Install and Custom Configuration

The last type of setup will be to have all of the tools available from cloning repositories, not installing from pip.
The directory structure will look like:

```shell
project-root
|- md-project
|- statick-config
|- rsc
|- exceptions.yaml
|- statick-output
|- statick
|- statick-md
```

Using the example where we want to override the default exceptions with
custom ones in the md-project, the command to run would be:

```shell
./statick/statick md-project/ --output-directory statick-output/ --user-paths statick-md/,statick-md/src/statick_md,md-project/statick-config/ --profile md-profile.yaml --config md-config.yaml
statick md-project/ --o /tmp/statick-output/ -u md-project/statick-config/ --level md
```

## Existing Plugins
Expand All @@ -127,7 +125,6 @@ reStructuredText | `.rst`
Tool | About
:--- | :----
[markdownlint][markdownlint] | A Node.js style checker and lint tool for Markdown/CommonMark files.
[proselint][proselint] | A linter for prose.
[rstcheck][rstcheck] | Checks syntax of reStructuredText and code blocks nested within it.
[rst-lint][rst-lint] | Checks syntax of reStructuredText and code blocks nested within it.
[write-good] | Naive linter for English prose.
Expand All @@ -150,25 +147,22 @@ To determine if proper types are being used in Statick Markdown the following co
types of reports that can be viewed with a text editor or web browser.

```shell
python3 -m pip install mypy
pip install mypy
mkdir report
mypy --ignore-missing-imports --strict --html-report report/ --txt-report report src
mypy --ignore-missing-imports --strict src
```

It is hoped that in the future we will generate coverage reports from mypy and use those to check for regressions.

### Formatting

Statick code is formatted using [black](https://github.com/psf/black).
To fix locally use

```shell
python3 -m pip install black
pip install black
black src tests
```

[markdownlint]: https://github.com/igorshubovych/markdownlint-cli
[proselint]: https://github.com/amperser/proselint
[rstcheck]: https://github.com/myint/rstcheck
[rst-lint]: https://github.com/twolfson/restructuredtext-lint
[write-good]: https://github.com/btford/write-good
2 changes: 1 addition & 1 deletion clean.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

rm -rf build/ dist/ output-py* .pytest_cache statick_md.egg-info/ statick_output/* .tox/
rm -rf build/ .coverage dist/ output-py* .pytest_cache statick_md.egg-info/ statick_output/* .tox/ ./*.log
find . -type d -name .mypy_cache -exec rm -rf {} +;
find . -type d -name __pycache__ -exec rm -rf {} +;
1 change: 0 additions & 1 deletion install.txt

This file was deleted.

1 change: 0 additions & 1 deletion npm-deps.txt

This file was deleted.

Loading