Skip to content

Commit

Permalink
Merge branch 'master' into update_dev_deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed Jan 29, 2023
2 parents 0bd629b + 7478623 commit 97ec4d5
Show file tree
Hide file tree
Showing 33 changed files with 6,918 additions and 1,293 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a7d80cf9a40ca7759f62da297cc53919b6616dca
36 changes: 36 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# The purpose of this file is to trigger review requests when PRs touch
# particular files. Those reviews are not mandatory, however it's often useful
# to have an expert pinged who is interested in only one part of codespell and
# doesn't follow general development.
#
# Note that only GitHub handles (whether individuals or teams) with commit
# rights should be added to this file.
# See https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
# for more details about how CODEOWNERS works.

# Each line is a file pattern followed by one or more owners.

# Copy-paste-adapted from SciPy

# Administrata and CIs
*.toml @larsoner
*.yml @larsoner
*.rst @larsoner @peternewman
*.cfg @larsoner
codespell.1.include @larsoner @peternewman
coverage* @larsoner
.github/* @larsoner @peternewman
.gitignore @larsoner @peternewman
Makefile @larsoner @peternewman

# Python code
codespell_lib/*.py @larsoner @peternewman
bin/* @larsoner @peternewman

# Dictionaries
codespell_lib/data/dictionary_code.txt @peternewman
codespell_lib/data/dictionary_en-GB_to_en-US.txt @peternewman
codespell_lib/data/dictionary_informal.txt @peternewman
codespell_lib/data/dictionary_names.txt @peternewman
codespell_lib/data/dictionary_rare.txt @peternewman
# codepell_lib/data/*.txt @luzpaz
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See: https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#about-the-dependabotyml-file
version: 2

updates:
# Configure check for outdated GitHub Actions actions in workflows.
# See: https://docs.github.com/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
- package-ecosystem: github-actions
directory: / # Check the repository's workflows under /.github/workflows/
schedule:
interval: daily
15 changes: 15 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: black

on:
- push
- pull_request
permissions: {}

jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: psf/black@stable
42 changes: 31 additions & 11 deletions .github/workflows/codespell-private.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,52 @@
# GitHub Action to check our dictionary, this should only be used by the codespell project itself
# For general usage in your repo, see the example in codespell.yml
# https://github.com/codespell-project/codespell
name: codespell Private Actions
# Concurrency cancels an action on a given PR once a new commit is pushed
name: Test Codespell
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: [push, pull_request]
permissions: {}
jobs:
test:
env:
REQUIRE_ASPELL: true
# Make sure we're using the latest aspell dictionary
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
name: Python ${{ matrix.python-version }} test
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: sudo apt-get install libaspell-dev aspell-en
- run: |
- name: Install dependencies
run: |
python --version # just to check
pip install -U pip wheel # upgrade to latest pip find 3.5 wheels; wheel to avoid errors
pip install codecov "setuptools!=47.2.0" docutils
pip install --upgrade "setuptools!=47.2.0" docutils setuptools_scm[toml] twine
pip install aspell-python-py3
pip install -e ".[dev]" # install the codespell dev packages
- run: python setup.py install
- run: codespell --help
- run: codespell --version
- run: make check
- run: codespell --check-filenames --skip="./.git/*,*.pyc,./codespell_lib/tests/test_basic.py,./codespell_lib/data/*,./example/code.c,./build/lib/codespell_lib/tests/test_basic.py,./build/lib/codespell_lib/data/*,README.rst,*.egg-info/*"
- uses: codecov/codecov-action@v3
- run: codespell --check-filenames --skip="./.git/*,*.pyc,./codespell_lib/tests/test_basic.py,./codespell_lib/data/*,./example/code.c,./build/lib/codespell_lib/tests/test_basic.py,./build/lib/codespell_lib/data/*,README.rst,*.egg-info/*,pyproject-codespell.precommit-toml"
# this file has an error
- run: "! codespell codespell_lib/tests/test_basic.py"
- run: codecov

make-check-dictionaries:
runs-on: ubuntu-latest
Expand All @@ -46,6 +56,8 @@ jobs:
with:
python-version: 3.x
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install general dependencies
run: pip install -U pip wheel # upgrade to latest pip find 3.5 wheels; wheel to avoid errors
- name: Install codespell dependencies
Expand All @@ -56,6 +68,14 @@ jobs:
flake8-annotation:
runs-on: ubuntu-latest
steps:
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install codespell dependencies
run: pip install -e ".[dev]"
- name: Flake8 with annotations
uses: TrueBrain/actions-flake8@v2
27 changes: 27 additions & 0 deletions .github/workflows/codespell-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test Codespell Windows
on:
- push
- pull_request
permissions: {}
jobs:
test-windows:
name: Test Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Install dependencies
run: |
python --version
pip install -U pip
pip install setuptools
pip install -e .[dev]
- run: codespell --help
- run: codespell --version
- run: pytest codespell_lib
- uses: codecov/codecov-action@v3
5 changes: 4 additions & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
# https://github.com/codespell-project/codespell
name: codespell
on: [push, pull_request]
permissions: {}
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
# When using this Action in other repos, the --skip option below can be removed
skip: ./.git,./codespell_lib/data,./example/code.c,test_basic.py,*.pyc,README.rst
skip: "./.git,./codespell_lib/data,./example/code.c,test_basic.py,*.pyc,README.rst,pyproject-codespell.precommit-toml"
16 changes: 16 additions & 0 deletions .github/workflows/isort.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: isort

on:
- push
- pull_request

permissions: {}

jobs:
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- uses: isort/isort-action@v1
26 changes: 26 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: mypy

on:
- push
- pull_request

permissions: {}

jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.7'

- name: Install dependencies
run: pip install -e .[types]

- name: Run mypy
run: mypy .
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Upload a Python Package using Twine when a release is created

name: Build
on:
release:
types: [published]
push:
branches:
- master
pull_request:
branches:
- master

permissions:
contents: read

jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Check package
run: twine check --strict dist/*
- name: Check env vars
run: |
echo "Triggered by: ${{ github.event_name }}"
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist

# PyPI on release
pypi:
needs: package
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ codespell.egg-info
*.pyc
*.orig
.cache/
.mypy_cache/
.pytest_cache/
codespell_lib/_version.py
junit-results.xml
*.egg-info/
Loading

0 comments on commit 97ec4d5

Please sign in to comment.