Skip to content

Commit

Permalink
chore: update cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
lyz-code committed Jun 10, 2022
1 parent 5df8279 commit 5cbaa61
Show file tree
Hide file tree
Showing 16 changed files with 213 additions and 102 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
@@ -1,6 +1,6 @@
{
"template": "https://github.com/lyz-code/cookiecutter-python-project",
"commit": "3f608095368b696881be01f6ea0241f04aa084cf",
"commit": "44fcc76a48952c2c7ecda8399599ac04caad9235",
"context": {
"cookiecutter": {
"project_name": "MkDocs Newsletter",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Expand Up @@ -4,7 +4,7 @@ name: Build
on: # yamllint disable-line rule:truthy
push:
branches:
- master
- main
workflow_dispatch:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Expand Up @@ -4,7 +4,7 @@ name: Tests
on: # yamllint disable-line rule:truthy
push:
branches:
- master
- main
pull_request:
types: [opened, synchronize]
workflow_dispatch:
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/update.yml
Expand Up @@ -27,19 +27,6 @@ jobs:
source .venv/bin/activate
pdm config use_venv True
- name: Update requirements
run: make update
run: make update-production
- name: Run tests
run: make all
- name: Commit files
run: |
rm -r .git/hooks
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add pdm.lock
git diff-index --quiet HEAD \
|| git commit -m "chore: update dependency requirements"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
.pdm.toml

# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python
Expand Down
33 changes: 27 additions & 6 deletions Makefile
Expand Up @@ -18,6 +18,27 @@ update:

@echo ""

.PHONY: update-production
update-production:
@echo "------------------------------------"
@echo "- Updating production dependencies -"
@echo "------------------------------------"

pdm update --production --no-sync
pdm sync --clean

@echo ""

.PHONY: outdated
outdated:
@echo "-------------------------"
@echo "- Outdated dependencies -"
@echo "-------------------------"

pdm update --dry-run --unconstrained

@echo ""

.PHONY: format
format:
@echo "----------------------"
Expand Down Expand Up @@ -78,7 +99,7 @@ test-examples:
@echo ""

.PHONY: all
all: lint mypy test security
all: lint mypy test security build-docs

.PHONY: clean
clean:
Expand Down Expand Up @@ -120,15 +141,15 @@ docs: test-examples
@echo ""

.PHONY: bump
bump: pull-master bump-version build-package upload-pypi clean
bump: pull-main bump-version build-package upload-pypi clean

.PHONY: pull-master
pull-master:
.PHONY: pull-main
pull-main:
@echo "------------------------"
@echo "- Updating repository -"
@echo "------------------------"

git checkout master
git checkout main
git pull

@echo ""
Expand All @@ -144,7 +165,7 @@ build-package: clean
@echo ""

.PHONY: build-docs
build-docs: test-examples
build-docs:
@echo "--------------------------"
@echo "- Building documentation -"
@echo "--------------------------"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -2,7 +2,7 @@

[![Actions Status](https://github.com/lyz-code/mkdocs-newsletter/workflows/Tests/badge.svg)](https://github.com/lyz-code/mkdocs-newsletter/actions)
[![Actions Status](https://github.com/lyz-code/mkdocs-newsletter/workflows/Build/badge.svg)](https://github.com/lyz-code/mkdocs-newsletter/actions)
[![Coverage Status](https://coveralls.io/repos/github/lyz-code/mkdocs-newsletter/badge.svg?branch=master)](https://coveralls.io/github/lyz-code/mkdocs-newsletter?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/lyz-code/mkdocs-newsletter/badge.svg?branch=main)](https://coveralls.io/github/lyz-code/mkdocs-newsletter?branch=main)

MkDocs plugin to show the changes of documentation repositories in a user
friendly format, at the same time that it's easy for the authors to maintain.
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
@@ -1,6 +1,6 @@
[![Actions Status](https://github.com/lyz-code/mkdocs-newsletter/workflows/Tests/badge.svg)](https://github.com/lyz-code/mkdocs-newsletter/actions)
[![Actions Status](https://github.com/lyz-code/mkdocs-newsletter/workflows/Build/badge.svg)](https://github.com/lyz-code/mkdocs-newsletter/actions)
[![Coverage Status](https://coveralls.io/repos/github/lyz-code/mkdocs-newsletter/badge.svg?branch=master)](https://coveralls.io/github/lyz-code/mkdocs-newsletter?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/lyz-code/mkdocs-newsletter/badge.svg?branch=main)](https://coveralls.io/github/lyz-code/mkdocs-newsletter?branch=main)

MkDocs plugin to show the changes of documentation repositories in a user
friendly format, at the same time that it's easy for the authors to maintain.
Expand Down Expand Up @@ -77,13 +77,13 @@ giants, namely:
[Black](https://black.readthedocs.io/en/stable/)
: Python formatter to keep a nice style without effort.

[Autoimport](https://github.com/lyz-code/autoimport)
[Autoimport](https://lyz-code.github.io/autoimport)
: Python formatter to automatically fix wrong import statements.

[isort](https://github.com/timothycrosley/isort)
: Python formatter to order the import statements.

[Pip-tools](https://github.com/jazzband/pip-tools)
[PDM](https://pdm.fming.dev/)
: Command line tool to manage the dependencies.

[Mkdocs](https://www.mkdocs.org/)
Expand Down
66 changes: 61 additions & 5 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 30 additions & 8 deletions pyproject.toml
Expand Up @@ -9,6 +9,11 @@ version_files = [
"src/mkdocs_newsletter/version.py",
]

# --------- Autoimport -------------

[tool.autoimport.common_statements]
"factories" = "from tests import factories"

# --------- PDM -------------

[project]
Expand Down Expand Up @@ -70,9 +75,7 @@ editable-backend = "path"
[tool.pdm.overrides]

# To be removed once https://github.com/flakeheaven/flakeheaven/issues/55 is solved
# To update to ">=3.10" once a version of pdm greater than 1.12.8 exists
# "importlib-metadata" = ">=3.10"
importlib-metadata = "4.11.1"
"importlib-metadata" = ">=3.10"

[tool.pdm.dev-dependencies]
lint = [
Expand Down Expand Up @@ -116,7 +119,7 @@ doc = [
"mkdocs-minify-plugin>=0.5.0",
"mkdocs-autolinks-plugin>=0.4.0",
"mkdocs-material>=8.0.5",
"mkdocstrings>=0.16.2",
"mkdocstrings[python]>=0.18",
"markdown-include>=0.6.0",
"mkdocs-section-index>=0.3.2",
]
Expand All @@ -132,6 +135,7 @@ fixers = [
]
typing = [
"mypy>=0.910",
"types-click>=7.1.8",
]
dev = [
"pre-commit>=2.16.0",
Expand Down Expand Up @@ -230,7 +234,10 @@ flake8-annotations-complexity = ["+*"]
flake8-bugbear = ["+*"]
flake8-comprehensions = ["+*"]
flake8-debugger = ["+*"]
flake8-docstrings = ["+*"]
flake8-docstrings = [
"+*",
"-D101", # Missing docstring, already covered by C0115 of pylint
]
flake8-eradicate = ["+*"]
flake8-expression-complexity = ["+*"]
flake8-fixme = ["+*"]
Expand All @@ -246,7 +253,8 @@ flake8-use-fstring = [
flake8-typing-imports = [
"+*",
"-TYP001", # guard import by `if False: # TYPE_CHECKING`: TYPE_CHECKING (not in
# 3.5.0, 3.5.1). We don't support Python < 3.6
# 3.5.0, 3.5.1). We don't support Python 3.5
"-TYP002", # @overload is broken in <3.5.2, but we don't support Python 3.5
]
flake8-variables-names = ["+*"]
dlint = ["+*"]
Expand All @@ -270,7 +278,11 @@ pycodestyle = [
# see https://github.com/PyCQA/pycodestyle/issues/197
# and https://github.com/psf/black/issues/113
]
pyflakes = ["+*"]
pyflakes = [
"+*",
"-F841", # Unused variable, already covered by W0612 of pylint
"-F821", # Undefined variable, already covered by E0602 of pylint
]

[tool.flakeheaven.exceptions."tests/"]
flake8-docstrings = [
Expand All @@ -281,7 +293,8 @@ flake8-eradicate = [
"-E800", # Found commented code, but it's not, it's a markdown header
]
flake8-annotations = [
"-ANN001"
"-ANN001",
"-ANN401", # Dynamically typed expressions (typing.Any) are disallowed
]
pylint = [
"-R0201", # Method could be a function. Raised because the methods of a test class
Expand Down Expand Up @@ -332,6 +345,15 @@ disallow_incomplete_defs = true
disallow_untyped_decorators = true
disallow_untyped_calls = true
disallow_untyped_defs = true
plugins = [
"pydantic.mypy"
]

[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true

[[tool.mypy.overrides]]
module = "tests.*"
Expand Down

0 comments on commit 5cbaa61

Please sign in to comment.